[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-spring/src: main/java/net/shibboleth/idp/attribute/r...

noreply at shibboleth.net noreply at shibboleth.net
Thu Nov 12 23:36:34 EST 2015


Author: dfisher
Date: Thu Nov 12 23:36:34 2015
New Revision: 7989

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7989&view=rev
Log:
IDP-864 - ldap resolver entryDN

v2 parser should produce an LDAPDataConnector that always returns the entryDN as an attribute.

Modified:
    trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
    trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/LDAPDataConnectorParserTest.java

Modified: trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java?rev=7989&r1=7988&r2=7989&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java	(original)
+++ trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java	Thu Nov 12 23:36:34 2015
@@ -49,6 +49,7 @@
 import org.ldaptive.SearchScope;
 import org.ldaptive.handler.CaseChangeEntryHandler;
 import org.ldaptive.handler.CaseChangeEntryHandler.CaseChange;
+import org.ldaptive.handler.DnAttributeEntryHandler;
 import org.ldaptive.handler.SearchEntryHandler;
 import org.ldaptive.pool.BlockingConnectionPool;
 import org.ldaptive.pool.IdlePruneStrategy;
@@ -680,13 +681,15 @@
         }
 
         /**
-         * Factory method for handling spring property replacement.
+         * Factory method for handling spring property replacement. Adds a {@link DnAttributeEntryHandler} by default.
+         * Adds a {@link CaseChangeEntryHandler} if lowercaseAttributeNames is true. 
          * 
          * @param lowercaseAttributeNames boolean string value
-         * @return possibly empty list of search entry handlers
+         * @return list of search entry handlers
          */
         public static List<SearchEntryHandler> buildSearchEntryHandlers(final String lowercaseAttributeNames) {
             final List<SearchEntryHandler> handlers = new ArrayList<>();
+            handlers.add(new DnAttributeEntryHandler());
             if (Boolean.valueOf(lowercaseAttributeNames)) {
                 final CaseChangeEntryHandler entryHandler = new CaseChangeEntryHandler();
                 entryHandler.setAttributeNameCaseChange(CaseChange.LOWER);

Modified: trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/LDAPDataConnectorParserTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/LDAPDataConnectorParserTest.java?rev=7989&r1=7988&r2=7989&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/LDAPDataConnectorParserTest.java	(original)
+++ trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/LDAPDataConnectorParserTest.java	Thu Nov 12 23:36:34 2015
@@ -137,6 +137,7 @@
                         TestSources.SP_ENTITY_ID);
         Map<String, IdPAttribute> attrs = dataConnector.resolve(context);
         Assert.assertNotNull(attrs);
+        Assert.assertNotNull(attrs.get("entryDN"));
     }
 
     @Test public void v2PropsConfig() throws Exception {
@@ -153,10 +154,11 @@
                         TestSources.SP_ENTITY_ID);
         Map<String, IdPAttribute> attrs = dataConnector.resolve(context);
         Assert.assertNotNull(attrs);
-        Assert.assertEquals(attrs.size(), 3);
+        Assert.assertEquals(attrs.size(), 4);
         Assert.assertNotNull(attrs.get("uid"));
         Assert.assertNotNull(attrs.get("homephone"));
         Assert.assertNotNull(attrs.get("mail"));
+        Assert.assertNotNull(attrs.get("entryDN"));
     }
 
     @Test public void springConfig() throws Exception {
@@ -244,6 +246,7 @@
         Assert.assertNotNull(attrs);
         Assert.assertNull(attrs.get("homephone"));
         Assert.assertNotNull(attrs.get("phonenumber"));
+        Assert.assertNotNull(attrs.get("entryDN"));
     }
 
     protected LDAPDataConnector getLdapDataConnector(Resource properties, final String[] beanDefinitions) throws IOException {



More information about the commits mailing list