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:
  • Constructor Details

    • RegisteredServiceMappedRegexAttributeFilter

      public RegisteredServiceMappedRegexAttributeFilter(Map<String,Object> patterns)
  • Method Details

    • filter

      public Map<String,List<Object>> filter(Map<String,List<Object>> givenAttributes)
      Specified by:
      filter in interface org.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 release
      attributeName - the attribute name
      attributeValue - the attribute value
    • createPatternForMappedAttribute

      protected Collection<Pattern> createPatternForMappedAttribute(String attributeName)
      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 release
      attributeName - the attribute name
      filteredValues - the filtered values
    • filterProvidedGivenAttributes

      protected Predicate<Map.Entry<String,List<Object>>> filterProvidedGivenAttributes()
      Filter provided given attributes predicate.
      Returns:
      the predicate
    • filterAttributeValuesByPattern

      protected List<Object> filterAttributeValuesByPattern(Set<Object> attributeValues, Pattern pattern)
      Filter attribute values by pattern and return the list.
      Parameters:
      attributeValues - the attribute values
      pattern - the pattern
      Returns:
      the list