Skip to content

Commit

Permalink
ASA-9275
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalhcl-5960 committed Dec 16, 2024
1 parent cb9ddc5 commit c4e1cbd
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,6 @@ public void validateScannerSettings(JenkinsAuthenticationProvider authProvider,
properties.remove(CoreConstants.INCLUDE_SCA);
}

if(!properties.containsKey(CoreConstants.UPLOAD_DIRECT) && !(new File(properties.get(TARGET)).isDirectory())) {
throw new AbortException(Messages.error_target_wrong_input());
}

//includeSCA is only available if the user upload an IRX file.
if (properties.containsKey(CoreConstants.INCLUDE_SCA) && properties.containsKey(CoreConstants.UPLOAD_DIRECT) && !properties.get(TARGET).endsWith(".irx")) {
throw new AbortException(Messages.error_invalid_format_include_sca());
Expand Down Expand Up @@ -318,14 +314,11 @@ public FormValidation doCheckIncludeSCAUploadDirect(@QueryParameter String inclu
return FormValidation.ok();
}

public FormValidation doCheckTarget(@QueryParameter String target, @QueryParameter String scanMethod, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup<?> context) {
public FormValidation doCheckTarget(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup<?> context) {
JenkinsAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials,context);
if(!ServiceUtil.hasSastEntitlement(authProvider)) {
return FormValidation.error(Messages.error_active_subscription_validation_ui());
}
if(!scanMethod.equals(CoreConstants.UPLOAD_DIRECT) && target!=null && !target.isEmpty() && !(new File(target).isDirectory())) {
return FormValidation.error(Messages.error_target_wrong_input());
}
return FormValidation.ok();
}
}
Expand Down

0 comments on commit c4e1cbd

Please sign in to comment.