Package org.apereo.cas.services.support
Class RegisteredServiceMappedRegexAttributeFilter
java.lang.Object
org.apereo.cas.services.support.RegisteredServiceMappedRegexAttributeFilter
- All Implemented Interfaces:
Serializable
,org.apereo.cas.services.RegisteredServiceAttributeFilter
,org.springframework.core.Ordered
- Direct Known Subclasses:
RegisteredServiceMutantRegexAttributeFilter
,RegisteredServiceReverseMappedRegexAttributeFilter
public class RegisteredServiceMappedRegexAttributeFilter
extends 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:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
collectAttributeWithFilteredValues
(Map<String, List<Object>> attributesToRelease, String attributeName, List<Object> filteredValues) Collect attribute with filtered values.protected Collection<Pattern>
createPatternForMappedAttribute
(String attributeName) Create pattern for mapped attribute pattern.filterAttributeValuesByPattern
(Set<Object> attributeValues, Pattern pattern) Filter attribute values by pattern and return the list.Filter provided given attributes predicate.protected void
handleUnmappedAttribute
(Map<String, List<Object>> attributesToRelease, String attributeName, Object attributeValue) Handle unmapped attribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apereo.cas.services.RegisteredServiceAttributeFilter
getOrder
-
Constructor Details
-
RegisteredServiceMappedRegexAttributeFilter
-
-
Method Details
-
filter
- Specified by:
filter
in interfaceorg.apereo.cas.services.RegisteredServiceAttributeFilter
-
handleUnmappedAttribute
protected void handleUnmappedAttribute(Map<String, List<Object>> attributesToRelease, String attributeName, Object attributeValue) Handle unmapped attribute.- Parameters:
attributesToRelease
- the attributes to releaseattributeName
- the attribute nameattributeValue
- the attribute value
-
createPatternForMappedAttribute
Create pattern for mapped attribute pattern.- Parameters:
attributeName
- the attribute name- Returns:
- the pattern
-
collectAttributeWithFilteredValues
protected void collectAttributeWithFilteredValues(Map<String, List<Object>> attributesToRelease, String attributeName, List<Object> filteredValues) Collect attribute with filtered values.- Parameters:
attributesToRelease
- the attributes to releaseattributeName
- the attribute namefilteredValues
- the filtered values
-
filterProvidedGivenAttributes
Filter provided given attributes predicate.- Returns:
- the predicate
-
filterAttributeValuesByPattern
Filter attribute values by pattern and return the list.- Parameters:
attributeValues
- the attribute valuespattern
- the pattern- Returns:
- the list
-