protected Map<String, List<Object>> authorizeMappedAttributes(
        final RegisteredServiceAttributeReleasePolicyContext context,
        final Map<String, List<Object>> attributes) {

        val resolvedAttributes = new TreeMap<String, List<Object>>(String.CASE_INSENSITIVE_ORDER);
        resolvedAttributes.putAll(attributes);
        resolvedAttributes.putAll(context.getReleasingAttributes());

        val attributesToRelease = new HashMap<String, List<Object>>();
        getAllowedAttributes().forEach((attributeName, value) -> {
            val mappedAttributes = determineMappedAttributes(value);

            LOGGER.trace("Attempting to map allowed attribute name [{}]", attributeName);
            mappedAttributes.forEach(mapped -> {
                val mappedAttributeName = mapped.toString();
                val attributeValue = getAttributeValue(resolvedAttributes, attributeName, mappedAttributeName);
                LOGGER.debug("Mapping attribute [{}] to [{}] with value [{}]",
                    attributeName, mappedAttributeName, attributeValue);
                val mappingRequest = buildAttributeMappingRequest(resolvedAttributes, attributeName, mappedAttributeName, attributeValue);
                val mappingResults = PrincipalAttributesMapper.defaultMapper().map(mappingRequest);
                attributesToRelease.putAll(mappingResults);
            });
        });
        return attributesToRelease;
    }
Authorize release of allowed attributes map.
Map each entry in the allowed list into an array first
by the original key, value and the original entry itself.
Then process the array to populate the map for allowed attributes.

@param context    the context
@param attributes the attributes
@return the map
core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/services/BaseMappedAttributeReleasePolicy.java