Search in sources :

Example 81 with ConfigurationProperty

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

the class PackageRepository method applyPackagePluginMetadata.

@PostConstruct
public void applyPackagePluginMetadata() {
    String pluginId = pluginConfiguration.getId();
    for (ConfigurationProperty configurationProperty : configuration) {
        RepositoryMetadataStore repositoryMetadataStore = RepositoryMetadataStore.getInstance();
        if (repositoryMetadataStore.getMetadata(pluginId) != null) {
            boolean isSecureProperty = repositoryMetadataStore.hasOption(pluginId, configurationProperty.getConfigurationKey().getName(), PackageConfiguration.SECURE);
            configurationProperty.handleSecureValueConfiguration(isSecureProperty);
        }
    }
    for (PackageDefinition packageDefinition : packages) {
        packageDefinition.applyPackagePluginMetadata(pluginId);
    }
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) RepositoryMetadataStore(com.thoughtworks.go.plugin.access.packagematerial.RepositoryMetadataStore) PostConstruct(javax.annotation.PostConstruct)

Example 82 with ConfigurationProperty

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

the class SCM method applyPluginMetadata.

@PostConstruct
public void applyPluginMetadata() {
    String pluginId = getPluginId();
    for (ConfigurationProperty configurationProperty : configuration) {
        SCMMetadataStore scmMetadataStore = SCMMetadataStore.getInstance();
        if (scmMetadataStore.getConfigurationMetadata(pluginId) != null) {
            boolean isSecureProperty = scmMetadataStore.hasOption(pluginId, configurationProperty.getConfigurationKey().getName(), SCMConfiguration.SECURE);
            configurationProperty.handleSecureValueConfiguration(isSecureProperty);
        }
    }
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) SCMMetadataStore(com.thoughtworks.go.plugin.access.scm.SCMMetadataStore) PostConstruct(javax.annotation.PostConstruct)

Example 83 with ConfigurationProperty

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

the class SCM method getConfigForDisplay.

public String getConfigForDisplay() {
    String pluginId = getPluginId();
    SCMMetadataStore metadataStore = SCMMetadataStore.getInstance();
    List<ConfigurationProperty> propertiesToBeUsedForDisplay = ConfigurationDisplayUtil.getConfigurationPropertiesToBeUsedForDisplay(metadataStore, pluginId, configuration);
    String prefix = metadataStore.hasPlugin(pluginId) ? "" : "WARNING! Plugin missing. ";
    return prefix + configuration.forDisplay(propertiesToBeUsedForDisplay);
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) SCMMetadataStore(com.thoughtworks.go.plugin.access.scm.SCMMetadataStore)

Example 84 with ConfigurationProperty

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

the class PluggableTask method applyPluginMetadata.

@PostConstruct
public void applyPluginMetadata() {
    if (taskPreference() != null) {
        for (ConfigurationProperty configurationProperty : configuration) {
            if (isValidPluginConfiguration(configurationProperty.getConfigKeyName())) {
                Boolean isSecure = pluginConfigurationFor(configurationProperty.getConfigKeyName()).getOption(Property.SECURE);
                configurationProperty.handleSecureValueConfiguration(isSecure);
            }
        }
    }
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) PostConstruct(javax.annotation.PostConstruct)

Example 85 with ConfigurationProperty

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

the class PluggableTask method getPropertiesForDisplay.

@Override
public List<TaskProperty> getPropertiesForDisplay() {
    ArrayList<TaskProperty> taskProperties = new ArrayList<>();
    if (PluggableTaskConfigStore.store().hasPreferenceFor(pluginConfiguration.getId())) {
        TaskPreference preference = taskPreference();
        List<? extends Property> propertyDefinitions = preference.getConfig().list();
        for (Property propertyDefinition : propertyDefinitions) {
            ConfigurationProperty configuredProperty = configuration.getProperty(propertyDefinition.getKey());
            if (configuredProperty == null)
                continue;
            taskProperties.add(new TaskProperty(propertyDefinition.getOption(Property.DISPLAY_NAME), configuredProperty.getDisplayValue(), configuredProperty.getConfigKeyName()));
        }
        return taskProperties;
    }
    for (ConfigurationProperty property : configuration) {
        taskProperties.add(new TaskProperty(property.getConfigKeyName(), property.getDisplayValue()));
    }
    return taskProperties;
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) TaskProperty(com.thoughtworks.go.domain.TaskProperty) TaskConfigProperty(com.thoughtworks.go.plugin.api.task.TaskConfigProperty) Property(com.thoughtworks.go.plugin.api.config.Property) TaskProperty(com.thoughtworks.go.domain.TaskProperty) ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) TaskPreference(com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)

Aggregations

ConfigurationProperty (com.thoughtworks.go.domain.config.ConfigurationProperty)113 Test (org.junit.Test)71 ConfigurationKey (com.thoughtworks.go.domain.config.ConfigurationKey)51 ConfigurationValue (com.thoughtworks.go.domain.config.ConfigurationValue)49 EncryptedConfigurationValue (com.thoughtworks.go.domain.config.EncryptedConfigurationValue)30 Configuration (com.thoughtworks.go.domain.config.Configuration)29 PluginConfiguration (com.thoughtworks.go.domain.config.PluginConfiguration)21 Property (com.thoughtworks.go.plugin.api.config.Property)13 ValidationError (com.thoughtworks.go.plugin.api.response.validation.ValidationError)13 ValidationResult (com.thoughtworks.go.plugin.api.response.validation.ValidationResult)11 GoCipher (com.thoughtworks.go.security.GoCipher)11 PluggableInstanceSettings (com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings)10 PluginRoleConfig (com.thoughtworks.go.config.PluginRoleConfig)8 PackageConfiguration (com.thoughtworks.go.plugin.access.packagematerial.PackageConfiguration)8 SecurityAuthConfig (com.thoughtworks.go.config.SecurityAuthConfig)7 ElasticProfile (com.thoughtworks.go.config.elastic.ElasticProfile)7 PluginConfiguration (com.thoughtworks.go.plugin.domain.common.PluginConfiguration)7 Metadata (com.thoughtworks.go.plugin.domain.common.Metadata)6 ArrayList (java.util.ArrayList)6 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)5