protected Map<String, Object> loadSecrets() {
        return FunctionUtils.doUnchecked(() -> {
            val secrets = new HashMap<String, Object>();
            val secretsDir = Paths.get(SECRETS_DIR);
            LOGGER.debug("Looking for Docker secrets in [{}]", secretsDir);
            if (Files.exists(secretsDir) && Files.isDirectory(secretsDir)) {
                try (val stream = Files.newDirectoryStream(secretsDir)) {
                    for (val entry : stream) {
                        val secretName = entry.getFileName().toString();
                        val secretValue = Files.readString(entry);
                        LOGGER.debug("Found Docker secret [{}] from [{}]", secretName, entry.getFileName());
                        secrets.put(secretName, secretValue);
                    }
                }
            }
            return secrets;
        });
    }
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