Skip to content

Commit

Permalink
UI validation for base scan field
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalhcl-5960 committed Dec 10, 2024
1 parent 66a62fb commit ffb79e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,14 @@ public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath
return FormValidation.validateRequired(scanId);
}

public FormValidation doCheckExecutionId(@QueryParameter String executionId) {
return FormValidation.validateRequired(executionId);
public FormValidation doCheckExecutionId(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup<?> context, @QueryParameter String scanId, @QueryParameter String executionId) {
IAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials, context);
JSONArray executionDetails = new CloudScanServiceProvider(authProvider).getBaseScanDetails(scanId, authProvider);
if(executionDetails == null) {
return FormValidation.error(Messages.error_base_scan_empty_ui());
} else {
return FormValidation.validateRequired(executionId);
}
}

public FormValidation doCheckPresenceId(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup<?> context, @QueryParameter String presenceId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ error.invalid.scan.id.ui = Invalid scan ID or mismatch in scan type.
error.invalid.scan.id.application.ui = App mismatch with scan ID.
error.invalid.scan.id.git.repo.ui = Git repo scans are unsupported for SAST rescans.
error.invalid.scan.id.rescan.allowed.ui = Rescan disabled or demo scans not allowed.
error.base.scan.empty.ui = Base scan list is empty. Please enter valid Scan ID.


analysis.running=Running security analysis...
Expand Down

0 comments on commit ffb79e6

Please sign in to comment.