use of com.checkmarx.flow.config.external.ASTConfig in project cx-flow by checkmarx-ltd.
the class ConfigurationOverrider method overrideUsingConfigProvider.
private void overrideUsingConfigProvider(Optional<CxConfig> fallback, Map<String, String> overrideReport, ScanRequest request) {
ConfigProvider configProvider = ConfigProvider.getInstance();
String uid = MDC.get(FlowConstants.MAIN_MDC_ENTRY);
ScaConfig scaConfiguration = configProvider.getConfiguration(uid, ScaProperties.CONFIG_PREFIX, ScaConfig.class);
if (scaConfiguration != null) {
log.info("Overriding SCA properties from config provider configuration");
scaConfigOverrider.overrideScanRequestProperties(scaConfiguration, request, overrideReport);
} else {
Sca scaPropertiesFromConfigAsCode = fallback.map(CxConfig::getSca).orElse(null);
scaConfigOverrider.overrideScanRequestProperties(scaPropertiesFromConfigAsCode, request, overrideReport);
}
ASTConfig astConfiguration = configProvider.getConfiguration(uid, AstProperties.CONFIG_PREFIX, ASTConfig.class);
if (astConfiguration != null) {
log.info("Overriding AST properties from config provider configuration");
overridePropertiesAst(astConfiguration, overrideReport, request);
}
}
Aggregations