[java-identity-provider COMMIT] in /trunk/idp-consent/src: main/java/net/shibboleth/idp/consent/flow/ExtractConsent.j...

noreply at shibboleth.net noreply at shibboleth.net
Tue Nov 18 16:39:23 EST 2014


Author: tzeller
Date: Tue Nov 18 16:39:23 2014
New Revision: 6941

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6941&view=rev
Log:
Checkpoint consent cleanup and tests. Fix bug in PopulateAttributeReleaseContext.

Added:
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ar/AbstractAttributeReleaseActionTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ar/InitializeAttributeReleaseContextTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContextTest.java   (with props)
Modified:
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ExtractConsent.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/InitializeAttributeReleaseContext.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContext.java
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/ConsentTestingSupport.java
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/context/ConsentContextTest.java
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ExtractConsentTest.java
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/PopulateConsentContextTest.java

Modified: trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ExtractConsent.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ExtractConsent.java?rev=6941&r1=6940&r2=6941&view=diff
==============================================================================
--- trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ExtractConsent.java (original)
+++ trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ExtractConsent.java Tue Nov 18 16:39:23 2014
@@ -52,6 +52,7 @@
 public class ExtractConsent extends AbstractConsentAction {
 
     /** Parameter name for consent IDs. */
+    // TODO probably change to _idp_consentIds or something
     @Nonnull @NotEmpty public static final String CONSENT_IDS_REQUEST_PARAMETER = "consentIds";
 
     /** Class logger. */

Modified: trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/InitializeAttributeReleaseContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/InitializeAttributeReleaseContext.java?rev=6941&r1=6940&r2=6941&view=diff
==============================================================================
--- trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/InitializeAttributeReleaseContext.java (original)
+++ trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/InitializeAttributeReleaseContext.java Tue Nov 18 16:39:23 2014
@@ -30,7 +30,8 @@
 /**
  * Action that creates an {@link AttributeReleaseContext} and attaches it to the current {@link ProfileRequestContext}.
  * 
- * TODO details
+ * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
+ * @post See above.
  */
 public class InitializeAttributeReleaseContext extends AbstractProfileInterceptorAction {
 

Modified: trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContext.java?rev=6941&r1=6940&r2=6941&view=diff
==============================================================================
--- trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContext.java (original)
+++ trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContext.java Tue Nov 18 16:39:23 2014
@@ -23,6 +23,7 @@
 
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
 import org.opensaml.profile.context.ProfileRequestContext;
@@ -34,9 +35,11 @@
 
 /**
  * Attribute consent action to populate the attribute consent context with the attributes for which consent should be
- * obtained.
+ * obtained. A predicate is used to determine whether consent should be obtained for each IdP attribute in the attribute
+ * context.
  * 
- * TODO details
+ * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
+ * @post See above.
  */
 public class PopulateAttributeReleaseContext extends AbstractAttributeReleaseAction {
 
@@ -56,24 +59,30 @@
     }
 
     /** {@inheritDoc} */
+    @Override protected void doInitialize() throws ComponentInitializationException {
+        super.doInitialize();
+
+        if (attributePredicate == null) {
+            throw new ComponentInitializationException("Attribute predicate cannot be null");
+        }
+    }
+
+    /** {@inheritDoc} */

[... 134 lines stripped ...]


More information about the commits mailing list