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

[JENKINS-69155] Snapshot authentication credentials #111

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ private HttpRequestExecution(
CredentialsProvider.trackAll(run, credential);

if (credential instanceof StandardUsernamePasswordCredentials) {
this.proxyCredentials = (StandardUsernamePasswordCredentials) credential;
// create snapshot of credentials because it needs to be serialized to the agent
this.proxyCredentials = CredentialsProvider.snapshot((StandardUsernamePasswordCredentials) credential);
} else {
this.proxyCredentials = null;
throw new IllegalStateException("Proxy authentication '" + proxyAuthentication + "' doesn't exist anymore or is not a username/password credential type");
Expand Down Expand Up @@ -232,6 +233,8 @@ private HttpRequestExecution(
CredentialsProvider.trackAll(run, credential);

if (credential != null) {
// create snapshot of credential because it needs to be serialized to the agent
credential = CredentialsProvider.snapshot(credential);
if (credential instanceof StandardUsernamePasswordCredentials) {
if (this.useNtlm) {
auth = new CredentialNtlmAuthentication((StandardUsernamePasswordCredentials) credential);
Expand Down