From 24fb2748dd724844f9f2009707bf9eceba054b7f Mon Sep 17 00:00:00 2001 From: Vishal Chaudhary <102226698+vishalhcl-5960@users.noreply.github.com> Date: Wed, 7 Feb 2024 00:17:57 +0530 Subject: [PATCH] suggested changes (#135) --- src/main/java/com/hcl/appscan/sdk/CoreConstants.java | 10 +++++----- .../hcl/appscan/sdk/scan/CloudScanServiceProvider.java | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hcl/appscan/sdk/CoreConstants.java b/src/main/java/com/hcl/appscan/sdk/CoreConstants.java index 555d77b3..adf74e6e 100644 --- a/src/main/java/com/hcl/appscan/sdk/CoreConstants.java +++ b/src/main/java/com/hcl/appscan/sdk/CoreConstants.java @@ -77,11 +77,11 @@ public interface CoreConstants { String API_SACLIENT_DOWNLOAD = "/api/%s/StaticAnalyzer/SAClientUtil?os=%s"; //$NON-NLS-1$ String API_SACLIENT_VERSION = "/api/%s/StaticAnalyzer/SAClientUtil?os=%s&meta=%s"; //$NON-NLS-1$ String API_KEY_PATH = "/api/ideclientuilogin"; //$NON-NLS-1$ - String API_REPORT_STATUS = "/api/v4/Reports"; //$NON-NLS-1$ - String API_ISSUES_COUNT = "/api/v4/Issues/%s/%s"; //$NON-NLS-1$ - String API_REGIONS = "/api/v4/Utils/Regions"; //$NON-NLS-1$ - String API_IS_VALID_URL = "/api/v4/Scans/IsValidUrl"; //$NON-NLS-1$ - String API_AUTHENTICATION = "/api/v4/Account/IsAuthenticated"; //$NON-NLS-1$ + String API_REPORT_STATUS = API_ENV_LATEST + "/Reports"; //$NON-NLS-1$ + String API_ISSUES_COUNT = API_ENV_LATEST + "/Issues/%s/%s"; //$NON-NLS-1$ + String API_REGIONS = API_ENV_LATEST + "/Utils/Regions"; //$NON-NLS-1$ + String API_IS_VALID_URL = API_ENV_LATEST + "/Scans/IsValidUrl"; //$NON-NLS-1$ + String API_AUTHENTICATION = API_ENV_LATEST + "/Account/IsAuthenticated"; //$NON-NLS-1$ String DEFAULT_RESULT_NAME = "asoc_results"; //$NON-NLS-1$ String SACLIENT_INSTALL_DIR = "SAClientInstall"; //$NON-NLS-1$ diff --git a/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java b/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java index a4dc1715..21b5aaa9 100644 --- a/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/scan/CloudScanServiceProvider.java @@ -51,8 +51,12 @@ public CloudScanServiceProvider(IProgress progress, IAuthenticationProvider auth @Override public String createAndExecuteScan(String type, Map params) { - if(loginExpired() || !verifyApplication(params.get(APP_ID).toString())) + if(loginExpired() || params.containsKey(APP_ID)) { + if(!verifyApplication(params.get(APP_ID).toString())) { + return null; + } return null; + } m_progress.setStatus(new Message(Message.INFO, Messages.getMessage(EXECUTING_SCAN))); Map request_headers = m_authProvider.getAuthorizationHeader(true);