Class SAMLAttributeDataConnector
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
net.shibboleth.idp.attribute.resolver.AbstractDataConnector
net.shibboleth.idp.attribute.resolver.dc.impl.testing.SAMLAttributeDataConnector
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,,IdPAttribute>> Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
Data Connector to extra attributes from a saml2
Assertion. It is hoped that this connector will eventually
end up being used in mainline operation, which is why the code looks more suitable for being plugged into a webflow
than into a test.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<AttributeResolutionContext,List<Attribute>> The way to get the list of (SAML) attributes from the resolution context.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,IdPAttribute> doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Retrieves a collection of attributes from some data source.protected voidprivate IdPAttributeValueencodeString(XSString inputString) Encode a string into an attribute value.protected IdPAttributeValueencodeValue(XMLObject object) Method to convert a singledXMLObjectinto anIdPAttributeValueif possible.protected List<IdPAttributeValue>encodeValues(List<XMLObject> attributeValues) Encode a list of SAML objects as set ofIdPAttributeValue.Gets the strategy for finding the (SAML) Attributes from the resolution context.voidSets the strategy for finding the(SAML) Attributes from the resolution context.Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector
doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelayMethods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptionsMethods 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, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface org.springframework.beans.factory.DisposableBean
destroyMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
attributesStrategy
The way to get the list of (SAML) attributes from the resolution context.
-
-
Constructor Details
-
SAMLAttributeDataConnector
public SAMLAttributeDataConnector()
-
-
Method Details
-
getAttributesStrategy
@NonnullAfterInit public Function<AttributeResolutionContext,List<Attribute>> getAttributesStrategy()Gets the strategy for finding the (SAML) Attributes from the resolution context.- Returns:
- the required strategy.
-
setAttributesStrategy
Sets the strategy for finding the(SAML) Attributes from the resolution context.- Parameters:
strategy- to set.
-
doInitialize
- Overrides:
doInitializein classAbstractDataConnector- Throws:
ComponentInitializationException
-
encodeValue
Method to convert a singledXMLObjectinto anIdPAttributeValueif possible. For testing this is hard-wired - strings become scoped or non scoped (with the scope delimiter being '@'), everything else anXMLObjectAttributeValue- Parameters:
object- the object to encode- Returns:
- an
IdPAttributeValue, or null if no encoding exists.
-
encodeString
Encode a string into an attribute value.- Parameters:
inputString- string to encode- Returns:
- encoded attribute value
-
encodeValues
Encode a list of SAML objects as set ofIdPAttributeValue.- Parameters:
attributeValues- the input values- Returns:
- a list of values, Possibly empty.
-
doDataConnectorResolve
@Nullable protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException Retrieves a collection of attributes from some data source.- Specified by:
doDataConnectorResolvein classAbstractDataConnector- Parameters:
resolutionContext- current resolution contextworkContext- current resolver work context- Returns:
- collected attributes indexed by attribute ID
- Throws:
ResolutionException- thrown if there is a problem resolving the attributes
-