Class MetadataPublishingProfileConfiguration
- All Implemented Interfaces:
ConditionalProfileConfiguration,ProfileConfiguration,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,MetadataPublishingProfileConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,Duration> Lookup strategy for cacheDuration.private Function<ProfileRequestContext,Duration> Lookup strategy for lifetime to apply via validUntil.static final StringName of profile counter.(package private) Predicate<ProfileRequestContext>Predicate used to determine whether to resolve keys for Velocity.private Function<ProfileRequestContext,Credential> Lookup strategy for signing credential.private Predicate<ProfileRequestContext>Predicate used to determine whether to sign metadata.private Function<ProfileRequestContext,String> Lookup strategy for metadata template path.private Predicate<ProfileRequestContext>Predicate used to determine whether to use Velocity.Fields inherited from interface net.shibboleth.sp.saml.saml2.profile.config.MetadataPublishingProfileConfiguration
PROFILE_IDFields inherited from interface net.shibboleth.profile.config.ProfileConfiguration
DEFAULT_DISALLOWED_FEATURES -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor.protectedMetadataPublishingProfileConfiguration(String profileId) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetCacheDuration(ProfileRequestContext profileRequestContext) Gets the optional value to set in the root element'scacehDurationattribute.getLifetime(ProfileRequestContext profileRequestContext) Gets the optional lifetime from which to compute and set the root element'svalidUntilattribute.getSigningCredential(ProfileRequestContext profileRequestContext) Gets an optionalCredentialto use to sign the metadata ifMetadataPublishingProfileConfiguration.isSignMetadata(ProfileRequestContext)is true.getTemplatePath(ProfileRequestContext profileRequestContext) Gets the path to a template XML resource to source for the metadata.booleanisResolveKeys(ProfileRequestContext profileRequestContext) Gets whether to resolve signing and encryption keys from the configuredCredentialResolverto publish into the Velocity context if that feature is enabled.booleanisSignMetadata(ProfileRequestContext profileRequestContext) Gets whether to sign the metadata being published dynamically.booleanisUseVelocity(ProfileRequestContext profileRequestContext) Gets whether the template returned byMetadataPublishingProfileConfiguration.getTemplatePath(ProfileRequestContext)is evaluated by Velocity or returned directly.voidsetCacheDuration(Duration cacheDuration) Sets the optional value to set in the root element'scacheDurationattribute.voidSets the lookup strategy for the optional value to set in the root element'scacheDurationattribute.voidsetLifetime(Duration lifetime) Sets the optional lifetime from which to compute and set the root element'svalidUntilattribute.voidSets the lookup strategy for the optional lifetime from which to compute and set the root element'svalidUntilattribute.voidsetResolveKeys(boolean flag) Sets whether to resolve signing and encryption keys from the configuredCredentialResolverto publish into the Velocity context if that feature is enabled.voidsetResolveKeysPredicate(Predicate<ProfileRequestContext> condition) Sets a condition to determine whether to resolve signing and encryption keys from the configuredCredentialResolverto publish into the Velocity context if that feature is enabled.voidsetSigningCredential(Credential credential) Sets an optionalCredentialto use to sign the metadata ifisSignMetadata(ProfileRequestContext)is true.voidSets a lookup strategy for an optionalCredentialto use to sign the metadata ifisSignMetadata(ProfileRequestContext)is true.voidsetSignMetadata(boolean flag) Sets whether to sign the metadata being published dynamically.voidsetSignMetadataPredicate(Predicate<ProfileRequestContext> condition) Sets a condition to determine whether to sign the metadata being published dynamically.voidsetTemplatePath(String path) Sets the path to a template XML file to source for the metadata.voidSets the lookup strategy for the path to a template XML file to source for the metadata.voidsetUseVelocity(boolean flag) Sets whether the template returned by getTemplatePath(ProfileRequestContext) is evaluated by Velocity or returned directly.voidsetUseVelocityPredicate(Predicate<ProfileRequestContext> condition) Sets a condition to determine whether the template returned by getTemplatePath(ProfileRequestContext) is evaluated by Velocity or returned directly.Methods inherited from class net.shibboleth.profile.config.AbstractConditionalProfileConfiguration
getActivationCondition, setActivationConditionMethods inherited from class net.shibboleth.profile.config.AbstractProfileConfiguration
equals, getDisallowedFeatures, getSecurityConfiguration, hashCode, isFeatureDisallowed, setDisallowedFeatures, setDisallowedFeaturesLookupStrategy, setDisallowedFeaturesSet, setSecurityConfiguration, setSecurityConfigurationLookupStrategyMethods 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, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.profile.config.ProfileConfiguration
getDisallowedFeatures, getSecurityConfiguration, isFeatureDisallowed
-
Field Details
-
PROFILE_COUNTER
Name of profile counter.- See Also:
-
templatePathLookupStrategy
Lookup strategy for metadata template path. -
useVelocityPredicate
Predicate used to determine whether to use Velocity. -
signMetadataPredicate
Predicate used to determine whether to sign metadata. -
signingCredentialLookupStrategy
Lookup strategy for signing credential. -
resolveKeysPredicate
Predicate used to determine whether to resolve keys for Velocity. -
lifetimeLookupStrategy
Lookup strategy for lifetime to apply via validUntil. -
cacheDurationLookupStrategy
Lookup strategy for cacheDuration.
-
-
Constructor Details
-
MetadataPublishingProfileConfiguration
public MetadataPublishingProfileConfiguration()Constructor. -
MetadataPublishingProfileConfiguration
Constructor.- Parameters:
profileId- unique ID for this profile
-
-
Method Details
-
getTemplatePath
@Nullable @NotEmpty public String getTemplatePath(@Nullable ProfileRequestContext profileRequestContext) Gets the path to a template XML resource to source for the metadata.Defaults to null, resulting in a query to the configured
MetadataResolverservice for the configured "issuer" value as entityID to obtain metadata loaded into the Hub.If set, the path is evaluated as a Velocity template with the following variables populated:
- agentID
- applicationID
- issuer
- entityID
- Specified by:
getTemplatePathin interfaceMetadataPublishingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- templated path to XML resource to serve
-
setTemplatePath
Sets the path to a template XML file to source for the metadata.- Parameters:
path- template path
-
setTemplatePathLookupStrategy
Sets the lookup strategy for the path to a template XML file to source for the metadata.- Parameters:
strategy- lookup strategy
-
isUseVelocity
Gets whether the template returned byMetadataPublishingProfileConfiguration.getTemplatePath(ProfileRequestContext)is evaluated by Velocity or returned directly.Defaults to false; only relevant if a template path is used. The same variables are populated in evaluating the template as described for
MetadataPublishingProfileConfiguration.getTemplatePath(ProfileRequestContext).- Specified by:
isUseVelocityin interfaceMetadataPublishingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- true iff Velocity should be applied to the template
-
setUseVelocity
public void setUseVelocity(boolean flag) Sets whether the template returned by getTemplatePath(ProfileRequestContext) is evaluated by Velocity or returned directly.- Parameters:
flag- flag to set
-
setUseVelocityPredicate
Sets a condition to determine whether the template returned by getTemplatePath(ProfileRequestContext) is evaluated by Velocity or returned directly.- Parameters:
condition- condition to set
-
isSignMetadata
Gets whether to sign the metadata being published dynamically.Defaults to false.
- Specified by:
isSignMetadatain interfaceMetadataPublishingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- true iff the metadata should be signed in real time
-
setSignMetadata
public void setSignMetadata(boolean flag) Sets whether to sign the metadata being published dynamically.- Parameters:
flag- flag to set
-
setSignMetadataPredicate
Sets a condition to determine whether to sign the metadata being published dynamically.- Parameters:
condition- condition to set
-
getSigningCredential
@Nullable public Credential getSigningCredential(@Nullable ProfileRequestContext profileRequestContext) Gets an optionalCredentialto use to sign the metadata ifMetadataPublishingProfileConfiguration.isSignMetadata(ProfileRequestContext)is true.If unset, the default configured service is used, resulting in effectively self-signed metadata using the same key used for SAML messages.
- Specified by:
getSigningCredentialin interfaceMetadataPublishingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- a signing credential or null
-
setSigningCredential
Sets an optionalCredentialto use to sign the metadata ifisSignMetadata(ProfileRequestContext)is true.- Parameters:
credential- credential to set
-
setSigningCredentialLookupStrategy
public void setSigningCredentialLookupStrategy(@Nonnull Function<ProfileRequestContext, Credential> strategy) Sets a lookup strategy for an optionalCredentialto use to sign the metadata ifisSignMetadata(ProfileRequestContext)is true.- Parameters:
strategy- lookup strategy
-
isResolveKeys
Gets whether to resolve signing and encryption keys from the configuredCredentialResolverto publish into the Velocity context if that feature is enabled.Defaults to false.
If true, this does not automatically remove any existing
KeyDescriptorelements nor add any automatically, but provides the information to help do so.- Specified by:
isResolveKeysin interfaceMetadataPublishingProfileConfiguration- Returns:
- true iff the credentials should be resolved for Velocity to access
-
setResolveKeys
public void setResolveKeys(boolean flag) Sets whether to resolve signing and encryption keys from the configuredCredentialResolverto publish into the Velocity context if that feature is enabled.- Parameters:
flag- flag to set
-
setResolveKeysPredicate
Sets a condition to determine whether to resolve signing and encryption keys from the configuredCredentialResolverto publish into the Velocity context if that feature is enabled.- Parameters:
condition- condition to set
-
getLifetime
@Nullable @NonNegative public Duration getLifetime(@Nullable ProfileRequestContext profileRequestContext) Gets the optional lifetime from which to compute and set the root element'svalidUntilattribute.Defaults to null.
Only applied if the root element's existing value would be longer.
- Specified by:
getLifetimein interfaceMetadataPublishingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- the time added to the current timestamp to set, or null to leave as is
-
setLifetime
Sets the optional lifetime from which to compute and set the root element'svalidUntilattribute.Passing zero is equivalent to null and will not alter the source value.
- Parameters:
lifetime- metadata lifetime
-
setLifetimeLookupStrategy
Sets the lookup strategy for the optional lifetime from which to compute and set the root element'svalidUntilattribute.- Parameters:
strategy- lookup strategy
-
getCacheDuration
@Nullable @NonNegative public Duration getCacheDuration(@Nullable ProfileRequestContext profileRequestContext) Gets the optional value to set in the root element'scacehDurationattribute.Defaults to null.
- Specified by:
getCacheDurationin interfaceMetadataPublishingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- the cache duration, or null to leave as is
-
setCacheDuration
Sets the optional value to set in the root element'scacheDurationattribute.Passing zero is equivalent to null and will not alter the source value.
- Parameters:
cacheDuration- metadata cache duration
-
setCacheDurationLookupStrategy
public void setCacheDurationLookupStrategy(@Nonnull Function<ProfileRequestContext, Duration> strategy) Sets the lookup strategy for the optional value to set in the root element'scacheDurationattribute.- Parameters:
strategy- lookup strategy
-