All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.descoped.secrets.dynamic.configuration.DynamicSecretConfigurationClientInitializer Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package io.descoped.secrets.dynamic.configuration;

import io.descoped.secrets.api.SecretManagerClient;
import io.descoped.secrets.api.SecretManagerClientInitializer;
import io.descoped.service.provider.api.ProviderName;

import java.util.Collections;
import java.util.Map;
import java.util.Set;

@ProviderName("dynamic-secret-configuration")
public class DynamicSecretConfigurationClientInitializer implements SecretManagerClientInitializer {

    @Override
    public String providerId() {
        return "dynamic-secret-configuration";
    }

    // Optional: "secrets.property-resource-path"
    @Override
    public Set configurationKeys() {
        return Collections.emptySet();
    }

    @Override
    public SecretManagerClient initialize(Map configuration) {
        String propertyResourcePath = configuration.get("secrets.property-resource-path");
        if (propertyResourcePath != null) {
            return new DynamicSecretConfigurationClient(propertyResourcePath);
        } else {
            return new DynamicSecretConfigurationClient(configuration);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy