Class AttributeRevocationCondition
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.revocation.impl.AttributeRevocationCondition
-
- All Implemented Interfaces:
BiPredicate<ProfileRequestContext,AuthenticationResult>,Component,DestructableComponent,InitializableComponent
public class AttributeRevocationCondition extends AbstractInitializableComponent implements BiPredicate<ProfileRequestContext,AuthenticationResult>
A condition for login flows that checks for revocation against a resolvedIdPAttribute.- Since:
- 4.3.0
-
-
Field Summary
Fields Modifier and Type Field Description private StringattributeIdAttribute ID to resolve.private ReloadableService<AttributeResolver>attributeResolverAttribute Resolver service.private Function<ProfileRequestContext,String>issuerLookupStrategyStrategy used to locate the identity of the issuer associated with the attribute resolution.private org.slf4j.LoggerlogClass logger.private Function<ProfileRequestContext,String>principalNameLookupStrategyLookup strategy for principal name.private Function<ProfileRequestContext,String>recipientLookupStrategyStrategy used to locate the identity of the recipient associated with the attribute resolution.
-
Constructor Summary
Constructors Constructor Description AttributeRevocationCondition()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private AttributeResolutionContextbuildResolutionContext(ProfileRequestContext profileRequestContext, String principal)Build anAttributeResolutionContextto use.protected voiddoInitialize()protected booleanisRevoked(String principal, AuthenticationResult result, Collection<Instant> revocationRecords)Check the revocation records' timestamps for applicability.voidsetAttributeId(String id)Set the ID of anIdPAttributeto resolve to obtain revocation records for the principal.voidsetAttributeResolver(ReloadableService<AttributeResolver> service)SetAttributeResolverto use.voidsetIssuerLookupStrategy(Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the issuer for this attribute resolution.voidsetPrincipalNameLookupStrategy(Function<ProfileRequestContext,String> strategy)Set lookup strategy for principal name.voidsetRecipientLookupStrategy(Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the recipient for this attribute resolution.booleantest(ProfileRequestContext input, AuthenticationResult input2)-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, 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 java.util.function.BiPredicate
and, negate, or
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
principalNameLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,String> principalNameLookupStrategy
Lookup strategy for principal name.
-
issuerLookupStrategy
@Nullable private Function<ProfileRequestContext,String> issuerLookupStrategy
Strategy used to locate the identity of the issuer associated with the attribute resolution.
-
recipientLookupStrategy
@Nullable private Function<ProfileRequestContext,String> recipientLookupStrategy
Strategy used to locate the identity of the recipient associated with the attribute resolution.
-
attributeResolver
@NonnullAfterInit private ReloadableService<AttributeResolver> attributeResolver
Attribute Resolver service.
-
attributeId
@NonnullAfterInit @NotEmpty private String attributeId
Attribute ID to resolve.
-
-
Method Detail
-
setPrincipalNameLookupStrategy
public void setPrincipalNameLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)Set lookup strategy for principal name.- Parameters:
strategy- lookup strategy
-
setIssuerLookupStrategy
public void setIssuerLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the issuer for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setRecipientLookupStrategy
public void setRecipientLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the recipient for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setAttributeResolver
public void setAttributeResolver(@Nonnull ReloadableService<AttributeResolver> service)SetAttributeResolverto use.- Parameters:
service- attribute resolver service
-
setAttributeId
public void setAttributeId(@Nonnull @NotEmpty String id)
Set the ID of anIdPAttributeto resolve to obtain revocation records for the principal.- Parameters:
id- attribute ID to resolve
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
test
public boolean test(@Nullable ProfileRequestContext input, @Nullable AuthenticationResult input2)- Specified by:
testin interfaceBiPredicate<ProfileRequestContext,AuthenticationResult>
-
buildResolutionContext
@Nonnull private AttributeResolutionContext buildResolutionContext(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String principal)
Build anAttributeResolutionContextto use.- Parameters:
profileRequestContext- profile request contextprincipal- name of principal- Returns:
- the attached context
-
isRevoked
protected boolean isRevoked(@Nonnull @NotEmpty String principal, @Nonnull AuthenticationResult result, @Nonnull @NonnullElements Collection<Instant> revocationRecords)
Check the revocation records' timestamps for applicability.- Parameters:
principal- name of principalresult- active result being checkedrevocationRecords- the records from the cache- Returns:
- true iff the revocation applies to this result
-
-