use of com.mercedesbenz.sechub.commons.pds.ExecutionPDSKey in project sechub by mercedes-benz.
the class PDSProductExecutorMinimumConfigValidationTest method createConfigWithAllMandatoryParametersSetWith.
private ProductExecutorConfig createConfigWithAllMandatoryParametersSetWith(String value) {
ProductExecutorConfig config = createConfigWithNoParametersSet();
List<ProductExecutorConfigSetupJobParameter> params = config.getSetup().getJobParameters();
for (SecHubProductExecutionPDSKeyProvider provider : SecHubProductExecutionPDSKeyProvider.values()) {
SecHubProductExecutionPDSKey key = provider.getKey();
if (key.isMandatory()) {
params.add(new ProductExecutorConfigSetupJobParameter(key.getId(), value));
}
}
for (PDSConfigDataKeyProvider provider : PDSConfigDataKeyProvider.values()) {
ExecutionPDSKey key = provider.getKey();
if (key.isMandatory()) {
params.add(new ProductExecutorConfigSetupJobParameter(key.getId(), value));
}
}
return config;
}
use of com.mercedesbenz.sechub.commons.pds.ExecutionPDSKey in project sechub by mercedes-benz.
the class PDSExecutionEnvironmentService method addJobParamDataWhenAccepted.
private void addJobParamDataWhenAccepted(PDSProductSetup productSetup, PDSExecutionParameterEntry jobParam, Map<String, String> map) {
PDSProdutParameterSetup params = productSetup.getParameters();
boolean acceptedParameter = false;
boolean wellknown = false;
for (PDSConfigDataKeyProvider provider : PDSConfigDataKeyProvider.values()) {
ExecutionPDSKey key = provider.getKey();
if (!key.getId().equals(jobParam.getKey())) {
continue;
}
wellknown = true;
acceptedParameter = key.isAvailableInsideScript();
break;
}
acceptedParameter = acceptedParameter || isJobParameterAcceptedByPDSServerConfiguration(jobParam, params.getMandatory());
acceptedParameter = acceptedParameter || isJobParameterAcceptedByPDSServerConfiguration(jobParam, params.getOptional());
if (acceptedParameter) {
map.put(converter.convertKeyToEnv(jobParam.getKey()), jobParam.getValue());
} else {
if (wellknown) {
LOG.debug("Wellknown parameter found - but not available inside script: {}", jobParam.getKey());
} else {
LOG.warn("Ignored invalid job parameter key: {} for product id: {} !", jobParam.getKey(), productSetup.getId());
}
}
}
Aggregations