@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 affiliationDescriptor = entityDescriptor.getAffiliationDescriptor();
        if (affiliationDescriptor != null) {
            if (RegexUtils.find(this.group, affiliationDescriptor.getID())
                || RegexUtils.find(this.group, affiliationDescriptor.getOwnerID())) {
                return authorizeReleaseOfAllowedAttributes(context, attributes);
            }
        }
        if (entityDescriptor.getParent() instanceof final EntitiesDescriptor ed
            && RegexUtils.find(this.group, ed.getName())) {
            return authorizeReleaseOfAllowedAttributes(context, attributes);
        }
        return new HashMap<>();
    }
This is {@link MetadataEntityGroupAttributeReleasePolicy}.

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