-
Notifications
You must be signed in to change notification settings - Fork 208
Copy SSH key into ssh config dir to use instead of using the given one directly #2214
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
Conversation
|
Code coverage for golang is
|
|
Cool |
| f, err := os.CreateTemp(sshDir, "piped-ssh-key-*") | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Across the docs looks like we should close/remove the opened temp file by ourselves 👀 Should we?
It is the caller's responsibility to remove the file when it is no longer needed.
ref: docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Let me add a TODO to remove the added file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙆♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khanhtc1202 Added.
|
Code coverage for golang is
|
|
Thx 🚀 |
|
Code coverage for golang is
|
What this PR does / why we need it:
Currently, we are writing an SSH config file to use the given SSH key file directly.
In that way, ssh-agent will consider the directory which contains the given SSH key file as a dedicated directory to deal with key/cert files.
In some cases, users are expecting that the Piped should use the given SSH key file and do nothing with its directory.
So this PR copies the given key into ssh config directory with a random name to use.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: