-
Notifications
You must be signed in to change notification settings - Fork 384
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
GPGME: support passphrase for prompt-less signing #1446
Conversation
Skopeo PR: containers/skopeo#1540 |
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.
A process-wide environment variable shouldn’t be the only way to expose this (e.g. it is unusable from any multi-threaded server managing multiple private keys); a caller should be able to just pass a Go string to a NewGPGSigningMechanism$differentiator
constructor. (Assuming $differentiator is WithOptions
, should that just be a struct, or “functional options” with all that boilerplate? I don’t have a strong opinion at this point.)
Similarly, up the stack, the passphrase should come from copy.Options
.
Afterwards, if passing this through the environment is a good idea (AFAIK it’s not unsafe but it might be unergonomic — notably the way containers/skopeo#1540 indiscriminately makes that available to all child processes immediately makes me pause), we can add a function to pkg/cli/environment
.
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.
See also the previous review — this should be configurable in Go.
b6b7545
to
65f47bf
Compare
Good to go from my side. Had to do the usual |
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.
LGTM
Documentation targeted towards somewhere in Podman and/or Buildah?
Skopeo for now. If needed, we can add the |
@mtrmac, PTanotherL:
|
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.
ACK to the overall approach.
@mtrmac's fork was needed to allow for building on RHEL 7 which we do not target anymore. Moving to upstream allows for making use of more recent features and avoids diverging in the future. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
@vrothberg I’d really like to have a test for the |
e1aa665
to
df2414e
Compare
82bd697
to
2c9ff81
Compare
0557579
to
03ca304
Compare
To support signing images via gpgme without user prompt, allow for providing a passphrase via the copy options. Add a new *WithOptions API to the `signature` package and extend its interface. To prevent breaking the API, extend the signature API with an internal type as has already been done for other types and interfaces. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
To support signing images via gpgme without user prompt, allow for
providing a passphrase via the copy options. Add a new *WithOptions API
to the
signature
package and extend its interface.To prevent breaking the API, extend the signature API with an internal
type as has already been done for other types and interfaces in c/image.
Signed-off-by: Valentin Rothberg rothberg@redhat.com