[java-identity-provider] branch master updated: IDP-1328 Deprecate IdPAttribute names with spaces in them.

Rod Widdowson rdw at steadingsoftware.com
Tue Sep 11 11:55:58 EDT 2018


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=9c2a69a1921d6a39131902d7911230da0eb92318

The following commit(s) were added to refs/heads/master by this push:
       new  9c2a69a   IDP-1328 Deprecate IdPAttribute names with spaces in them.
9c2a69a is described below

commit 9c2a69a1921d6a39131902d7911230da0eb92318
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Sep 11 16:53:34 2018 +0100

    IDP-1328 Deprecate IdPAttribute names with spaces in them.
    
    https://issues.shibboleth.net/jira/browse/IDP-1328
---
 .../idp/attribute/resolver/AbstractAttributeDefinition.java    | 10 +++++++++-
 .../attribute/resolver/AbstractAttributeDefinitionTest.java    |  5 +++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinition.java b/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinition.java
index 7abff6e..85846b1 100644
--- a/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinition.java
+++ b/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinition.java
@@ -40,6 +40,8 @@ import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 import net.shibboleth.utilities.java.support.collection.CollectionSupport;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import org.slf4j.Logger;
@@ -223,9 +225,15 @@ public abstract class AbstractAttributeDefinition extends AbstractResolverPlugin
             }
         }
         super.doInitialize();
-
         // The Id is now definitive. Just in case it was used prior to that, reset the getPrefixCache
         logPrefix = null;
+        
+        if (getId().contains(" ")) {
+            DeprecationSupport.warn(ObjectType.CONFIGURATION, 
+                    "Use of IdP Attributes names with spaces in them", 
+                    getLogPrefix(), 
+                    null);
+        }
     }
 
     /**
diff --git a/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinitionTest.java b/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinitionTest.java
index c93026c..1d62c87 100644
--- a/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinitionTest.java
+++ b/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractAttributeDefinitionTest.java
@@ -215,6 +215,11 @@ public class AbstractAttributeDefinitionTest {
         Assert.assertEquals(depends.iterator().next().getDependencyAttributeId(), "source");
     }
     
+    @Test public void invalidName() throws ComponentInitializationException {
+        MockAttributeDefinition definition = new MockAttributeDefinition("Name With Space", (IdPAttribute) null);
+        definition.initialize();
+    }
+    
     @Test public void initDestroyValidate() throws ComponentInitializationException {
         MockAttributeEncoder encoder = new MockAttributeEncoder("foo", "baz");
         MockAttributeDefinition definition = new MockAttributeDefinition("foo", (IdPAttribute) null);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list