[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/system/flows/intercept/attribute-release-flow....

noreply at shibboleth.net noreply at shibboleth.net
Tue Nov 24 19:25:42 EST 2015


Author: tzeller
Date: Tue Nov 24 19:25:42 2015
New Revision: 8012

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8012&view=rev
Log:
IDP-871 - Skip attribute release flow if attribute context is missing

Return 'InvalidAttributeContext' instead of 'InvalidProfileContext'.
Log at warn instead of error.
Add attribute-release-flow global-transition mapping 'InvalidAttributeContext' to 'proceed'.

Modified:
    trunk/idp-conf/src/main/resources/system/flows/intercept/attribute-release-flow.xml
    trunk/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java
    trunk/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java

Modified: trunk/idp-conf/src/main/resources/system/flows/intercept/attribute-release-flow.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/intercept/attribute-release-flow.xml?rev=8012&r1=8011&r2=8012&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/intercept/attribute-release-flow.xml	(original)
+++ trunk/idp-conf/src/main/resources/system/flows/intercept/attribute-release-flow.xml	Tue Nov 24 19:25:42 2015
@@ -186,6 +186,12 @@
 
     <end-state id="proceed" />
 
+
+    <global-transitions>
+        <!-- Catch "InvalidAttributeContext" and short-circuit this intercept flow. -->
+        <transition on="InvalidAttributeContext" to="proceed" />
+    </global-transitions>
+
     <bean-import resource="../../../system/flows/intercept/attribute-release-beans.xml" />
 
 </flow>

Modified: trunk/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java?rev=8012&r1=8011&r2=8012&view=diff
==============================================================================
--- trunk/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java	(original)
+++ trunk/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java	Tue Nov 24 19:25:42 2015
@@ -23,6 +23,7 @@
 import net.shibboleth.idp.attribute.context.AttributeContext;
 import net.shibboleth.idp.consent.context.impl.AttributeReleaseContext;
 import net.shibboleth.idp.consent.flow.impl.AbstractConsentAction;
+import net.shibboleth.idp.profile.IdPEventIds;
 import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
 import net.shibboleth.idp.profile.context.RelyingPartyContext;
 import net.shibboleth.utilities.java.support.logic.Constraint;
@@ -46,8 +47,12 @@
  * <li>the interceptor attempted flow is an {@link AttributeReleaseFlowDescriptor}</li>
  * <li>an {@link AttributeContext} is available from the {@link ProfileRequestContext}</li>
  * </ul>
+ *
+ * @pre See above.
  * 
- * @pre See above.
+ * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_PROFILE_CTX}
+ * @event {@link IdPEventIds#INVALID_ATTRIBUTE_CTX}
  */
 public abstract class AbstractAttributeReleaseAction extends AbstractConsentAction {
 
@@ -147,8 +152,8 @@
         attributeContext = attributeContextLookupStrategy.apply(profileRequestContext);
         log.debug("{} Found attributeContext '{}'", getLogPrefix(), attributeContext);
         if (attributeContext == null) {
-            log.error("{} Unable to locate attribute context", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
+            log.warn("{} Unable to locate attribute context", getLogPrefix());
+            ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_ATTRIBUTE_CTX);
             return false;
         }
 

Modified: trunk/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java?rev=8012&r1=8011&r2=8012&view=diff
==============================================================================
--- trunk/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java	(original)
+++ trunk/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java	Tue Nov 24 19:25:42 2015
@@ -34,6 +34,7 @@
 import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
 import net.shibboleth.idp.consent.logic.impl.PreferExplicitOrderComparator;
 import net.shibboleth.idp.profile.ActionTestingSupport;
+import net.shibboleth.idp.profile.IdPEventIds;
 import net.shibboleth.idp.profile.context.RelyingPartyContext;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 

[... 20 lines stripped ...]


More information about the commits mailing list