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);
}
}
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);
}
}
}
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);
}
use of com.thoughtworks.go.domain.config.ConfigurationProperty in project gocd by gocd.
the class DeletePackageConfigCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
packageUuid = "random-uuid";
configuration = new Configuration(new ConfigurationProperty(new ConfigurationKey("PACKAGE_ID"), new ConfigurationValue("prettyjson")));
packageDefinition = new PackageDefinition(packageUuid, "prettyjson", configuration);
result = new HttpLocalizedOperationResult();
PackageRepositories repositories = cruiseConfig.getPackageRepositories();
PackageRepository repository = new PackageRepository();
repository.addPackage(packageDefinition);
repositories.add(repository);
cruiseConfig.setPackageRepositories(repositories);
}
use of com.thoughtworks.go.domain.config.ConfigurationProperty in project gocd by gocd.
the class ConfigurationPropertyBuilderTest method shouldCreateWithErrorsIfBothPlainAndEncryptedTextInputAreSpecifiedForSecureProperty.
@Test
public void shouldCreateWithErrorsIfBothPlainAndEncryptedTextInputAreSpecifiedForSecureProperty() {
Property key = new Property("key");
key.with(Property.SECURE, true);
ConfigurationProperty property = new ConfigurationPropertyBuilder().create("key", "value", "enc_value", true);
assertThat(property.errors().get("configurationValue").get(0), is("You may only specify `value` or `encrypted_value`, not both!"));
assertThat(property.errors().get("encryptedValue").get(0), is("You may only specify `value` or `encrypted_value`, not both!"));
assertThat(property.getConfigurationValue().getValue(), is("value"));
assertThat(property.getEncryptedValue(), is("enc_value"));
}
Aggregations