[java-shib-attribute] branch main updated: Remove vestigial PRC lookup property.

Scott Cantor cantor.2 at osu.edu
Mon Jul 11 16:58:15 UTC 2022


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

scantor pushed a commit to branch main
in repository java-shib-attribute.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=603d3004786e4e2832241e8637f25f92340e1678

The following commit(s) were added to refs/heads/main by this push:
     new 603d30047 Remove vestigial PRC lookup property.
603d30047 is described below

commit 603d3004786e4e2832241e8637f25f92340e1678
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jul 11 12:58:12 2022 -0400

    Remove vestigial PRC lookup property.
---
 .../ad/impl/ContextDerivedAttributeDefinition.java | 34 ++++------------------
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ContextDerivedAttributeDefinition.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ContextDerivedAttributeDefinition.java
index feb48ca7c..854511b90 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ContextDerivedAttributeDefinition.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ContextDerivedAttributeDefinition.java
@@ -34,7 +34,6 @@ import net.shibboleth.utilities.java.support.component.ComponentInitializationEx
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
-import org.opensaml.messaging.context.navigate.ParentContextLookup;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,9 +47,6 @@ public class ContextDerivedAttributeDefinition extends AbstractAttributeDefiniti
     /** Logger. */
     @Nonnull private final Logger log = LoggerFactory.getLogger(ContextDerivedAttributeDefinition.class);
 
-    /** Strategy used to locate the {@link ProfileRequestContext} to use. */
-    @Nonnull private Function<AttributeResolutionContext,ProfileRequestContext> prcLookupStrategy;
-
     /**
      * Function used to generate the values associated with the {@link ProfileRequestContext}
      * 
@@ -58,25 +54,6 @@ public class ContextDerivedAttributeDefinition extends AbstractAttributeDefiniti
      */
     @NonnullAfterInit private Function<ProfileRequestContext,List<IdPAttributeValue>> attributeValuesFunction;
 
-    /** Constructor. */
-    public ContextDerivedAttributeDefinition() {
-        prcLookupStrategy = new ParentContextLookup<>(ProfileRequestContext.class);
-    }
-
-    /**
-     * Set the strategy used to locate the {@link ProfileRequestContext} associated with a given
-     * {@link AttributeResolutionContext}.
-     * 
-     * @param strategy strategy used to locate the {@link ProfileRequestContext} associated with a given
-     *            {@link AttributeResolutionContext}
-     */
-    public void setProfileRequestContextLookupStrategy(
-            @Nonnull final Function<AttributeResolutionContext,ProfileRequestContext> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-
-        prcLookupStrategy = Constraint.isNotNull(strategy, "ProfileRequestContext lookup strategy cannot be null");
-    }
-
     /**
      * Sets the attribute value function.
      * 
@@ -101,15 +78,16 @@ public class ContextDerivedAttributeDefinition extends AbstractAttributeDefiniti
             @Nonnull final AttributeResolutionContext resolutionContext,
             @Nonnull final AttributeResolverWorkContext workContext) throws ResolutionException {
 
-        final ProfileRequestContext prc = prcLookupStrategy.apply(resolutionContext);
-        final List<IdPAttributeValue> results = attributeValuesFunction.apply(prc);
+        final List<IdPAttributeValue> results =
+                attributeValuesFunction.apply(
+                        resolutionContext.getProfileRequestContextLookupStrategy().apply(resolutionContext));
 
         if (null == results) {
-            log.debug("{} Generated no values.", getLogPrefix());
+            log.debug("{} Generated no values", getLogPrefix());
             return null;
         }
-        log.debug("{} Generated {} values.", getLogPrefix(), results.size());
-        log.trace("{} Values:", getLogPrefix(), results);
+        log.debug("{} Generated {} values", getLogPrefix(), results.size());
+        log.trace("{} Values: {}", getLogPrefix(), results);
         final IdPAttribute attribute = new IdPAttribute(getId());
         attribute.setValues(results);
         return attribute;

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


More information about the commits mailing list