@Override
    protected Map<String, List<Object>> getAttributesForSamlRegisteredService(
        final Map<String, List<Object>> attributes,
        final SamlRegisteredServiceCachingMetadataResolver resolver,
        final SamlRegisteredServiceMetadataAdaptor facade,
        final EntityDescriptor entityDescriptor,
        final RegisteredServiceAttributeReleasePolicyContext context) {
        val extensions = Optional.ofNullable(facade.getExtensions())
            .map(ElementExtensibleXMLObject::getUnknownXMLObjects).orElseGet(List::of);

        val matched = extensions
            .stream()
            .filter(RegistrationInfo.class::isInstance)
            .map(RegistrationInfo.class::cast)
            .anyMatch(info -> RegexUtils.find(this.registrationAuthority, info.getRegistrationAuthority()));
        return matched ? authorizeReleaseOfAllowedAttributes(context, attributes) : new HashMap<>();
    }
This is {@link MetadataRegistrationAuthorityAttributeReleasePolicy}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/MetadataRegistrationAuthorityAttributeReleasePolicy.java