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

Add SSH support for age #1692

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add SSH support for age #1692

wants to merge 6 commits into from

Conversation

haoqixu
Copy link

@haoqixu haoqixu commented Dec 1, 2024

Continues #1134.

Closes #1134
Closes #1496
Fixes #692

@haoqixu
Copy link
Author

haoqixu commented Dec 1, 2024

This PR rebases #1134 and includes _FILE in the environment variable according to the suggestion in #1134 (comment), but uses SopsAgeSshPrivateKeyFileEnv instead of SopsAgeSshPrivateKeyEnvFile to stay aligned with SopsAgeKeyFileEnv.

@haoqixu haoqixu marked this pull request as draft December 1, 2024 21:48
@haoqixu haoqixu marked this pull request as ready for review December 1, 2024 21:57
if err != nil {
return nil, err
}
defer in.Close()

Check warning

Code scanning / CodeQL

Writable file handle closed without error handling Warning

File handle may be writable as a result of data flow from a
call to OpenFile
and closing it may result in data loss upon failure, which is not handled explicitly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@getsops/maintainers I'm pretty sure these warnings (there are two more further down in this file) can be dismissed since we don't need to ensure that data is written in case of errors. Does that sound correct to you?

if err != nil {
return nil, err
}
defer out.Close()

Check warning

Code scanning / CodeQL

Writable file handle closed without error handling Warning

File handle may be writable as a result of data flow from a
call to OpenFile
and closing it may result in data loss upon failure, which is not handled explicitly.
if err != nil {
return nil, err
}
defer tty.Close()

Check warning

Code scanning / CodeQL

Writable file handle closed without error handling Warning

File handle may be writable as a result of data flow from a
call to OpenFile
and closing it may result in data loss upon failure, which is not handled explicitly.
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, and sorry it took so long to review it...

age/tui.go Outdated Show resolved Hide resolved
age/keysource.go Outdated Show resolved Hide resolved
age/keysource.go Outdated Show resolved Hide resolved
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, up to two details in go.mod and the open discussions on the Code scanning warnings.

go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding support for ssh keys for encryption.
3 participants