Search in sources :

Example 1 with SecureKeyInfoProvider

use of com.thoughtworks.go.domain.config.SecureKeyInfoProvider in project gocd by gocd.

the class PackageDefinition method getSecureKeyInfoProvider.

private SecureKeyInfoProvider getSecureKeyInfoProvider() {
    PackageMetadataStore packageMetadataStore = PackageMetadataStore.getInstance();
    final PackageConfigurations metadata = packageMetadataStore.getMetadata(pluginId());
    if (metadata == null) {
        return null;
    }
    return new SecureKeyInfoProvider() {

        @Override
        public boolean isSecure(String key) {
            PackageConfiguration packageConfiguration = metadata.get(key);
            return packageConfiguration.getOption(PackageConfiguration.SECURE);
        }
    };
}
Also used : PackageMetadataStore(com.thoughtworks.go.plugin.access.packagematerial.PackageMetadataStore) SecureKeyInfoProvider(com.thoughtworks.go.domain.config.SecureKeyInfoProvider) PackageConfiguration(com.thoughtworks.go.plugin.access.packagematerial.PackageConfiguration) PackageConfigurations(com.thoughtworks.go.plugin.access.packagematerial.PackageConfigurations)

Example 2 with SecureKeyInfoProvider

use of com.thoughtworks.go.domain.config.SecureKeyInfoProvider in project gocd by gocd.

the class PackageRepository method getSecureKeyInfoProvider.

private SecureKeyInfoProvider getSecureKeyInfoProvider() {
    final RepositoryMetadataStore repositoryMetadataStore = RepositoryMetadataStore.getInstance();
    final PackageConfigurations metadata = repositoryMetadataStore.getMetadata(pluginConfiguration.getId());
    if (metadata == null) {
        return null;
    }
    return new SecureKeyInfoProvider() {

        @Override
        public boolean isSecure(String key) {
            PackageConfiguration packageConfiguration = metadata.get(key);
            return packageConfiguration.getOption(PackageConfiguration.SECURE);
        }
    };
}
Also used : SecureKeyInfoProvider(com.thoughtworks.go.domain.config.SecureKeyInfoProvider) RepositoryMetadataStore(com.thoughtworks.go.plugin.access.packagematerial.RepositoryMetadataStore) PackageConfiguration(com.thoughtworks.go.plugin.access.packagematerial.PackageConfiguration) PackageConfigurations(com.thoughtworks.go.plugin.access.packagematerial.PackageConfigurations)

Aggregations

SecureKeyInfoProvider (com.thoughtworks.go.domain.config.SecureKeyInfoProvider)2 PackageConfiguration (com.thoughtworks.go.plugin.access.packagematerial.PackageConfiguration)2 PackageConfigurations (com.thoughtworks.go.plugin.access.packagematerial.PackageConfigurations)2 PackageMetadataStore (com.thoughtworks.go.plugin.access.packagematerial.PackageMetadataStore)1 RepositoryMetadataStore (com.thoughtworks.go.plugin.access.packagematerial.RepositoryMetadataStore)1