@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository(
        final ConfigurableApplicationContext applicationContext,
        @Qualifier("acceptableUsagePolicyDataSource")
        final DataSource acceptableUsagePolicyDataSource,
        @Qualifier("jdbcAcceptableUsagePolicyTransactionTemplate")
        final TransactionOperations jdbcAcceptableUsagePolicyTransactionTemplate,
        final CasConfigurationProperties casProperties,
        @Qualifier(TicketRegistrySupport.BEAN_NAME)
        final TicketRegistrySupport ticketRegistrySupport) {
        return BeanSupplier.of(AcceptableUsagePolicyRepository.class)
            .when(AcceptableUsagePolicyRepository.CONDITION_AUP_ENABLED.given(applicationContext.getEnvironment()))
            .supply(() -> new JdbcAcceptableUsagePolicyRepository(ticketRegistrySupport,
                casProperties.getAcceptableUsagePolicy(),
                acceptableUsagePolicyDataSource,
                jdbcAcceptableUsagePolicyTransactionTemplate))
            .otherwise(AcceptableUsagePolicyRepository::noOp)
            .get();
    }
This is {@link CasAcceptableUsagePolicyJdbcAutoConfiguration} that stores AUP decisions in a mongo database.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-aup-jdbc/src/main/java/org/apereo/cas/config/CasAcceptableUsagePolicyJdbcAutoConfiguration.java