Package net.shibboleth.idp.profile.impl

# Class FilterAttributes

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.profile.impl.FilterAttributes

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class FilterAttributes extends AbstractProfileAction
Action that invokes the `AttributeFilter` for the current request.

Event:
  `EventIds.PROCEED_EVENT_ID`, `IdPEventIds.UNABLE_FILTER_ATTRIBS`
Postcondition:
  If resolution is successful, the relevant RelyingPartyContext.getSubcontext(AttributeContext.class, false) != null

## Field Summary

Fields
Modifier and Type
Field
Description
`private AttributeContext`
`attributeContext`
AttributeContext to filter.
`private Function<ProfileRequestContext,AttributeContext>`
`attributeContextLookupStrategy`
Strategy used to locate the `AttributeContext` to filter.
`private final ReloadableService<AttributeFilter>`
`attributeFilterService`
Service used to get the engine used to filter attributes.
`private Function<ProfileRequestContext,AttributeFilterContext>`
`filterContextCreationStrategy`
Strategy used to locate or create the `AttributeFilterContext`.
`private Function<ProfileRequestContext,String>`
`issuerLookupStrategy`
Strategy used to locate the identity of the issuer associated with the attribute filtering.
`private Function<ProfileRequestContext,SAMLMetadataContext>`
`issuerMetadataContextLookupStrategy`
Strategy used to locate the `SAMLMetadataContext` for the issuer associated with a given `ProfileRequestContext`.
`private Function<AttributeFilterContext,SAMLMetadataContext>`
`issuerMetadataFromFilterLookupStrategy`
Strategy used to locate the `SAMLMetadataContext` for the issuer associated with a given `AttributeFilterContext`.
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`maskFailures`
Whether to treat resolver errors as equivalent to resolving no attributes.
`private Function<AttributeFilterContext,SAMLMetadataContext>`
`metadataFromFilterLookupStrategy`
Strategy used to locate the `SAMLMetadataContext` for the recipient associated with a given `AttributeFilterContext`.
`private MetadataResolver`
`metadataResolver`
Optional supplemental metadata source.
`private Function<ProfileRequestContext,String>`
`principalNameLookupStrategy`
Strategy used to locate the principal name associated with the attribute filtering.
`private Function<AttributeFilterContext,ProfileRequestContext>`
`profileRequestContextFromFilterLookupStrategy`
Strategy to locate the effectively rooted `ProfileRequestContext` from the `AttributeFilterContext`.
`private Function<AttributeFilterContext,SAMLMetadataContext>`
`proxiedMetadataFromFilterLookupStrategy`
Strategy used to locate the `SAMLMetadataContext` for the proxied requester via the `AttributeFilterContext`.
`private Function<ProfileRequestContext,ProxiedRequesterContext>`
`proxiedRequesterContextLookupStrategy`
Strategy used to locate the `ProxiedRequesterContext` associated with a given `ProfileRequestContext`.
`private Function<ProfileRequestContext,SAMLMetadataContext>`
`proxiedRequesterMetadataLookupStrategy`
Strategy used to locate the `SAMLMetadataContext` for the proxied requester.
`private Function<AttributeFilterContext,ProxiedRequesterContext>`
`proxiesFromFilterLookupStrategy`
Strategy used to locate the `ProxiedRequesterContext` associated with a given `AttributeFilterContext`.
`private Function<ProfileRequestContext,String>`
`recipientLookupStrategy`
Strategy used to locate the identity of the recipient associated with the attribute filtering.

## Constructor Summary

Constructors
Constructor
Description
`FilterAttributes(ReloadableService<AttributeFilter> filterService)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`private void`
`populateFilterContext(ProfileRequestContext profileRequestContext, AttributeFilterContext filterContext)`
Fill in the filter context data.
`void`
`setAttributeContextLookupStrategy(Function<ProfileRequestContext,AttributeContext> strategy)`
Set the strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`.
`void`
`setFilterContextCreationStrategy(Function<ProfileRequestContext,AttributeFilterContext> strategy)`
Set the strategy used to locate or create the `AttributeFilterContext` to populate.
`void`
`setIssuerLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the strategy used to lookup the issuer for this attribute filtering.
`void`
`setIssuerMetadataContextLookupStrategy(Function<ProfileRequestContext,SAMLMetadataContext> strategy)`
Sets the strategy used to locate the `SAMLMetadataContext` for the issuer associated with a given `ProfileRequestContext`.
`void`
`setMaskFailures(boolean flag)`
Set whether to treat resolution failure as equivalent to resolving no attributes.
`void`
`setMetadataContextLookupStrategy(Function<ProfileRequestContext,SAMLMetadataContext> strategy)`
Sets the strategy to find the `SAMLMetadataContext` from the `AttributeFilterContext`.
`void`
`setMetadataResolver(MetadataResolver resolver)`
Set a metadata source to use during filtering.
`void`
`setPrincipalNameLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the strategy used to locate the principal name for this attribute filtering.
`void`
`setProxiedRequesterContextLookupStrategy(Function<ProfileRequestContext,ProxiedRequesterContext> strategy)`
Sets the strategy used to locate the `ProxiedRequesterContext` associated with a given `ProfileRequestContext`.
`void`
`setProxiedRequesterMetadataContextLookupStrategy(Function<ProfileRequestContext,SAMLMetadataContext> strategy)`
Sets the strategy used to locate proxied requester metadata.
`void`
`setRecipientLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the strategy used to lookup the recipient for this attribute filtering.

### Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

`doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy`

### Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

`getActivationCondition, setActivationCondition`

### Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

`doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### attributeFilterService

@Nonnull private final ReloadableService<AttributeFilter> attributeFilterService
Service used to get the engine used to filter attributes.

### metadataResolver

@Nullable private MetadataResolver metadataResolver
Optional supplemental metadata source.

### issuerLookupStrategy

@Nullable private Function<ProfileRequestContext,String> issuerLookupStrategy
Strategy used to locate the identity of the issuer associated with the attribute filtering.

### recipientLookupStrategy

@Nullable private Function<ProfileRequestContext,String> recipientLookupStrategy
Strategy used to locate the identity of the recipient associated with the attribute filtering.

### filterContextCreationStrategy

@Nonnull private Function<ProfileRequestContext,AttributeFilterContext> filterContextCreationStrategy
Strategy used to locate or create the `AttributeFilterContext`.

### attributeContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
Strategy used to locate the `AttributeContext` to filter.

### principalNameLookupStrategy

@Nonnull private Function<ProfileRequestContext,String> principalNameLookupStrategy
Strategy used to locate the principal name associated with the attribute filtering.

### profileRequestContextFromFilterLookupStrategy

@Nonnull private Function<AttributeFilterContext,ProfileRequestContext> profileRequestContextFromFilterLookupStrategy
Strategy to locate the effectively rooted `ProfileRequestContext` from the `AttributeFilterContext`.

### issuerMetadataContextLookupStrategy

@Nullable private Function<ProfileRequestContext,SAMLMetadataContext> issuerMetadataContextLookupStrategy
Strategy used to locate the `SAMLMetadataContext` for the issuer associated with a given `ProfileRequestContext`.

### issuerMetadataFromFilterLookupStrategy

@Nullable private Function<AttributeFilterContext,SAMLMetadataContext> issuerMetadataFromFilterLookupStrategy
Strategy used to locate the `SAMLMetadataContext` for the issuer associated with a given `AttributeFilterContext`.

### metadataFromFilterLookupStrategy

@Nonnull private Function<AttributeFilterContext,SAMLMetadataContext> metadataFromFilterLookupStrategy
Strategy used to locate the `SAMLMetadataContext` for the recipient associated with a given `AttributeFilterContext`.

### proxiedRequesterContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,ProxiedRequesterContext> proxiedRequesterContextLookupStrategy
Strategy used to locate the `ProxiedRequesterContext` associated with a given `ProfileRequestContext`.

### proxiesFromFilterLookupStrategy

@Nonnull private Function<AttributeFilterContext,ProxiedRequesterContext> proxiesFromFilterLookupStrategy
Strategy used to locate the `ProxiedRequesterContext` associated with a given `AttributeFilterContext`.

### proxiedRequesterMetadataLookupStrategy

@Nullable private Function<ProfileRequestContext,SAMLMetadataContext> proxiedRequesterMetadataLookupStrategy
Strategy used to locate the `SAMLMetadataContext` for the proxied requester.

### proxiedMetadataFromFilterLookupStrategy

@Nullable private Function<AttributeFilterContext,SAMLMetadataContext> proxiedMetadataFromFilterLookupStrategy
Strategy used to locate the `SAMLMetadataContext` for the proxied requester via the `AttributeFilterContext`.

### maskFailures

private boolean maskFailures
Whether to treat resolver errors as equivalent to resolving no attributes.

### attributeContext

@NonnullBeforeExec private AttributeContext attributeContext
AttributeContext to filter.

## Constructor Details

### FilterAttributes

public FilterAttributes(@Nonnull ReloadableService<AttributeFilter> filterService)
Constructor.

Parameters:
  `filterService` - engine used to filter attributes

## Method Details

### setMetadataResolver

public void setMetadataResolver(@Nullable MetadataResolver resolver)
Set a metadata source to use during filtering.

Parameters:
  `resolver` - metadata resolver
Since:
  3.4.0

### setIssuerLookupStrategy

public void setIssuerLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
Set the strategy used to lookup the issuer for this attribute filtering.

Parameters:
  `strategy` - lookup strategy

### setRecipientLookupStrategy

public void setRecipientLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
Set the strategy used to lookup the recipient for this attribute filtering.

Parameters:
  `strategy` - lookup strategy

### setFilterContextCreationStrategy

public void setFilterContextCreationStrategy(@Nonnull Function<ProfileRequestContext,AttributeFilterContext> strategy)
Set the strategy used to locate or create the `AttributeFilterContext` to populate.

Parameters:
  `strategy` - lookup/creation strategy

### setAttributeContextLookupStrategy

public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
Set the strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`.

Parameters:
  `strategy` - strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`

### setPrincipalNameLookupStrategy

public void setPrincipalNameLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set the strategy used to locate the principal name for this attribute filtering.

Parameters:
  `strategy` - lookup strategy

### setIssuerMetadataContextLookupStrategy

public void setIssuerMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLMetadataContext> strategy)
Sets the strategy used to locate the `SAMLMetadataContext` for the issuer associated with a given `ProfileRequestContext`. Also sets the strategy to find the `SAMLMetadataContext` from the `AttributeFilterContext`.

Parameters:
  `strategy` - lookup strategy

### setMetadataContextLookupStrategy

public void setMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLMetadataContext> strategy)
Sets the strategy to find the `SAMLMetadataContext` from the `AttributeFilterContext`.

Parameters:
  `strategy` - lookup strategy

### setProxiedRequesterContextLookupStrategy

public void setProxiedRequesterContextLookupStrategy(@Nonnull Function<ProfileRequestContext,ProxiedRequesterContext> strategy)
Sets the strategy used to locate the `ProxiedRequesterContext` associated with a given `ProfileRequestContext`. Also sets the strategy to find the `ProxiedRequesterContext` from the `AttributeFilterContext`.

Parameters:
  `strategy` - lookup strategy
Since:
  3.4.0

### setProxiedRequesterMetadataContextLookupStrategy

public void setProxiedRequesterMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLMetadataContext> strategy)
Sets the strategy used to locate proxied requester metadata.

Parameters:
  `strategy` - lookup strategy
Since:
  4.2.0

### setMaskFailures

public void setMaskFailures(boolean flag)
Set whether to treat resolution failure as equivalent to resolving no attributes.

This matches the behavior of V2.

Parameters:
  `flag` - flag to set

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### populateFilterContext

private void populateFilterContext(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AttributeFilterContext filterContext)
Fill in the filter context data.

Parameters:
  `profileRequestContext` - current profile request context
  `filterContext` - context to populate