Search in sources :

Example 11 with RestClientConfig

use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class AstScanner method getScanConfig.

/**
 * Convert scanParams to an object that is used by underlying logic in Common Client.
 */
@Override
protected RestClientConfig getScanConfig(ScanParams scanParams) {
    RestClientConfig restClientConfig = new RestClientConfig();
    restClientConfig.setProjectName(scanParams.getProjectName());
    AstConfig astConfig = getAstSpecificConfig();
    setSourceLocation(scanParams, restClientConfig, astConfig);
    restClientConfig.setAstConfig(astConfig);
    return restClientConfig;
}
Also used : RestClientConfig(com.checkmarx.sdk.config.RestClientConfig) AstConfig(com.checkmarx.sdk.config.AstConfig)

Example 12 with RestClientConfig

use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ClientTypeResolverTest method testDetermineClientType.

private void testDetermineClientType(String urlPropName) {
    ClientTypeResolver resolver = new ClientTypeResolver(new RestClientConfig());
    ClientType clientType = resolver.determineClientType(urlPropName);
    Assert.assertNotNull("Client type is null.", clientType);
    Assert.assertTrue("Client ID is empty.", StringUtils.isNotEmpty(clientType.getClientId()));
    Assert.assertTrue("Scopes are empty.", StringUtils.isNotEmpty(clientType.getScopes()));
}
Also used : ClientType(com.checkmarx.sdk.dto.sca.ClientType) ClientTypeResolver(com.checkmarx.sdk.utils.scanner.client.ClientTypeResolver) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig)

Example 13 with RestClientConfig

use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method initScaConfig.

protected RestClientConfig initScaConfig(boolean useOnPremAuthentication) {
    RestClientConfig config = new RestClientConfig();
    config.setProjectName("sdkScaProject");
    config.setProgressInterval(5);
    ScaConfig sca = getScaConfig(useOnPremAuthentication);
    config.setScaConfig(sca);
    return config;
}
Also used : ScaConfig(com.checkmarx.sdk.dto.sca.ScaConfig) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig)

Example 14 with RestClientConfig

use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method scan_localDirZeroCodeScan.

@Test
public void scan_localDirZeroCodeScan() throws IOException, ScannerRuntimeException {
    RestClientConfig config = initScaConfig(false);
    localDirScan(config);
}
Also used : RestClientConfig(com.checkmarx.sdk.config.RestClientConfig) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 15 with RestClientConfig

use of com.checkmarx.sdk.config.RestClientConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method scan_localDirUploadIncludeSources.

@Test
public void scan_localDirUploadIncludeSources() throws IOException, ScannerRuntimeException {
    RestClientConfig config = initScaConfig(false);
    localDirScan(config);
}
Also used : RestClientConfig(com.checkmarx.sdk.config.RestClientConfig) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

RestClientConfig (com.checkmarx.sdk.config.RestClientConfig)19 AstScaResults (com.checkmarx.sdk.dto.AstScaResults)5 Test (org.junit.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 RemoteRepositoryInfo (com.checkmarx.sdk.dto.RemoteRepositoryInfo)3 ScaConfig (com.checkmarx.sdk.dto.sca.ScaConfig)3 AstConfig (com.checkmarx.sdk.config.AstConfig)2 ScannerRuntimeException (com.checkmarx.sdk.exception.ScannerRuntimeException)2 ClientTypeResolver (com.checkmarx.sdk.utils.scanner.client.ClientTypeResolver)2 IScanClientHelper (com.checkmarx.sdk.utils.scanner.client.IScanClientHelper)2 URL (java.net.URL)2 MachinaException (com.checkmarx.flow.exception.MachinaException)1 ScanResults (com.checkmarx.sdk.dto.ScanResults)1 ScanParams (com.checkmarx.sdk.dto.ast.ScanParams)1 ClientType (com.checkmarx.sdk.dto.sca.ClientType)1 CheckmarxException (com.checkmarx.sdk.exception.CheckmarxException)1 CommonClientTest (com.checkmarx.sdk.service.CommonClientTest)1 AstScanner (com.checkmarx.sdk.service.scanner.AstScanner)1 ScaClientHelper (com.checkmarx.sdk.utils.scanner.client.ScaClientHelper)1 Path (java.nio.file.Path)1