Skip to content

Commit

Permalink
Update ServiceUtil.java
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalhcl-5960 committed Aug 24, 2024
1 parent 1fd4d89 commit 5eed66a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/hcl/appscan/sdk/utils/ServiceUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,12 @@ private static boolean hasEntitlement(String scanType, IAuthenticationProvider p
* Checks if the given scanId is valid for scanning.
*
* @param scanId The scanId to test.
* @param applicationId The applicationId to verify.
* @param type The scanType to verify.
* @param provider The IAuthenticationProvider for authentication.
* @param params The map which consist the user inputs.
* @return True if the scanId is valid. False is returned if the scanId is not valid, the request fails, or an exception occurs.
*/
public static boolean isScanId(String scanId, IAuthenticationProvider provider, Map<String, String> params) {
public static boolean isScanId(String scanId, String applicationId, String type, IAuthenticationProvider provider) {
if(provider.isTokenExpired()) {
return true;
}
Expand All @@ -250,7 +251,7 @@ public static boolean isScanId(String scanId, IAuthenticationProvider provider,
JSONObject body = (JSONObject) array.getJSONObject(0);
String appId = body.getString(CoreConstants.APP_ID);
String technologyName = body.getString("Technology").toLowerCase();
return (appId.equals(params.get(CoreConstants.APP_ID))) && (technologyName.equalsIgnoreCase(params.get(CoreConstants.SCANNER_TYPE).replaceAll("\\s", "")));
return (appId.equals(applicationId)) && (technologyName.equalsIgnoreCase(type.replaceAll("\\s", "")));
}
}
}
Expand Down

0 comments on commit 5eed66a

Please sign in to comment.