[java-identity-provider COMMIT] /trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttrib...

noreply at shibboleth.net noreply at shibboleth.net
Fri Aug 14 12:29:21 EDT 2015


Author: rdw
Date: Fri Aug 14 12:29:20 2015
New Revision: 7676

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7676&view=rev
Log:
IDP-726 Add logging

https://issues.shibboleth.net/jira/browse/IDP-726

Log (at trace) each principal and the attribute values it is being compared against.

Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java?rev=7676&r1=7675&r2=7676&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java	(original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java	Fri Aug 14 12:29:20 2015
@@ -45,13 +45,17 @@
 import com.google.common.base.Functions;
 
 /**
- * An authentication action that filters out potential authentication flows by comparing an
- * {@link IdPAttribute}'s values to the custom principals supported by each flow.
+ * An authentication action that filters out potential authentication flows by comparing an {@link IdPAttribute}'s
+ * values to the custom principals supported by each flow.
  * 
- * <p>The type of principals is ignored, and only string-based values of an attribute are supported.</p>
+ * <p>
+ * The type of principals is ignored, and only string-based values of an attribute are supported.
+ * </p>
  * 
  * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
- * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null</pre>
+ * @pre <pre>
+ * ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
+ * </pre>
  * @post AuthenticationContext.getPotentialFlows() is modified as above.
  */
 public class FilterFlowsByAttribute extends AbstractAuthenticationAction {
@@ -60,31 +64,33 @@
     @Nonnull private final Logger log = LoggerFactory.getLogger(FilterFlowsByAttribute.class);
 
     /** Lookup strategy for locating {@link AttributeContext}. */
-    @Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy;
-    
+    @Nonnull private Function<ProfileRequestContext, AttributeContext> attributeContextLookupStrategy;
+
     /** The attribute ID to look for. */
     @Nullable private String attributeId;
-    
+
     /** The attribute to match against. */
     @Nullable private IdPAttribute attribute;
-    
+
     /** Constructor. */
     public FilterFlowsByAttribute() {
-        attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
-                new ChildContextLookup<ProfileRequestContext,AuthenticationContext>(AuthenticationContext.class));
+        attributeContextLookupStrategy =
+                Functions.compose(new ChildContextLookup<>(AttributeContext.class),
+                        new ChildContextLookup<ProfileRequestContext, AuthenticationContext>(
+                                AuthenticationContext.class));
     }
-    
+
     /**
      * Set the lookup strategy for the {@link AttributeContext}.
      * 
      * @param strategy lookup strategy
      */
     public void setAttributeContextLookupStrategy(
-            @Nonnull final Function<ProfileRequestContext,AttributeContext> strategy) {
-        attributeContextLookupStrategy = Constraint.isNotNull(strategy,
-                "AttributeContext lookup strategy cannot be null");
+            @Nonnull final Function<ProfileRequestContext, AttributeContext> strategy) {
+        attributeContextLookupStrategy =
+                Constraint.isNotNull(strategy, "AttributeContext lookup strategy cannot be null");
     }
-    
+
     /**
      * Set the attribute ID to look for.
      * 
@@ -93,34 +99,32 @@
     public void setAttributeId(@Nullable String id) {
         attributeId = StringSupport.trimOrNull(id);
     }
-    
+
     /** {@inheritDoc} */
-    @Override
-    protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
+    @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
             @Nonnull final AuthenticationContext authenticationContext) {
-        
+
         if (!super.doPreExecute(profileRequestContext, authenticationContext) || attributeId == null) {
             return false;
         }
-        
+
         final AttributeContext attributeCtx = attributeContextLookupStrategy.apply(profileRequestContext);
         if (attributeCtx == null) {
             log.debug("{} Request does not contain an AttributeContext, nothing to do", getLogPrefix());
             return false;
         }
-        
+
         attribute = attributeCtx.getIdPAttributes().get(attributeId);
         if (attribute == null || attribute.getValues().isEmpty()) {

[... 63 lines stripped ...]


More information about the commits mailing list