jenkinsci / jenkinsci/credentials-binding-plugin

[JENKINS-68110] String interpolation warning should not appear for SSH key files

Open
#495 0 comments 0 reactions 0 assignees View on GitHub
component:credentials-binding-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
57
Forks
108
PR merge metrics
No merged PRs in 30d

Description

When I do something like this:

withCredentials([sshUserPrivateKey(credentialsId: 'foo', keyFileVariable: 'SSH_KEYFILE')]) {

withEnv(["GIT_SSH_COMMAND=ssh -i ${SSH_KEYFILE}"]) {
// a step that requires GIT_SSH_COMMAND to be set
}
}

I get a warning that a secret as passed to withEnv using string interpolation. That’s not true: the contents of the key file are secret, but the thing I passed to withEnv—its name—is not.

---
Originally reported by haw777, imported from: String interpolation warning should not appear for SSH key files


  • status: Open
  • priority: Minor
  • component(s): credentials-binding-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251211-141027

Raw content of original issue

When I do something like this:


withCredentials([sshUserPrivateKey(credentialsId: 'foo', keyFileVariable: 'SSH_KEYFILE')]) {

withEnv(["GIT_SSH_COMMAND=ssh -i ${SSH_KEYFILE}"]) {
// a step that requires GIT_SSH_COMMAND to be set
}
}

I get a warning that a secret as passed to withEnv using string interpolation. That’s not true: the contents of the key file are secret, but the thing I passed to withEnv—its name—is not.

environment

```
Jenkins 2.319.3

Credentials binding plugin 1.27.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.