private static Map<String, List<Object>> fetchAttributeValueFromExternalGroovyScript(final String attributeName,
                                                                                         final Map<String, List<Object>> resolvedAttributes,
                                                                                         final String file) {
        return ApplicationContextProvider.getScriptResourceCacheManager()
            .map(cacheMgr -> {
                val script = cacheMgr.resolveScriptableResource(file, attributeName, file);
                return FunctionUtils.doIf(script != null,
                    Unchecked.supplier(() -> fetchAttributeValueFromScript(script, attributeName, resolvedAttributes)),
                    TreeMap<String, List<Object>>::new).get();
            })
            .orElseThrow(() -> new RuntimeException("No groovy script cache manager is available to execute attribute mappings"));
    }
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