Package net.shibboleth.sp.agent.resolver
Class AbstractExternalAgentResolver
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.sp.agent.resolver.AbstractExternalAgentResolver
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<Agent,,CriteriaSet> AgentResolver
- Direct Known Subclasses:
FlatFileExternalAgentResolver
public abstract class AbstractExternalAgentResolver
extends AbstractIdentifiableInitializableComponent
implements AgentResolver
Abstract component that builds
Agent objects by loading information from
an external source in response to queries and applying locally configured settings.
The required criteria supported are AgentIDCriterion and AgentCredentialCriterion.
Includes optional caching.
The resolver is configured with any of the possible settings that must be settable on the
resulting object, which span the Agent, Application, and RelyingPartyConfiguration
interfaces.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStub record representing a "partial"Agentdefinition that the loader base class will "wrap" with the settings configured on the loader. -
Field Summary
FieldsModifier and TypeFieldDescriptionAllowed address ranges.private ReloadableService<AttributeFilter>Attribute filter.private ReloadableService<AttributeResolver>Attribute resolver.private Function<ProfileRequestContext,String> Lookup strategy for authenticating authority.(package private) StringAuthentication method.Authorized utility flows.private booleanWhether to enable caching.private CredentialResolverAccess to credentials indirectly.private Predicate<ProfileRequestContext>Controls whether detailed information about errors should be exposed.private Function<ProfileRequestContext,String> Discovery service lookup strategy.private CharsetCharacter set encoding for POST recovery.private DurationSets cache expiration based on last access time.private DurationSets cache expiration based on entry creation.private Function<ProfileRequestContext,String> Lookup function to supply issuer.private final org.slf4j.LoggerClass logger.private Function<ProfileRequestContext,List<String>> Logout admin list lookup strategy.private Function<ProfileRequestContext,List<String>> Logout consumer list lookup strategy.private Function<ProfileRequestContext,List<String>> Logout initiator list lookup strategy.private IntegerSize of cache.private StringMetrics name.private longLimit on size of form data to preserve.Lookup function to supplyprofileConfigurationsproperty.private ProtocolSupportServiceManagerProtocol manager to inject into agents.private Collection<RelyingPartyConfiguration>RP config overrides.private Cache<CriteriaSet,Agent> Agent resolution cache.Lookup function to supply securityConfiguration property.private Function<ProfileRequestContext,List<String>> Session initiator list lookup strategy.private StateManagerState management.private booleanWhether cached authentication is supported.private booleanWhether to support form submission preservation and recovery.private Function<ProfileRequestContext,List<String>> Token consumer list lookup strategy.Transcoding registry.private RelyingPartyConfigurationUnverified RP config. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractExternalAgentResolver(ProtocolSupportServiceManager protocolManager) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoResolve(CriteriaSet criteria) Performs resolution of a specific named agent record in the form of a template object which the base class will fully configure and resolve.resolve(CriteriaSet criteria) resolveSingle(CriteriaSet criteria) voidsetAllowedAddressRanges(Set<IPRange> ranges) Sets the network ranges from which this loader's agents may make requests.voidSet theAttributeFilterto use.voidSet theAttributeResolverto use.voidSet theAttributeTranscoderRegistryto use.voidsetAuthenticatingAuthority(String authority) Sets the identifier of the authenticating authority (IdP, OP, etc.) to use for this loader's agents.voidSets the lookup strategy for the identifier of the authenticating authority (IdP, OP, etc.) to use for this loader's agents.voidsetAuthenticationMethod(String method) Sets the authentication method to require for this loader's agents.voidSets the set of "utility" operations authorized for use by this loader's agents.voidsetCacheEnabled(boolean flag) Sets whether to enable caching.voidsetCharacterEncoding(String name) Sets the character encoding to apply for POST recovery.voidsetCredentialResolver(CredentialResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.voidsetDetailedErrors(boolean flag) Set whether detailed information about errors should be exposed.voidsetDetailedErrorsPredicate(Predicate<ProfileRequestContext> condition) Set a condition to determine whether detailed information about errors should be exposed.voidSets the discovery service URL to use in the event a session initiator cannot be executed.voidSets the lookup strategy for the discovery service URL to use in the event a session initiator cannot be executed.voidSets the cache policy to expire entries after access, with the time reset on each access.voidSets the cache policy to expire entries after creation.voidSet the name to use when issuing messages to peers.voidSet a lookup strategy for the name to use when issuing messages to peers.voidsetLogoutAdmins(Collection<String> admins) Sets the ordered collection of unprefixed admin logout flow IDs to use for this loader's agents.voidSets the lookup strategy for the ordered collection of unprefixed admin logout flow IDs to use for this loader's agents.voidsetLogoutConsumers(Collection<String> consumers) Sets the ordered collection of unprefixed logout consumer flow IDs to use for this loader's agents.voidSets the lookup strategy for the ordered collection of unprefixed logout consumer flow IDs to use for this loader's agents.voidsetLogoutInitiators(Collection<String> initiators) Sets the ordered collection of unprefixed logout initiator flow IDs to use for this loader's agents.voidSets the lookup strategy for the ordered collection of unprefixed logout initiator flow IDs to use for this loader's agents.voidSets the maximum cache size.voidsetMetricName(String name) Set name of metric to use for counters to track use of configurations.voidsetPostLimit(long limit) Sets limit on size of form data to preserve.voidSet the profile configurations for this relying party.voidsetProfileConfigurationsLookupStrategy(Function<ProfileRequestContext, Map<String, ProfileConfiguration>> strategy) Set a lookup strategy for theprofileConfigurationsproperty.voidsetRelyingPartyConfigurations(Collection<? extends RelyingPartyConfiguration> configs) Set the verified relying party configurations.voidsetSecurityConfiguration(SecurityConfiguration configuration) Sets the security configuration for this profile.voidsetSecurityConfigurationLookupStrategy(Function<ProfileRequestContext, SecurityConfiguration> strategy) Set a lookup strategy for the security configuration.voidsetSessionInitiators(Collection<String> initiators) Sets the ordered collection of unprefixed session initiator flow IDs to use for this loader's agents.voidSets the lookup strategy for the ordered collection of unprefixed session initiator flow IDs to use for this loader's agents.voidsetStateManager(StateManager manager) Set theStateManagerto use.voidsetSupportsCachedAuthentication(boolean flag) Sets whether this loader's agents support cached authentication via cookie.voidsetSupportsPostPreservation(boolean flag) Sets whether this loader's agents are permitted to submit form data for preservation during SSO.voidsetTokenConsumers(Collection<String> consumers) Sets the ordered collection of unprefixed token consumer flow IDs to use for this loader's agents.voidSets the lookup strategy for the ordered collection of unprefixed token consumer flow IDs to use for this loader's agents.voidsetUnverifiedConfiguration(RelyingPartyConfiguration configuration) Set theRelyingPartyConfigurationto use if the configuration is found to be "unverified" (via use ofVerifiedProfileCriterion).Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
protocolSupportManager
Protocol manager to inject into agents. -
cacheEnabled
private boolean cacheEnabledWhether to enable caching. -
maximumCachedElements
Size of cache. -
expireAfterAccess
Sets cache expiration based on last access time. -
expireAfterWrite
Sets cache expiration based on entry creation. -
resultsCache
Agent resolution cache. -
allowedAddressRanges
Allowed address ranges. -
supportsCachedAuthentication
private boolean supportsCachedAuthenticationWhether cached authentication is supported. -
authenticationMethod
Authentication method. -
supportsPostPreservation
private boolean supportsPostPreservationWhether to support form submission preservation and recovery. -
postLimit
private long postLimitLimit on size of form data to preserve. -
encoding
Character set encoding for POST recovery. -
authorizedOperations
Authorized utility flows. -
authenticatingAuthorityLookupStrategy
Lookup strategy for authenticating authority. -
sessionInitiatorLookupStrategy
Session initiator list lookup strategy. -
discoveryServiceLookupStrategy
Discovery service lookup strategy. -
tokenConsumerLookupStrategy
Token consumer list lookup strategy. -
logoutInitiatorLookupStrategy
Logout initiator list lookup strategy. -
logoutConsumerLookupStrategy
Logout consumer list lookup strategy. -
logoutAdminLookupStrategy
Logout admin list lookup strategy. -
stateManager
State management. -
transcodingRegistry
Transcoding registry. -
attributeResolver
Attribute resolver. -
attributeFilter
Attribute filter. -
credentialResolver
Access to credentials indirectly. -
issuerLookupStrategy
Lookup function to supply issuer. -
detailedErrorsPredicate
Controls whether detailed information about errors should be exposed. -
securityConfigurationLookupStrategy
@Nonnull private Function<ProfileRequestContext,SecurityConfiguration> securityConfigurationLookupStrategyLookup function to supply securityConfiguration property. -
profileConfigurationsLookupStrategy
@Nonnull private Function<ProfileRequestContext,Map<String, profileConfigurationsLookupStrategyProfileConfiguration>> Lookup function to supplyprofileConfigurationsproperty. -
unverifiedRelyingPartyConfiguration
Unverified RP config. -
relyingPartyConfigurationOverrides
RP config overrides. -
metricName
Metrics name.
-
-
Constructor Details
-
AbstractExternalAgentResolver
public AbstractExternalAgentResolver(@ParameterName(name="protocolManager") @Nonnull ProtocolSupportServiceManager protocolManager) Constructor.- Parameters:
protocolManager- injected plugin capability objects
-
-
Method Details
-
setCacheEnabled
public void setCacheEnabled(boolean flag) Sets whether to enable caching.Defaults to false.
- Parameters:
flag- flag to set
-
setMaximumCachedElements
Sets the maximum cache size.Defaults to 100.
- Parameters:
max- maximum size
-
setExpireAfterAccess
Sets the cache policy to expire entries after access, with the time reset on each access.Defaults to 4 hours.
Mutually exclusive with
setExpireAfterWrite(Duration).- Parameters:
exp- threshold
-
setExpireAfterWrite
Sets the cache policy to expire entries after creation.Defaults to null.
Mutually exclusive with
setExpireAfterAccess(Duration).- Parameters:
exp- threshold
-
setAllowedAddressRanges
Sets the network ranges from which this loader's agents may make requests.- Parameters:
ranges- allowed ranges
-
setAuthenticationMethod
Sets the authentication method to require for this loader's agents.Defaults to
Agent.AUTH_METHOD_BASIC.- Parameters:
method- method identifier
-
setSupportsCachedAuthentication
public void setSupportsCachedAuthentication(boolean flag) Sets whether this loader's agents support cached authentication via cookie.Defaults to true.
- Parameters:
flag- flag to set
-
setAuthorizedUtilityOperations
Sets the set of "utility" operations authorized for use by this loader's agents.Defaults to empty.
- Parameters:
ops- authorized operation names
-
setSupportsPostPreservation
public void setSupportsPostPreservation(boolean flag) Sets whether this loader's agents are permitted to submit form data for preservation during SSO.- Parameters:
flag- flag to set
-
setPostLimit
Sets limit on size of form data to preserve.- Parameters:
limit- size limit or 0 for none
-
setCharacterEncoding
Sets the character encoding to apply for POST recovery.- Parameters:
name- name of encoding
-
setAuthenticatingAuthority
Sets the identifier of the authenticating authority (IdP, OP, etc.) to use for this loader's agents.- Parameters:
authority- authority name
-
setDiscoveryService
Sets the discovery service URL to use in the event a session initiator cannot be executed.- Parameters:
url- discovery service URL
-
setDiscoveryServiceLookupStrategy
public void setDiscoveryServiceLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Sets the lookup strategy for the discovery service URL to use in the event a session initiator cannot be executed.- Parameters:
strategy- lookup strategy
-
setSessionInitiators
Sets the ordered collection of unprefixed session initiator flow IDs to use for this loader's agents.- Parameters:
initiators- ordered collection of unprefixed session initiator flow IDs
-
setSessionInitiatorsLookupStrategy
public void setSessionInitiatorsLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed session initiator flow IDs to use for this loader's agents.- Parameters:
strategy- lookup strategy
-
setTokenConsumers
Sets the ordered collection of unprefixed token consumer flow IDs to use for this loader's agents.- Parameters:
consumers- ordered collection of unprefixed token consumer flow IDs
-
setTokenConsumersLookupStrategy
public void setTokenConsumersLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed token consumer flow IDs to use for this loader's agents.- Parameters:
strategy- lookup strategy
-
setLogoutInitiators
Sets the ordered collection of unprefixed logout initiator flow IDs to use for this loader's agents.- Parameters:
initiators- ordered collection of unprefixed logout initiator flow IDs
-
setLogoutInitiatorsLookupStrategy
public void setLogoutInitiatorsLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed logout initiator flow IDs to use for this loader's agents.- Parameters:
strategy- lookup strategy
-
setLogoutConsumers
Sets the ordered collection of unprefixed logout consumer flow IDs to use for this loader's agents.- Parameters:
consumers- ordered collection of unprefixed logout consumer flow IDs
-
setLogoutConsumersLookupStrategy
public void setLogoutConsumersLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed logout consumer flow IDs to use for this loader's agents.- Parameters:
strategy- lookup strategy
-
setLogoutAdmins
Sets the ordered collection of unprefixed admin logout flow IDs to use for this loader's agents.- Parameters:
admins- ordered collection of unprefixed admin logout flow IDs
-
setLogoutAdminsLookupStrategy
public void setLogoutAdminsLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed admin logout flow IDs to use for this loader's agents.- Parameters:
strategy- lookup strategy
-
setStateManager
Set theStateManagerto use.- Parameters:
manager- state manager
-
setAuthenticatingAuthorityLookupStrategy
public void setAuthenticatingAuthorityLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Sets the lookup strategy for the identifier of the authenticating authority (IdP, OP, etc.) to use for this loader's agents.- Parameters:
strategy- lookup strategy
-
setCredentialResolver
@Deprecated(since="1.0.0", forRemoval=true) public void setCredentialResolver(@Nullable CredentialResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.Sets aCredentialResolverto use for resolving keys and certificates "indirectly" in support of the deprecated older methods.This method should not be relied on "publically", and is solely used internally for backward compatibility.
- Parameters:
resolver- credential resolver
-
setIssuer
Set the name to use when issuing messages to peers.- Parameters:
issuer- name to set
-
setIssuerLookupStrategy
Set a lookup strategy for the name to use when issuing messages to peers.- Parameters:
strategy- lookup strategy
-
setDetailedErrors
public void setDetailedErrors(boolean flag) Set whether detailed information about errors should be exposed.- Parameters:
flag- flag to set
-
setDetailedErrorsPredicate
Set a condition to determine whether detailed information about errors should be exposed.- Parameters:
condition- condition to set
-
setSecurityConfiguration
Sets the security configuration for this profile.- Parameters:
configuration- security configuration for this profile
-
setSecurityConfigurationLookupStrategy
public void setSecurityConfigurationLookupStrategy(@Nonnull Function<ProfileRequestContext, SecurityConfiguration> strategy) Set a lookup strategy for the security configuration.- Parameters:
strategy- lookup strategy
-
setProfileConfigurations
Set the profile configurations for this relying party.- Parameters:
configs- the configurations to set
-
setProfileConfigurationsLookupStrategy
public void setProfileConfigurationsLookupStrategy(@Nonnull Function<ProfileRequestContext, Map<String, ProfileConfiguration>> strategy) Set a lookup strategy for theprofileConfigurationsproperty.- Parameters:
strategy- lookup strategy
-
setRelyingPartyConfigurations
public void setRelyingPartyConfigurations(@Nullable Collection<? extends RelyingPartyConfiguration> configs) Set the verified relying party configurations.- Parameters:
configs- list of verified relying party configurations
-
setUnverifiedConfiguration
Set theRelyingPartyConfigurationto use if the configuration is found to be "unverified" (via use ofVerifiedProfileCriterion).- Parameters:
configuration- unverified configuration
-
setMetricName
Set name of metric to use for counters to track use of configurations.- Parameters:
name- name for counter metrics
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-