public class AddProxyRestrictionToAssertions extends AbstractConditionalProfileAction
ProxyRestriction to every Assertion contained in a SAML 2
response, with the audiences and count obtained from a lookup function. If the containing
Conditions is not present, it will be created.| Modifier and Type | Field and Description |
|---|---|
private java.util.Collection<java.lang.String> |
audiences
Audiences to add.
|
private org.slf4j.Logger |
log
Class logger.
|
private com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> |
proxyAudiencesLookupStrategy
Strategy used to obtain the audiences to add.
|
private com.google.common.base.Function<ProfileRequestContext,java.lang.Long> |
proxyCountLookupStrategy
Strategy used to obtain the proxy count to add.
|
private Response |
response
Response to modify.
|
private com.google.common.base.Function<ProfileRequestContext,Response> |
responseLookupStrategy
Strategy used to locate the Response to operate on.
|
| Constructor and Description |
|---|
AddProxyRestrictionToAssertions()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addProxyRestriction(ProfileRequestContext profileRequestContext,
Conditions conditions)
Add the audiences obtained from a lookup function to the
ProxyRestriction. |
protected void |
doExecute(ProfileRequestContext profileRequestContext)
Performs this action.
|
protected void |
doInitialize() |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext)
Called prior to execution, actions may override this method to perform pre-processing for a request.
|
private ProxyRestriction |
getProxyRestriction(Conditions conditions)
Get the
ProxyRestriction to which audiences will be added. |
void |
setProxyAudiencesLookupStrategy(com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> strategy)
Set the strategy used to obtain the proxy restrictions to apply.
|
void |
setProxyCountLookupStrategy(com.google.common.base.Function<ProfileRequestContext,java.lang.Long> strategy)
Set the strategy used to obtain the proxy count to apply.
|
void |
setResponseLookupStrategy(com.google.common.base.Function<ProfileRequestContext,Response> strategy)
Set the strategy used to locate the Response to operate on.
|
getActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, initialize, isDestroyed, isInitialized@Nonnull private final org.slf4j.Logger log
@Nonnull private com.google.common.base.Function<ProfileRequestContext,Response> responseLookupStrategy
@Nullable private com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> proxyAudiencesLookupStrategy
@Nullable private com.google.common.base.Function<ProfileRequestContext,java.lang.Long> proxyCountLookupStrategy
@Nullable private Response response
@Nullable private java.util.Collection<java.lang.String> audiences
public AddProxyRestrictionToAssertions()
public void setResponseLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,Response> strategy)
strategy - lookup strategypublic void setProxyAudiencesLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> strategy)
strategy - lookup strategypublic void setProxyCountLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,java.lang.Long> strategy)
strategy - lookup strategyprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionprotected boolean doPreExecute(@Nonnull
ProfileRequestContext profileRequestContext)
If false is returned, execution will not proceed, and the action should attach an
EventContext to the context tree to signal how to continue with overall
workflow processing.
If returning successfully, the last step should be to return the result of the superclass version of this method.
doPreExecute in class AbstractConditionalProfileActionprofileRequestContext - the current IdP profile request contextprotected void doExecute(@Nonnull
ProfileRequestContext profileRequestContext)
doExecute in class AbstractProfileActionprofileRequestContext - the current IdP profile request contextprivate void addProxyRestriction(@Nonnull
ProfileRequestContext profileRequestContext,
@Nonnull
Conditions conditions)
ProxyRestriction. If no
ProxyRestriction exists on the given Conditions one is created and added.profileRequestContext - current profile request contextconditions - condition that has, or will receive the created, ProxyRestriction@Nonnull private ProxyRestriction getProxyRestriction(@Nonnull Conditions conditions)
ProxyRestriction to which audiences will be added.conditions - existing set of conditions