[java-identity-provider COMMIT] in /trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile: context/navigate...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Jul 8 21:02:09 EDT 2014
Author: scantor
Date: Tue Jul 8 21:02:08 2014
New Revision: 6245
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6245&view=rev
Log:
Indirect principal name lookup in attribute actions.
Added:
trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/context/navigate/SessionContextPrincipalLookupFunction.java (with props)
trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/context/navigate/SubjectContextPrincipalLookupFunction.java (with props)
Modified:
trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java
trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolveAttributes.java
Modified: trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java?rev=6245&r1=6244&r2=6245&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java (original)
+++ trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java Tue Jul 8 21:02:08 2014
@@ -32,6 +32,7 @@
import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.idp.profile.context.navigate.SubjectContextPrincipalLookupFunction;
import net.shibboleth.idp.service.ReloadableService;
import net.shibboleth.idp.service.ServiceableComponent;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
@@ -79,10 +80,8 @@
/** Strategy used to locate the {@link AttributeContext} to filter. */
@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy;
- /**
- * Strategy used to locate the {@link SubjectContext} associated with a given {@link ProfileRequestContext}.
- */
- @Nonnull private Function<ProfileRequestContext,SubjectContext> subjectContextLookupStrategy;
+ /** Strategy used to locate the principal name associated with the attribute filtering. */
+ @Nonnull private Function<ProfileRequestContext,String> principalNameLookupStrategy;
/**
* Strategy used to locate the {@link AuthenticationContext} associated with a given {@link ProfileRequestContext}.
@@ -98,9 +97,6 @@
* Strategy used to locate the {@link SAMLMetadataContext} associated with a given {@link AttributeFilterContext}.
*/
@Nonnull private Function<AttributeFilterContext,SAMLMetadataContext> metadataFromFilterLookupStrategy;
-
- /** SubjectContext to work from. */
- @Nullable private SubjectContext subjectContext;
/** AuthenticationContext to work from (if any). */
@Nullable private AuthenticationContext authenticationContext;
@@ -111,9 +107,6 @@
/**
* Constructor.
*
- * <p>Initializes {@link #relyingPartyContextLookupStrategy}, {@link #authnContextLookupStrategy} and
- * {@link #subjectContextLookupStrategy} to {@link ChildContextLookup}.</p>
- *
* @param filterService engine used to filter attributes
*/
public FilterAttributes(@Nonnull final ReloadableService<AttributeFilter> filterService) {
@@ -124,7 +117,11 @@
attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
new ChildContextLookup<ProfileRequestContext,RelyingPartyContext>(RelyingPartyContext.class));
- subjectContextLookupStrategy = new ChildContextLookup<>(SubjectContext.class);
+
+ principalNameLookupStrategy = Functions.compose(
+ new SubjectContextPrincipalLookupFunction(),
+ new ChildContextLookup<ProfileRequestContext,SubjectContext>(SubjectContext.class));
+
authnContextLookupStrategy = new ChildContextLookup<>(AuthenticationContext.class);
// Default: inbound msg context -> SAMLPeerEntityContext -> SAMLMetadataContext
@@ -199,16 +196,14 @@
}
/**
- * Set the strategy used to locate the {@link SubjectContext} associated with a given {@link ProfileRequestContext}.
- *
- * @param strategy strategy used to locate the {@link SubjectContext} associated with a given
- * {@link ProfileRequestContext}
- */
- public void setSubjectContextLookupStrategy(
- @Nonnull final Function<ProfileRequestContext,SubjectContext> strategy) {
- ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-
- subjectContextLookupStrategy = Constraint.isNotNull(strategy, "SubjectContext lookup strategy cannot be null");
+ * Set the strategy used to locate the principal name for this attribute filtering.
+ *
+ * @param strategy lookup strategy
+ */
[... 145 lines stripped ...]
More information about the commits
mailing list