Skip to content

Commit

Permalink
v2 -> v4 Migration (#128) (#129)
Browse files Browse the repository at this point in the history
* suggested changes (#135)
  • Loading branch information
vishalhcl-5960 authored Feb 6, 2024
1 parent 4d20ce0 commit 13cc25a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/hcl/appscan/sdk/CoreConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* © Copyright HCL Technologies Ltd. 2019, 2024.
* © Copyright HCL Technologies Ltd. 2019,2020.
* LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ public CloudScanServiceProvider(IProgress progress, IAuthenticationProvider auth

@Override
public String createAndExecuteScan(String type, Map<String, String> 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<String, String> request_headers = m_authProvider.getAuthorizationHeader(true);
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/hcl/appscan/sdk/scan/IScan.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* © Copyright IBM Corporation 2016.
* © Copyright HCL Technologies Ltd. 2017, 2024.
* © Copyright HCL Technologies Ltd. 2017.
* LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
*/

Expand All @@ -10,7 +10,6 @@
import com.hcl.appscan.sdk.error.ScannerException;
import com.hcl.appscan.sdk.logging.IProgress;
import com.hcl.appscan.sdk.results.IResultsProvider;
import org.apache.wink.json4j.JSONException;

public interface IScan {

Expand Down Expand Up @@ -59,4 +58,4 @@ public interface IScan {
public IScanServiceProvider getServiceProvider();

public String getReportFormat();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* © Copyright IBM Corporation 2016.
* © Copyright HCL Technologies Ltd. 2017, 2024.
* © Copyright HCL Technologies Ltd. 2017,2018.
* LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
*/

Expand Down Expand Up @@ -31,7 +31,7 @@ public interface IScanServiceProvider {
* @return The id of the submitted scan, if successful. Otherwise, null.
*/
public String createAndExecuteScan(String type, Map<String, String> params);

/**
* Submits a file for scanning.
*
Expand Down

0 comments on commit 13cc25a

Please sign in to comment.