Class AddMetadata
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.sp.profile.AbstractAgentRequestAction
net.shibboleth.sp.profile.AbstractAgentAction
net.shibboleth.sp.profile.AbstractApplicationAction
net.shibboleth.sp.saml.saml2.profile.impl.AddMetadata
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that adds an outbound
MessageContext and stores a SAML Metadata document as the
outbound message.
Metadata is produced from different possible sources based on profile configuration,
currently either an evaluated Velocity template on a configurable path, or sourced from
the hub's MetadataResolver service.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_MESSAGE,EventIds.INVALID_MSG_CTX,EventIds.INVALID_PROFILE_CTX,EventIds.IO_ERROR,EventIds.MESSAGE_PROC_ERROR,EventIds.UNABLE_TO_DECODE,IdPEventIds.INVALID_PROFILE_CONFIG- Postcondition:
- ProfileRequestContext.getOutboundMessageContext().getMessage() instanceof EntityDescriptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Velocity context variable name for the Agent ID.static final StringThe Velocity context variable name for the Application ID.static final StringThe Velocity context variable name for the iterable encryption keys.static final StringThe Velocity context variable name for the entity ID requesting the metadata.static final StringThe Velocity context variable name for the issuer about whom the metadata is.static final StringThe Velocity context variable name for theProfileRequestContext.static final StringThe Velocity context variable name for theHttpServletRequest.static final StringThe Velocity context variable name for the iterable signing keys.private ReloadableService<CredentialResolver>Source of keys to be published into the metadata.private DDFInput message from agent.private StringEntityID to populate into Issuer element.private Function<ProfileRequestContext,String> Strategy used to obtain the request issuer value.private org.slf4j.LoggerClass logger.private ParserPoolParser to use.Applicable profile configuration.private org.apache.velocity.app.VelocityEngineVelocity engine. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidadjustTimestamps(ProfileRequestContext profileRequestContext, EntityDescriptor entity) private CriteriaSetbuildCriteriaSet(ProfileRequestContext profileRequestContext) Construct initialCriteriaSetto supply toCredentialResolver.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) private EntityDescriptordoResolver(ProfileRequestContext profileRequestContext) Queries the system'sMetadataResolverfor metadata about the issuer.private EntityDescriptordoTemplate(ProfileRequestContext profileRequestContext, Template template) Produce metadata by parsing a template, with or without Velocity.private org.apache.velocity.VelocityContextgetVelocityContext(ProfileRequestContext profileRequestContext) Creates and populates aVelocityContextfor template evaluation.private StringresourceToString(ProfileRequestContext profileRequestContext, String path) Loads a resource via Spring and returns the contents as a String.voidSets theCredentialResolverto use for obtaining keys to export to Velocity if enabled.voidSet the strategy used to locate the issuer value to use.voidsetParserPool(ParserPool pool) Sets theParserPoolto use.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine engine) Sets theVelocityEngineto use.Methods inherited from class net.shibboleth.sp.profile.AbstractApplicationAction
ensureApplication, getApplicationMethods inherited from class net.shibboleth.sp.profile.AbstractAgentAction
ensureAgent, getAgentMethods inherited from class net.shibboleth.sp.profile.AbstractAgentRequestAction
ensureAgentRequestContext, getAgentRequestContext, setAgentRequestContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.InitializableComponent
initialize, isInitialized
-
Field Details
-
CONTEXT_KEY_AGENT_ID
The Velocity context variable name for the Agent ID.- See Also:
-
CONTEXT_KEY_APPLICATION_ID
The Velocity context variable name for the Application ID.- See Also:
-
CONTEXT_KEY_ISSUER
The Velocity context variable name for the issuer about whom the metadata is.- See Also:
-
CONTEXT_KEY_ENTITY_ID
The Velocity context variable name for the entity ID requesting the metadata.- See Also:
-
CONTEXT_KEY_PRC
The Velocity context variable name for theProfileRequestContext.- See Also:
-
CONTEXT_KEY_REQUEST
The Velocity context variable name for theHttpServletRequest.- See Also:
-
CONTEXT_KEY_SIGNING
The Velocity context variable name for the iterable signing keys.- See Also:
-
CONTEXT_KEY_ENCRYPTION
The Velocity context variable name for the iterable encryption keys.- See Also:
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
parserPool
Parser to use. -
velocityEngine
Velocity engine. -
credentialResolver
Source of keys to be published into the metadata. -
issuerLookupStrategy
Strategy used to obtain the request issuer value. -
profileConfiguration
Applicable profile configuration. -
input
Input message from agent. -
issuerId
EntityID to populate into Issuer element.
-
-
Constructor Details
-
AddMetadata
public AddMetadata()Constructor.
-
-
Method Details
-
setVelocityEngine
public void setVelocityEngine(@Nonnull org.apache.velocity.app.VelocityEngine engine) Sets theVelocityEngineto use.- Parameters:
engine- Velocity engine
-
setIssuerLookupStrategy
Set the strategy used to locate the issuer value to use.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractApplicationAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
resourceToString
@Nullable private String resourceToString(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String path) Loads a resource via Spring and returns the contents as a String.- Parameters:
profileRequestContext- profile request contextpath- resource path- Returns:
- resource contents
-
getVelocityContext
@Nonnull private org.apache.velocity.VelocityContext getVelocityContext(@Nonnull ProfileRequestContext profileRequestContext) Creates and populates aVelocityContextfor template evaluation.- Parameters:
profileRequestContext- profile request context- Returns:
- context
-
buildCriteriaSet
Construct initialCriteriaSetto supply toCredentialResolver.- Parameters:
profileRequestContext- profile request context- Returns:
- criteria to use independent of usage.
-
doResolver
Queries the system'sMetadataResolverfor metadata about the issuer.- Parameters:
profileRequestContext- profile request context- Returns:
- queries metadata or null if an error occurs
-
adjustTimestamps
private void adjustTimestamps(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull EntityDescriptor entity)