use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaTest method scanRemoteRepo.
private void scanRemoteRepo(String repoUrlProp, boolean useOnPremAuthentication) throws MalformedURLException {
RestClientConfig config = initScaConfig(repoUrlProp, useOnPremAuthentication);
AstScaResults scanResults = runScan(config);
verifyScanResults(scanResults);
}
use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class AstTest method getScanConfig.
private RestClientConfig getScanConfig() throws MalformedURLException {
AstConfig astConfig = AstConfig.builder().apiUrl(astProperties.getApiUrl()).webAppUrl(astProperties.getWebAppUrl()).clientSecret(astProperties.getClientSecret()).clientId("CxFlow").sourceLocationType(SourceLocationType.REMOTE_REPOSITORY).build();
RemoteRepositoryInfo repoInfo = new RemoteRepositoryInfo();
URL repoUrl = new URL(githubProperties.getUrl());
repoInfo.setUrl(repoUrl);
astConfig.setRemoteRepositoryInfo(repoInfo);
astConfig.setResultsPageSize(10);
astConfig.setPresetName("Checkmarx Default");
RestClientConfig config = new RestClientConfig();
config.setAstConfig(astConfig);
config.setProjectName("sdkAstProject");
config.setProgressInterval(5);
return config;
}
use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaScanner method getLatestScanResults.
public AstScaResults getLatestScanResults(ScanParams scanParams) {
RestClientConfig config = getScanConfig(scanParams);
try {
IScanClientHelper client = allocateClient(config);
client.init();
ResultsBase results = client.getLatestScanResults();
AstScaResults result;
if (results != null) {
result = toResults(results);
applyFilterToResults(result, scanParams);
} else {
result = new AstScaResults();
}
return result;
} catch (Exception e) {
throw new ScannerRuntimeException("Error getting latest scan results.", e);
}
}
use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaScanner method getScanConfig.
/**
* Convert scanParams to an object that is used by underlying logic in Common Client.
*/
@Override
public RestClientConfig getScanConfig(ScanParams scanParams) {
RestClientConfig restClientConfig = new RestClientConfig();
restClientConfig.setProjectName(scanParams.getProjectName());
restClientConfig.setDisableCertificateValidation(scanParams.isDisableCertificateValidation());
ScaConfig scaConfig = getScaSpecificConfig(scanParams);
setSourceLocation(scanParams, restClientConfig, scaConfig);
if (scanParams.getRemoteRepoUrl() != null) {
restClientConfig.setClonedRepo(true);
}
restClientConfig.setScaConfig(scaConfig);
return restClientConfig;
}
Aggregations