Class StaticMapCredentialResolver
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<Credential,,CriteriaSet> OrderedCredentialResolver,CredentialResolver,Ordered
The "exact" matching map is constructed as a nested three-level map, from Agent to Application to RelyingParty and finally to the list of credentials. Each layer uses a null key to signify "any" as a wildcard match.
The resolver recognizes these Criterion types:
ProfileRequestContextCriterion- used only for predicate evaluationAgentIDCriterion- used forAgent-indexed rulesApplicationIDCriterion- used forApplication-based rulesEntityIdCriterion- used for relying party-based rules
The absence of a criterion for map-based rules does not prevent rules applying to "any" of an object being applied.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.shibboleth.sp.credential.AbstractOrderedCredentialResolver
AbstractOrderedCredentialResolver.UsageCriterionPredicate -
Field Summary
FieldsModifier and TypeFieldDescriptionMaps between exact names of objects and credentials.private final org.slf4j.LoggerClass logger.private Map<Predicate<ProfileRequestContext>,List<Credential>> Maps between arbitrary conditions and credentials.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoResolve(CriteriaSet criteria) Subclasses implement this method to resolve the underlying objects.private voidresolveForAgent(List<Credential> accumulator, String agentID, CriteriaSet criteria) Resolves the nested mappings for the given Agent ID (or null) using the additional criteria.private voidresolveForApplication(List<Credential> accumulator, Map<String, Map<String, List<Credential>>> applicationRules, String applicationID, CriteriaSet criteria) Resolves the nested mappings for the given Application ID (or null) using the additional criteria.private voidresolveForRelyingParty(List<Credential> accumulator, Map<String, List<Credential>> relyingPartyRules, String relyingPartyID) Resolves the nested mappings for the given relying party ID (or null).voidsetAgentRules(Map<String, Map<String, List<Credential>>> map) Installs mappings based on Agent and RelyingParty IDs.voidsetAgentRulesEx(Map<String, Map<String, Map<String, List<Credential>>>> map) Installs mappings based on Agent, Application, and RelyingParty Ids.voidInstalls the map of conditions to apply to match to credentials.Methods inherited from class net.shibboleth.sp.credential.AbstractOrderedCredentialResolver
getOrder, resolve, resolveSingle, setFilterByUsage, setOrder, setProtocolsMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, 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. -
exactMatchCredentialMap
Maps between exact names of objects and credentials. -
predicateCredentialMap
Maps between arbitrary conditions and credentials.
-
-
Constructor Details
-
StaticMapCredentialResolver
public StaticMapCredentialResolver()Constructor.
-
-
Method Details
-
setAgentRules
Installs mappings based on Agent and RelyingParty IDs.This method produces mappings that ignore the Application identifier, which is the recommended approach.
A null map key signifies a wildcard match (ignoring that component).
- Parameters:
map- rules to add
-
setAgentRulesEx
Installs mappings based on Agent, Application, and RelyingParty Ids.This method produces mappings that can include the Application identifier, which is the most complex approach.
Note that this method does not currently make a cooy of the map or its contents, so the input must not be subsequently modified.
- Parameters:
map- rules to add
-
setPredicateRules
Installs the map of conditions to apply to match to credentials.This is a generic approach that allows arbitrary rules to be implemented in scripts or in Java to determine whether particular credentials should be resolved for a request.
- Parameters:
map- rules to add
-
resolveForRelyingParty
private void resolveForRelyingParty(@Nonnull List<Credential> accumulator, @Nonnull Map<String, List<Credential>> relyingPartyRules, @Nullable String relyingPartyID) Resolves the nested mappings for the given relying party ID (or null).- Parameters:
accumulator- list to populaterelyingPartyRules- nested mappingsrelyingPartyID- supplied relying party ID or null
-