Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handled the presence and proxy case #120

Merged
merged 13 commits into from
Nov 20, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public interface DASTConstants {
String DYNAMIC_ANALYZER_WITH_FILE = "DynamicAnalyzerWithFile"; //$NON-NLS-1$
String SCAN_FILE = "ScanFile"; //$NON-NLS-1$
String SCAN_FILE_ID = "ScanFileId"; //$NON-NLS-1$
String PRESENCE_ID = "PresenceId"; //$NON-NLS-1$
String STARTING_URL = "StartingUrl"; //$NON-NLS-1$
String TRAFFIC_FILE = "trafficFile";
String TRAFFIC_FILE_ID = "LoginSequenceFileId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.hcl.appscan.sdk.CoreConstants;
import com.hcl.appscan.sdk.Messages;
import com.hcl.appscan.sdk.auth.IAuthenticationProvider;
import com.hcl.appscan.sdk.error.InvalidTargetException;
import com.hcl.appscan.sdk.error.ScannerException;
import com.hcl.appscan.sdk.logging.DefaultProgress;
Expand Down Expand Up @@ -44,9 +45,10 @@ public void run() throws ScannerException, InvalidTargetException {
Map<String, String> params = getProperties();
params.put(STARTING_URL, target);

if(!ServiceUtil.isValidUrl(params.get(STARTING_URL),getServiceProvider().getAuthenticationProvider())) {
throw new ScannerException(Messages.getMessage(CoreConstants.ERROR_URL_VALIDATION));
}
IAuthenticationProvider authProvider = getServiceProvider().getAuthenticationProvider();
if(params.get(PRESENCE_ID).equals("") && !ServiceUtil.isValidUrl(params.get(STARTING_URL), authProvider, authProvider.getProxy())) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant you use "EMPTY"?

throw new ScannerException(Messages.getMessage(CoreConstants.ERROR_URL_VALIDATION));
}

String scanLoginType = null;
if (params.get(LOGIN_TYPE) != null) {
Expand Down
Loading