@@ -0,0 +1,2670 @@
+package org.apereo.cas.config;%0A%0Aimport org.apereo.cas.configuration.CasConfigurationProperties;%0Aimport org.apereo.cas.ticket.TicketCatalog;%0Aimport org.apereo.cas.ticket.TicketDefinition;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.context.properties.EnableConfigurationProperties;%0Aimport org.springframework.context.annotation.Configuration;%0A%0A/**%0A * This is %7B@link MongoDbTicketRegistryTicketCatalogConfiguration%7D.%0A *%0A * @author Misagh Moayyed%0A * @since 5.2.0%0A */%0A@Configuration(%22mongoDbTicketRegistryTicketCatalogConfiguration%22)%0A@EnableConfigurationProperties(CasConfigurationProperties.class)%0Apublic class MongoDbTicketRegistryTicketCatalogConfiguration extends CasCoreTicketCatalogConfiguration %7B%0A    private static final Logger LOGGER = LoggerFactory.getLogger(MongoDbTicketRegistryTicketCatalogConfiguration.class);%0A%0A    @Autowired%0A    private CasConfigurationProperties casProperties;%0A%0A    @Override%0A    protected void buildAndRegisterServiceTicketDefinition(final TicketCatalog plan, final TicketDefinition metadata) %7B%0A        setServiceTicketDefinitionProperties(metadata);%0A        super.buildAndRegisterServiceTicketDefinition(plan, metadata);%0A    %7D%0A%0A    @Override%0A    protected void buildAndRegisterProxyTicketDefinition(final TicketCatalog plan, final TicketDefinition metadata) %7B%0A        setServiceTicketDefinitionProperties(metadata);%0A        super.buildAndRegisterServiceTicketDefinition(plan, metadata);%0A    %7D%0A%0A    @Override%0A    protected void buildAndRegisterTicketGrantingTicketDefinition(final TicketCatalog plan, final TicketDefinition metadata) %7B%0A        setTicketGrantingTicketProperties(metadata);%0A        super.buildAndRegisterTicketGrantingTicketDefinition(plan, metadata);%0A    %7D%0A%0A    @Override%0A    protected void buildAndRegisterProxyGrantingTicketDefinition(final TicketCatalog plan, final TicketDefinition metadata) %7B%0A        setTicketGrantingTicketProperties(metadata);%0A        super.buildAndRegisterTicketGrantingTicketDefinition(plan, metadata);%0A    %7D%0A%0A    private void setTicketGrantingTicketProperties(final TicketDefinition metadata) %7B%0A        metadata.getProperties().setStorageName(%22ticketGrantingTicketsCollection%22);%0A        metadata.getProperties().setStorageTimeout(casProperties.getTicket().getTgt().getMaxTimeToLiveInSeconds());%0A    %7D%0A%0A    private void setServiceTicketDefinitionProperties(final TicketDefinition metadata) %7B%0A        metadata.getProperties().setStorageName(%22serviceTicketsCollection%22);%0A        metadata.getProperties().setStorageTimeout(casProperties.getTicket().getSt().getTimeToKillInSeconds());%0A    %7D%0A%7D%0A

enable encryption for mongodb. ensure the ticket registry can clean up after itself correctly.