Search in sources :

Example 1 with CheckmarxOAuthSupport

use of com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxOAuthSupport in project sechub by mercedes-benz.

the class CheckmarxAdapterV1 method execute.

@Override
public String execute(CheckmarxAdapterConfig config, AdapterRuntimeContext runtimeContext) throws AdapterException {
    try {
        assertNotInterrupted();
        CheckmarxContext context = new CheckmarxContext(config, this, runtimeContext);
        context.setFullScan(context.isNewProject() || config.isAlwaysFullScanEnabled());
        CheckmarxOAuthSupport oauthSupport = new CheckmarxOAuthSupport();
        oauthSupport.loginAndGetOAuthToken(context);
        assertNotInterrupted();
        /* ensure project and get project context */
        CheckmarxProjectSupport projectSupport = new CheckmarxProjectSupport();
        projectSupport.ensureProjectExists(context);
        assertNotInterrupted();
        handleUploadSourceCodeAndStartScan(oauthSupport, context);
        assertNotInterrupted();
        CheckmarxScanReportSupport scanReportSupport = new CheckmarxScanReportSupport();
        scanReportSupport.startFetchReport(oauthSupport, context);
        return context.getResult();
    } catch (Exception e) {
        throw asAdapterException("Was not able to perform scan!", e, config);
    }
}
Also used : CheckmarxOAuthSupport(com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxOAuthSupport) CheckmarxProjectSupport(com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxProjectSupport) CheckmarxScanReportSupport(com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxScanReportSupport) AdapterException(com.mercedesbenz.sechub.adapter.AdapterException) CheckmarxFullScanNecessaryException(com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxFullScanNecessaryException)

Aggregations

AdapterException (com.mercedesbenz.sechub.adapter.AdapterException)1 CheckmarxFullScanNecessaryException (com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxFullScanNecessaryException)1 CheckmarxOAuthSupport (com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxOAuthSupport)1 CheckmarxProjectSupport (com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxProjectSupport)1 CheckmarxScanReportSupport (com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxScanReportSupport)1