feat: implement ldap connector
Description
Component for connecting to LDAP and getting attribute(s)
How to test
- downloading the repo from this branch to a machine that can connect to the Perun via LDAP such as id-test
- fill in the correct LDAP configuration info into application-test.yml (for example based on
microservices_global.yaml
) - add a test such as:
@Test public void testConnection() { ldapConnector.searchForEntity("ou=People", "(|(eduPersonPrincipalNames=485456@muni.cz))", new UserAttributesMapper()); }
LdapConnectorTest.java
- run the tests in the repo using:
./gradlew test --tests "perun.connector.connectors.LdapConnectorTest.testConnection" --info
Author's checklist
-
I have followed the contribution guidelines -
This MR has been tested or does not change functionality -
I have added relevant merge request dependencies (if this MR has any) -
I have added the correct labels -
I have assigned reviewers (if any are relevant) -
I have edited the documentation (if the changes require it) or I have noted the need for the change if I do not have access to the documentation -
I have marked all introduced BREAKING CHANGES or necessary DEPLOYMENT NOTES in the commit message(s)
Reviewer's checklist
-
This MR has been tested or does not change functionality -
This MR has correct commit message format
Other information
Source inspiration materials:
https://docs.spring.io/spring-ldap/docs/1.1/reference/#basic-searches https://www.baeldung.com/spring-ldap https://myshittycode.com/2017/03/26/ldaptemplate-attributesmapper-vs-contextmapper/
Related issues
Closes STR-1393