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

Remove support for Swarm clients older than 3.21 #300

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions plugin/src/main/java/hudson/plugins/swarm/PluginImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,29 +286,4 @@ private static List<EnvironmentVariablesNodeProperty.Entry> parseEnvironmentVari

return result;
}

/**
* This merely exists to support older versions of the Swarm client that expect to be able to
* retrieve a UUID-based secret. Security is now handled through CSRF and permission checks
* rather than a UUID-based secret. Newer clients do not call this method or pass in a
* UUID-based secret, and newer versions of the server do not check for a UUID-based secret.
* When support for older clients that call this endpoint is removed, this endpoint can be
* deleted.
*/
@Deprecated
@SuppressFBWarnings(
value = "RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE",
justification = "False positive for try-with-resources in Java 11")
public void doSlaveInfo(StaplerRequest req, StaplerResponse rsp) throws IOException {
Jenkins jenkins = Jenkins.get();
jenkins.checkPermission(Computer.CREATE);

rsp.setContentType("text/xml");
try (Writer writer = rsp.getCompressedWriter(req)) {
writer.write(
"<slaveInfo><swarmSecret>"
+ UUID.randomUUID().toString()
+ "</swarmSecret></slaveInfo>");
}
}
}