@ConditionalOnMissingBean(name = AcceptableUsagePolicyRepository.BEAN_NAME)
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository(
            final CasConfigurationProperties casProperties,
            final ConfigurableApplicationContext applicationContext,
            @Qualifier(TicketRegistrySupport.BEAN_NAME)
            final TicketRegistrySupport ticketRegistrySupport) {
            return BeanSupplier.of(AcceptableUsagePolicyRepository.class)
                .when(AcceptableUsagePolicyRepository.CONDITION_AUP_ENABLED.given(applicationContext.getEnvironment()))
                .supply(() -> {
                    val groovy = casProperties.getAcceptableUsagePolicy().getGroovy();
                    if (groovy.getLocation() != null && CasRuntimeHintsRegistrar.notInNativeImage()) {
                        val scriptFactory = ExecutableCompiledScriptFactory.getExecutableCompiledScriptFactory();
                        return new GroovyAcceptableUsagePolicyRepository(ticketRegistrySupport,
                            casProperties.getAcceptableUsagePolicy(),
                            scriptFactory.fromResource(groovy.getLocation()), applicationContext);
                    }
                    return new DefaultAcceptableUsagePolicyRepository(ticketRegistrySupport, casProperties.getAcceptableUsagePolicy());
                })
                .otherwise(AcceptableUsagePolicyRepository::noOp)
                .get();
        }
This is {@link CasAcceptableUsagePolicyWebflowAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-aup-webflow/src/main/java/org/apereo/cas/config/CasAcceptableUsagePolicyWebflowAutoConfiguration.java