[java-identity-provider COMMIT] in /trunk/idp-profile-impl/src: main/java/net/shibboleth/idp/profile/interceptor/impl...

noreply at shibboleth.net noreply at shibboleth.net
Thu Nov 6 13:41:25 EST 2014


Author: scantor
Date: Thu Nov  6 13:41:25 2014
New Revision: 6852

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6852&view=rev
Log:
IDP-506 - Activating a non-existent flow handled as error.

Modified:
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContext.java
    trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/PopulateProfileInterceptorContextTest.java

Modified: trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContext.java?rev=6852&r1=6851&r2=6852&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContext.java (original)
+++ trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContext.java Thu Nov  6 13:41:25 2014
@@ -22,6 +22,7 @@
 
 import javax.annotation.Nonnull;
 
+import net.shibboleth.idp.profile.IdPEventIds;
 import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
 import net.shibboleth.idp.profile.interceptor.AbstractProfileInterceptorAction;
 import net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor;
@@ -31,6 +32,7 @@
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
+import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,11 +47,12 @@
 
 /**
  * An action that populates a {@link ProfileInterceptorContext} with {@link ProfileInterceptorFlowDescriptor}
- * objects filtered by flow IDs from a lookup function.
+ * objects based on flow IDs from a lookup function.
  * 
  * <p>The flow IDs used for filtering must omit the {@link ProfileInterceptorFlowDescriptor#FLOW_ID_PREFIX} prefix.</p>
  * 
  * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
+ * @event {@link IdPEventIds#INVALID_PROFILE_CONFIG}
  * @post The ProfileInterceptorContext is modified as above.
  */
 public class PopulateProfileInterceptorContext extends AbstractProfileInterceptorAction {
@@ -123,7 +126,9 @@
                     log.debug("{} Installing flow {} into interceptor context", getLogPrefix(), flowId);
                     interceptorContext.getAvailableFlows().add(flow.get());
                 } else {
-                    log.warn("{} Configured interceptor flow {} not available for use", getLogPrefix(), flowId);
+                    log.error("{} Configured interceptor flow {} not available for use", getLogPrefix(), flowId);
+                    ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_PROFILE_CONFIG);
+                    return;
                 }
             }
         }

Modified: trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/PopulateProfileInterceptorContextTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/PopulateProfileInterceptorContextTest.java?rev=6852&r1=6851&r2=6852&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/PopulateProfileInterceptorContextTest.java (original)
+++ trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/PopulateProfileInterceptorContextTest.java Thu Nov  6 13:41:25 2014
@@ -19,7 +19,10 @@
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 
+import net.shibboleth.idp.profile.ActionTestingSupport;
+import net.shibboleth.idp.profile.IdPEventIds;
 import net.shibboleth.idp.profile.RequestContextBuilder;
 import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
 import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
@@ -27,8 +30,8 @@
 import net.shibboleth.idp.profile.interceptor.impl.PopulateProfileInterceptorContext;
 import net.shibboleth.utilities.java.support.logic.FunctionSupport;
 
-import org.opensaml.profile.action.ActionTestingSupport;
 import org.opensaml.profile.context.ProfileRequestContext;
+import org.springframework.webflow.execution.Event;
 import org.springframework.webflow.execution.RequestContext;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
@@ -62,12 +65,12 @@
                 Arrays.asList("test1", "test2", "test3")));
         action.initialize();
 
-        action.execute(src);
+        final Event event = action.execute(src);
+        ActionTestingSupport.assertProceedEvent(event);
     }
 
     /** Test that the context is properly added. */

[... 23 lines stripped ...]


More information about the commits mailing list