diff options
author | Martin Stockhammer <martin_s@apache.org> | 2021-01-03 17:29:03 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2021-01-03 17:29:03 +0100 |
commit | d50e02314093db0ba788a6c79d852e3025d5b939 (patch) | |
tree | c800c3f4e20968f06c704708ab659f84d577e5db /archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default | |
parent | 375a8d62308dd1b307316926ba6a46acc4a01eed (diff) | |
download | archiva-d50e02314093db0ba788a6c79d852e3025d5b939.tar.gz archiva-d50e02314093db0ba788a6c79d852e3025d5b939.zip |
Adding ldap properties
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default')
1 files changed, 11 insertions, 9 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java index cb4b391f0..56e3ba1bf 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java @@ -422,16 +422,18 @@ public class DefaultRedbackRuntimeConfigurationAdmin private void cleanupProperties( RedbackRuntimeConfiguration redbackRuntimeConfiguration ) { Map<String, String> properties = redbackRuntimeConfiguration.getConfigurationProperties(); + LdapConfiguration ldapConf = redbackRuntimeConfiguration.getLdapConfiguration( ); LDAP_MAPPER.getAllAttributes( ).stream( ).forEach( att -> properties.remove( att ) ); - - // cleanup groups <-> role mapping - /**for ( Map.Entry<String, String> entry : new HashMap<String, String>( properties ).entrySet() ) - { - if ( entry.getKey().startsWith( UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) ) - { - properties.remove( entry.getKey() ); - } - }*/ + List<String> prefixRemove = new ArrayList<>( ); + for ( String key : properties.keySet()) { + boolean prefixMapping = LDAP_MAPPER.isPrefixMapping( key ); + if (prefixMapping) { + prefixRemove.add( key ); + } else if ( key.startsWith( "ldap" ) && !LDAP_MAPPER.isMapping( key ) ) { + ldapConf.getExtraProperties( ).put( key, properties.get( key ) ); + } + } + prefixRemove.stream( ).forEach( att -> properties.remove( att ) ); } private org.apache.archiva.configuration.RedbackRuntimeConfiguration build( |