Package org.apereo.cas.services.support
Class RegisteredServiceMappedRegexAttributeFilter
- java.lang.Object
-
- org.apereo.cas.services.support.RegisteredServiceMappedRegexAttributeFilter
-
- All Implemented Interfaces:
java.io.Serializable
,org.apereo.cas.services.RegisteredServiceAttributeFilter
,org.springframework.core.Ordered
- Direct Known Subclasses:
RegisteredServiceMutantRegexAttributeFilter
,RegisteredServiceReverseMappedRegexAttributeFilter
public class RegisteredServiceMappedRegexAttributeFilter extends java.lang.Object implements org.apereo.cas.services.RegisteredServiceAttributeFilter
A filtering policy that selectively applies patterns to attributes mapped in the config. If an attribute is mapped, it's only allowed to be released if it matches the linked pattern. If an attribute is not mapped, it may optionally be excluded from the released set of attributes.- Since:
- 5.1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RegisteredServiceMappedRegexAttributeFilter(java.util.Map<java.lang.String,java.lang.Object> patterns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
collectAttributeWithFilteredValues(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, java.lang.String attributeName, java.util.List<java.lang.Object> filteredValues)
Collect attribute with filtered values.protected java.util.Collection<java.util.regex.Pattern>
createPatternForMappedAttribute(java.lang.String attributeName)
Create pattern for mapped attribute pattern.java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
filter(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> givenAttributes)
protected java.util.List<java.lang.Object>
filterAttributeValuesByPattern(java.util.Set<java.lang.Object> attributeValues, java.util.regex.Pattern pattern)
Filter attribute values by pattern and return the list.protected java.util.function.Predicate<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.Object>>>
filterProvidedGivenAttributes()
Filter provided given attributes predicate.protected void
handleUnmappedAttribute(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, java.lang.String attributeName, java.lang.Object attributeValue)
Handle unmapped attribute.
-
-
-
Method Detail
-
filter
public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> filter(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> givenAttributes)
- Specified by:
filter
in interfaceorg.apereo.cas.services.RegisteredServiceAttributeFilter
-
handleUnmappedAttribute
protected void handleUnmappedAttribute(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, java.lang.String attributeName, java.lang.Object attributeValue)
Handle unmapped attribute.- Parameters:
attributesToRelease
- the attributes to releaseattributeName
- the attribute nameattributeValue
- the attribute value
-
createPatternForMappedAttribute
protected java.util.Collection<java.util.regex.Pattern> createPatternForMappedAttribute(java.lang.String attributeName)
Create pattern for mapped attribute pattern.- Parameters:
attributeName
- the attribute name- Returns:
- the pattern
-
collectAttributeWithFilteredValues
protected void collectAttributeWithFilteredValues(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, java.lang.String attributeName, java.util.List<java.lang.Object> filteredValues)
Collect attribute with filtered values.- Parameters:
attributesToRelease
- the attributes to releaseattributeName
- the attribute namefilteredValues
- the filtered values
-
filterProvidedGivenAttributes
protected java.util.function.Predicate<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.Object>>> filterProvidedGivenAttributes()
Filter provided given attributes predicate.- Returns:
- the predicate
-
filterAttributeValuesByPattern
protected java.util.List<java.lang.Object> filterAttributeValuesByPattern(java.util.Set<java.lang.Object> attributeValues, java.util.regex.Pattern pattern)
Filter attribute values by pattern and return the list.- Parameters:
attributeValues
- the attribute valuespattern
- the pattern- Returns:
- the list
-
-