@Override
    public Optional<PropertySource<?>> locate(final Environment environment, final ResourceLoader resourceLoader) {
        val container = System.getProperty(VAR_CONTAINER, System.getenv(VAR_CONTAINER));
        val properties = StringUtils.isNotBlank(container) && BooleanUtils.toBoolean(container) ? loadSecrets() : Map.<String, Object>of();
        LOGGER.debug("Docker secrets loaded are [{}]", properties.keySet());
        return Optional.of(new MapPropertySource(getClass().getSimpleName(), properties));
    }
Loads all Docker secrets from the secrets directory and stores them in a Map.

@return a Map of secret names and their values.
core/cas-server-core-configuration-api/src/main/java/org/apereo/cas/configuration/DockerSecretsPropertySourceLocator.java