Merge branch 'DEVELOP' of ssh://git.eclipse.org:29418/openk-usermodules/org.eclipse.openk-usermodules.contactBaseData.backend into DEVELOP
diff --git a/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc b/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc
index 313b619..6a79087 100644
--- a/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc
+++ b/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc
@@ -733,6 +733,8 @@
like the Auth'n'Auth-Modul, because the token will be out of date)
* *authNAuthService.ribbon.listOfServers* Here one can configure the base
url to the Auth'n'Auth-Service
+* *ldap.enabled* If set to "true" the ldap functionality will be enabled
+* *ldap.scheduling.enabled* (true or false) swtiches the ldap synchronisation on/off
=== CI- and CD-Components
diff --git a/src/main/java/org/eclipse/openk/contactbasedata/service/LdapService.java b/src/main/java/org/eclipse/openk/contactbasedata/service/LdapService.java
index cc67420..d5f23e9 100644
--- a/src/main/java/org/eclipse/openk/contactbasedata/service/LdapService.java
+++ b/src/main/java/org/eclipse/openk/contactbasedata/service/LdapService.java
@@ -1,4 +1,5 @@
package org.eclipse.openk.contactbasedata.service;
+
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.eclipse.openk.contactbasedata.exceptions.NotFoundException;
@@ -26,7 +27,10 @@
@Service
public class LdapService {
- @Value("${ldap-sync.attribute-mapping.uid}")
+ @Value("${ldap.enabled}")
+ private Boolean ldapEnabled;
+
+ @Value("${ldap.attribute-mapping.uid}")
private String uid;
@Value("${ldap-sync.db-id-mapping.telephone-number-id}")
@@ -55,8 +59,9 @@
* @return list of LdapUsers
*/
public List<LdapUser> getAllLdapUsers() {
- return ldapTemplate.search(query()
- .where("objectclass").is("person"), ldapUserAttributesMapper);
+ return ldapEnabled.booleanValue()
+ ? ldapTemplate.search(query().where("objectclass").is("person"), ldapUserAttributesMapper)
+ : new ArrayList<>();
}
/**
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 0c70ee9..a3c35ba 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -24,6 +24,8 @@
port: 10389
urls: ldap://entopkon:10389
+ldap:
+ enabled: true
ldap-sync:
attribute-mapping:
uid: uid
@@ -93,6 +95,9 @@
flyway:
enabled: false
+ldap:
+ enabled: false
+
jwt:
tokenHeader: Authorization
useStaticJwt: true
@@ -108,6 +113,10 @@
useStaticJwt: false
staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
+
+ldap:
+ enabled: true
+
server:
port: 9155
@@ -123,6 +132,10 @@
spring:
profiles: devserver
+
+ldap:
+ enabled: true
+
jwt:
tokenHeader: Authorization
useStaticJwt: false
@@ -140,6 +153,9 @@
spring:
profiles: devserver-unsecure
+ldap:
+ enabled: true
+
jwt:
tokenHeader: Authorization
useStaticJwt: true
@@ -162,6 +178,9 @@
flyway:
enabled: false
+ldap:
+ enabled: false
+
server:
port: 9155
max-http-header-size: 262144
diff --git a/src/main/resources/application_localdev.yml b/src/main/resources/application_localdev.yml
index 4509d62..8b55d1a 100644
--- a/src/main/resources/application_localdev.yml
+++ b/src/main/resources/application_localdev.yml
@@ -48,6 +48,25 @@
session:
tracking-modes: cookie
+ldap:
+ enabled: false
+ldap-sync:
+ attribute-mapping:
+ uid: uid
+ fullname: cn
+ lastname: sn
+ firstname: givenname
+ title: title
+ mail: mail
+ department: department
+ telephone-number: phone
+ db-id-mapping:
+ mail-id: 1
+ telephone-number-id: 2
+ scheduling:
+ enabled: false
+ cron-expression: '*/10 * * * * *'
+
jwt:
tokenHeader: Authorization
useStaticJwt: true