use of com.synopsys.integration.alert.common.rest.model.FieldValueModel in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method createValidLdapValues.
private Map<String, FieldValueModel> createValidLdapValues() {
FieldValueModel ldapEnabled = new FieldValueModel(List.of("true"), true);
FieldValueModel server = new FieldValueModel(List.of("server"), true);
FieldValueModel managerDn = new FieldValueModel(List.of("managerDn"), true);
FieldValueModel managerPassword = new FieldValueModel(List.of("managerPassword"), true);
Map<String, FieldValueModel> keyToValues = new HashMap<>();
keyToValues.put(AuthenticationDescriptor.KEY_LDAP_ENABLED, ldapEnabled);
keyToValues.put(AuthenticationDescriptor.KEY_LDAP_SERVER, server);
keyToValues.put(AuthenticationDescriptor.KEY_LDAP_MANAGER_DN, managerDn);
keyToValues.put(AuthenticationDescriptor.KEY_LDAP_MANAGER_PWD, managerPassword);
return keyToValues;
}
use of com.synopsys.integration.alert.common.rest.model.FieldValueModel in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method createValidSamlValues.
private Map<String, FieldValueModel> createValidSamlValues() {
FieldValueModel samlEnabled = new FieldValueModel(List.of("true"), true);
FieldValueModel forceAuth = new FieldValueModel(List.of("true"), true);
FieldValueModel entityId = new FieldValueModel(List.of("entityId"), true);
FieldValueModel entityBaseUrl = new FieldValueModel(List.of("entityBaseUrl"), true);
FieldValueModel metadataUrl = new FieldValueModel(List.of("metadataUrl"), true);
Map<String, FieldValueModel> keyToValues = new HashMap<>();
keyToValues.put(AuthenticationDescriptor.KEY_SAML_ENABLED, samlEnabled);
keyToValues.put(AuthenticationDescriptor.KEY_SAML_FORCE_AUTH, forceAuth);
keyToValues.put(AuthenticationDescriptor.KEY_SAML_ENTITY_ID, entityId);
keyToValues.put(AuthenticationDescriptor.KEY_SAML_ENTITY_BASE_URL, entityBaseUrl);
keyToValues.put(AuthenticationDescriptor.KEY_SAML_METADATA_URL, metadataUrl);
return keyToValues;
}
use of com.synopsys.integration.alert.common.rest.model.FieldValueModel in project hub-alert by blackducksoftware.
the class SettingsGlobalConfigurationFieldModelValidatorTest method validHostAndPort.
@Test
public void validHostAndPort() {
Map<String, FieldValueModel> keyToValues = createProxyKeyToValues();
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(keyToValues);
validatorAsserter.assertValid();
}
use of com.synopsys.integration.alert.common.rest.model.FieldValueModel in project hub-alert by blackducksoftware.
the class SettingsGlobalConfigurationFieldModelValidatorTest method createKeyToValues.
private Map<String, FieldValueModel> createKeyToValues() {
Map<String, FieldValueModel> keyToValues = new HashMap<>();
FieldValueModel encryptionPassword = new FieldValueModel(List.of("encryptionPassword"), true);
FieldValueModel encryptionSalt = new FieldValueModel(List.of("encryptionSalt"), true);
keyToValues.put(SettingsDescriptor.KEY_ENCRYPTION_PWD, encryptionPassword);
keyToValues.put(SettingsDescriptor.KEY_ENCRYPTION_GLOBAL_SALT, encryptionSalt);
return keyToValues;
}
use of com.synopsys.integration.alert.common.rest.model.FieldValueModel in project hub-alert by blackducksoftware.
the class BlackDuckGlobalApiAction method afterDeleteAction.
@Override
public void afterDeleteAction(FieldModel fieldModel) {
Map<String, FieldValueModel> keyToValues = fieldModel.getKeyToValues();
FieldValueModel fieldValueModel = keyToValues.get(ProviderDescriptor.KEY_PROVIDER_CONFIG_NAME);
String blackDuckGlobalConfigName = fieldValueModel.getValue().orElse("");
Long configId = Long.parseLong(fieldModel.getId());
providerLifecycleManager.unscheduleTasksForProviderConfig(configId);
List<ProviderProject> blackDuckProjects = providerDataAccessor.getProjectsByProviderConfigName(blackDuckGlobalConfigName);
providerDataAccessor.deleteProjects(blackDuckProjects);
}
Aggregations