Skip to content

Commit

Permalink
make subversion CSP compliant / fix existing form validation
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomomdahan committed Oct 14, 2024
1 parent 1895dc4 commit cc487b9
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/main/java/hudson/scm/SubversionSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -2352,25 +2352,24 @@ public void postCredential(String url, final UserProvidedCredential upc, PrintWr
}
}

// /**
// * @deprecated retained for API compatibility only
// */
// @CheckForNull
// @Deprecated
// @RequirePOST
// public FormValidation doCheckRemote(StaplerRequest req, @AncestorInPath AbstractProject context, @QueryParameter String value, @QueryParameter String credentialsId) {
//
// System.out.println("doCheckRemote NOT QHAT WE NEED");
// Jenkins instance = Jenkins.getInstance();
// if (instance != null) {
// ModuleLocation.DescriptorImpl d = instance.getDescriptorByType(ModuleLocation.DescriptorImpl.class);
// if (d != null) {
// return d.doCheckCredentialsId(req, context, value, credentialsId);
// }
// }
//
// return FormValidation.warning("Unable to check remote.");
// }
/**
* @deprecated retained for API compatibility only
*/
@CheckForNull
@Deprecated
@RequirePOST
public FormValidation doCheckRemote(StaplerRequest req, @AncestorInPath AbstractProject context, @QueryParameter String value, @QueryParameter String credentialsId) {

Jenkins instance = Jenkins.getInstance();
if (instance != null) {
ModuleLocation.DescriptorImpl d = instance.getDescriptorByType(ModuleLocation.DescriptorImpl.class);
if (d != null) {
return d.doCheckCredentialsId(req, context, value, credentialsId);
}
}

return FormValidation.warning("Unable to check remote.");
}

/**
* @deprecated use {@link #checkRepositoryPath(hudson.model.Job, org.tmatesoft.svn.core.SVNURL, com.cloudbees.plugins.credentials.common.StandardCredentials)}
Expand Down

0 comments on commit cc487b9

Please sign in to comment.