use of com.mercedesbenz.sechub.adapter.checkmarx.support.CheckmarxUploadSupport in project sechub by mercedes-benz.
the class CheckmarxAdapterV1 method uploadSourceCodeAndStartScan.
private void uploadSourceCodeAndStartScan(CheckmarxOAuthSupport oauthSupport, CheckmarxContext context) throws AdapterException {
AdapterMetaData metaData = context.getRuntimeContext().getMetaData();
if (!metaData.hasValue(CheckmarxMetaDataID.KEY_FILEUPLOAD_DONE, true)) {
/* upload source code */
oauthSupport.refreshBearerTokenWhenNecessary(context);
CheckmarxUploadSupport uploadSupport = new CheckmarxUploadSupport();
uploadSupport.uploadZippedSourceCode(context);
/* after this - mark file upload done, so on a restart we don't need this */
metaData.setValue(CheckmarxMetaDataID.KEY_FILEUPLOAD_DONE, true);
context.getRuntimeContext().getCallback().persist(metaData);
} else {
LOG.info("Reuse existing upload for:{}", context.getTraceID());
}
/* start scan */
CheckmarxScanSupport scanSupport = new CheckmarxScanSupport();
scanSupport.startNewScan(oauthSupport, context);
}
Aggregations