Class EntityAttributesFilter
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.saml.metadata.resolver.filter.AbstractMetadataFilter
org.opensaml.saml.metadata.resolver.filter.impl.EntityAttributesFilter
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MetadataFilter
A filter that adds
EntityAttributes extension content to entities in order to drive software
behavior based on them.
The entities to annotate are identified with a Predicate, and multiple attributes can be
associated with each.
As of 3.4.0, another predicate can be set to validate pre-existing extension content to better protect use cases of this component.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Multimap<Predicate<EntityDescriptor>,Attribute> Rules for adding attributes.A condition to apply to pre-existing tags to determine their legitimacy.private final SAMLObjectBuilder<EntityAttributes>Builder forEntityAttributes.private final SAMLObjectBuilder<Extensions>Builder forExtensions.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddEntityAttribute(EntityDescriptor descriptor, EntityAttributes container, Attribute input) Get or createAttributebased on the input/template object.private voidapplyFilter(EntityDescriptor descriptor) Apply include policy to metadata on input.filter(XMLObject metadata, MetadataFilterContext context) Filters the given metadata, perhaps to remove elements that are not wanted.protected voidfilterEntitiesDescriptor(EntitiesDescriptor descriptor) Filters entities descriptor.protected voidfilterEntityDescriptor(EntityDescriptor descriptor) Filters entity descriptor.voidsetAttributeFilter(Predicate<Attribute> condition) Set a condition to apply to any pre-existing extension attributes, such that failure causes their removal.voidsetRules(Map<Predicate<EntityDescriptor>, Collection<Attribute>> rules) Methods inherited from class org.opensaml.saml.metadata.resolver.filter.AbstractMetadataFilter
getType, setTypeMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
applyMap
Rules for adding attributes. -
attributeFilter
A condition to apply to pre-existing tags to determine their legitimacy. -
extBuilder
Builder forExtensions. -
entityAttributesBuilder
Builder forEntityAttributes.
-
-
Constructor Details
-
EntityAttributesFilter
public EntityAttributesFilter()Constructor.
-
-
Method Details
-
setRules
- Parameters:
rules- rules to apply
-
setAttributeFilter
Set a condition to apply to any pre-existing extension attributes, such that failure causes their removal.If not set, then anything is allowed.
- Parameters:
condition- condition to apply- Since:
- 3.4.0
-
filter
@Nullable public XMLObject filter(@Nullable XMLObject metadata, @Nonnull MetadataFilterContext context) throws FilterException Filters the given metadata, perhaps to remove elements that are not wanted.- Parameters:
metadata- the metadata to be filtered.context- the metadata filter context- Returns:
- the filtered XMLObject, which may or may not be the same as the XMLObject instance passed in to the method. Maybe be null, for example if the top-level element was removed by the filter.
- Throws:
FilterException- thrown if an error occurs during the filtering process
-
filterEntityDescriptor
Filters entity descriptor.- Parameters:
descriptor- entity descriptor to filter
-
filterEntitiesDescriptor
Filters entities descriptor.- Parameters:
descriptor- entities descriptor to filter
-
addEntityAttribute
private void addEntityAttribute(@Nonnull EntityDescriptor descriptor, @Nonnull EntityAttributes container, @Nonnull Attribute input) Get or createAttributebased on the input/template object.- Parameters:
descriptor- parent entitycontainer- extension containerinput- input object
-
applyFilter
Apply include policy to metadata on input.- Parameters:
descriptor- input to evaluate
-