private static Map<String, List<Object>> fetchAttributeValueFromScript(
        @NotNull final ExecutableCompiledScript script,
        final String attributeName,
        final Map<String, List<Object>> resolvedAttributes) throws Throwable {
        val attributesToRelease = new TreeMap<String, List<Object>>(String.CASE_INSENSITIVE_ORDER);
        val args = CollectionUtils.wrap("attributes", resolvedAttributes, "logger", LOGGER);
        script.setBinding(args);
        val result = script.execute(args.values().toArray(), Object.class, false);
        if (result != null) {
            LOGGER.debug("Mapped attribute [{}] to [{}] from script", attributeName, result);
            attributesToRelease.put(attributeName, CollectionUtils.wrapList(result));
        } else {
            LOGGER.warn("Groovy-scripted attribute returned no value for [{}]", attributeName);
        }
        return attributesToRelease;
    }
This is {@link DefaultPrincipalAttributesMapper}.

@author Misagh Moayyed
@since 6.6.0
core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/authentication/DefaultPrincipalAttributesMapper.java