Class EntityAttributesFilter
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.saml.metadata.resolver.filter.impl.EntityAttributesFilter
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.saml.metadata.resolver.filter.MetadataFilter
public class EntityAttributesFilter extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements org.opensaml.saml.metadata.resolver.filter.MetadataFilterA filter that addsEntityAttributesextension 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
Fields Modifier and Type Field Description private Multimap<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,org.opensaml.saml.saml2.core.Attribute>applyMapRules for adding attributes.private Predicate<org.opensaml.saml.saml2.core.Attribute>attributeFilterA condition to apply to pre-existing tags to determine their legitimacy.private org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.ext.saml2mdattr.EntityAttributes>entityAttributesBuilderBuilder forEntityAttributes.private org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml2.metadata.Extensions>extBuilderBuilder forExtensions.private LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description EntityAttributesFilter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidapplyFilter(org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Apply whitelist to metadata on input.org.opensaml.core.xml.XMLObjectfilter(org.opensaml.core.xml.XMLObject metadata, org.opensaml.saml.metadata.resolver.filter.MetadataFilterContext context)protected voidfilterEntitiesDescriptor(org.opensaml.saml.saml2.metadata.EntitiesDescriptor descriptor)Filters entities descriptor.protected voidfilterEntityDescriptor(org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Filters entity descriptor.voidsetAttributeFilter(Predicate<org.opensaml.saml.saml2.core.Attribute> condition)Set a condition to apply to any pre-existing extension attributes, such that failure causes their removal.voidsetRules(Map<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,Collection<org.opensaml.saml.saml2.core.Attribute>> rules)Set the mappings fromPredicatetoAttributecollection to apply.
-
-
-
Field Detail
-
log
@Nonnull private final Logger log
Class logger.
-
applyMap
@Nonnull @NonnullElements private Multimap<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,org.opensaml.saml.saml2.core.Attribute> applyMap
Rules for adding attributes.
-
attributeFilter
@Nullable private Predicate<org.opensaml.saml.saml2.core.Attribute> attributeFilter
A condition to apply to pre-existing tags to determine their legitimacy.
-
extBuilder
@Nonnull private final org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml2.metadata.Extensions> extBuilder
Builder forExtensions.
-
entityAttributesBuilder
@Nonnull private final org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.ext.saml2mdattr.EntityAttributes> entityAttributesBuilder
Builder forEntityAttributes.
-
-
Method Detail
-
setRules
public void setRules(@Nonnull @NonnullElements Map<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,Collection<org.opensaml.saml.saml2.core.Attribute>> rules)Set the mappings fromPredicatetoAttributecollection to apply.- Parameters:
rules- rules to apply
-
setAttributeFilter
public void setAttributeFilter(@Nullable Predicate<org.opensaml.saml.saml2.core.Attribute> condition)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 org.opensaml.core.xml.XMLObject filter(@Nullable org.opensaml.core.xml.XMLObject metadata, @Nonnull org.opensaml.saml.metadata.resolver.filter.MetadataFilterContext context) throws org.opensaml.saml.metadata.resolver.filter.FilterException- Specified by:
filterin interfaceorg.opensaml.saml.metadata.resolver.filter.MetadataFilter- Throws:
org.opensaml.saml.metadata.resolver.filter.FilterException
-
filterEntityDescriptor
protected void filterEntityDescriptor(@Nonnull org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Filters entity descriptor.- Parameters:
descriptor- entity descriptor to filter
-
filterEntitiesDescriptor
protected void filterEntitiesDescriptor(@Nonnull org.opensaml.saml.saml2.metadata.EntitiesDescriptor descriptor)Filters entities descriptor.- Parameters:
descriptor- entities descriptor to filter
-
applyFilter
@Nullable private void applyFilter(@Nonnull org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Apply whitelist to metadata on input.- Parameters:
descriptor- input to evaluate
-
-