[java-shib-attribute] branch main updated: JSATTR-2 Move PRC lookup strategy into resolution context

Rod Widdowson rdw at steadingsoftware.com
Tue Aug 16 14:33:05 UTC 2022


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

rdw 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=8be2415c24319190b04333db9a42bb6916740bd5

The following commit(s) were added to refs/heads/main by this push:
     new 8be2415c2 JSATTR-2 Move PRC lookup strategy into resolution context
8be2415c2 is described below

commit 8be2415c24319190b04333db9a42bb6916740bd5
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Aug 16 15:31:46 2022 +0100

    JSATTR-2 Move PRC lookup strategy into resolution context
    
    https://shibboleth.atlassian.net/browse/JSATTR-2
    
    AttributeResolverImpl no longer has a PRC stratefy relying
    rather in the one that the ARC carries
---
 .../resolver/impl/AttributeResolverImpl.java       | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
index 0fcd4ff39..eaeddd9c6 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
@@ -97,14 +97,7 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
     /** Whether to strip null attribute values. */
     private boolean stripNulls;
 
-    /** Strategy to get the {@link ProfileRequestContext}. */
-    @Nonnull private Function<AttributeResolutionContext,ProfileRequestContext> profileContextStrategy;
 
-    /** Constructor. */
-    public AttributeResolverImpl() {
-        profileContextStrategy = new ParentContextLookup<>(ProfileRequestContext.class);
-    }
-    
     /** Sets the attribute definitions for this resolver.
      * @param definitions attribute definitions loaded in to this resolver
      */
@@ -181,17 +174,6 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
         stripNulls = doStripNulls;
     }
 
-    /**
-     * Set the mechanism to obtain the {@link ProfileRequestContext}.
-     * 
-     * @param strategy lookup strategy
-     */
-    public void setProfileContextLookupStrategy(
-            @Nonnull final Function<AttributeResolutionContext,ProfileRequestContext> strategy) {
-        checkSetterPreconditions();        
-        profileContextStrategy = Constraint.isNotNull(strategy, "ProfileRequestContext lookup strategy cannot be null");
-    }
-    
     /**
      * Resolves the attribute for the given request. Note, if attributes are requested,
      * {@link AttributeResolutionContext#getRequestedIdPAttributeNames()}, the resolver will <strong>not</strong> fail
@@ -737,7 +719,7 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
      * @return true iff the {@link #stopTimer(AttributeResolutionContext)} method needs to be called
      */
     private boolean startTimer(@Nonnull final AttributeResolutionContext resolutionContext) {
-        final BaseContext prc = profileContextStrategy.apply(resolutionContext);
+        final BaseContext prc = resolutionContext.getProfileRequestContextLookupStrategy().apply(resolutionContext);
         if (prc != null) {
             final MetricContext timerCtx = prc.getSubcontext(MetricContext.class);
             if (timerCtx != null) {
@@ -754,7 +736,7 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
      * @param resolutionContext attribute resolution context
      */
     private void stopTimer(@Nonnull final AttributeResolutionContext resolutionContext) {
-        final BaseContext prc = profileContextStrategy.apply(resolutionContext);
+        final BaseContext prc = resolutionContext.getProfileRequestContextLookupStrategy().apply(resolutionContext);
         if (prc != null) {
             final MetricContext timerCtx = prc.getSubcontext(MetricContext.class);
             if (timerCtx != null) {

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


More information about the commits mailing list