-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Depending on how the .gpg-ids file was written, we may not match against the string itself. #2147
Conversation
…nst the string itself. We may need to do a query to crypto.FindRecipients to get their details to match against when removing. Fix for gopasspw#1964 RELEASE_NOTES=[BUGFIX] Fixes an issue where recipients remove may fail with "recipient not in store" Signed-off-by: Ben Phegan <benphegan@gmail.com>
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.
Overall LGTM. Thanks a lot. A few minor nits. But once they are fixed we can merge this.
internal/store/leaf/recipients.go
Outdated
// To do this though, we need to ensure that we also do a FindRecipients on the id name from the stored ids. | ||
recipient_ids, err := s.crypto.FindRecipients(ctx, k) | ||
if err != nil { | ||
out.Printf(ctx, "Warning: Failed to get GPG Key Info for %s: %s", k, 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.
There is out.Warnf
. Consider using that for consistent formating.
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.
Done. I have updated an additional call that was already present and using Printf
for consistency.
internal/store/leaf/recipients.go
Outdated
|
||
// If we don't match immediately, we may need to loop through the recipient keys to try and match. | ||
// To do this though, we need to ensure that we also do a FindRecipients on the id name from the stored ids. | ||
recipient_ids, err := s.crypto.FindRecipients(ctx, k) |
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.
Underscores in Go variable names are uncommon. Please use camel case, e.g. recipientIDs
.
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.
Too much Terraform! :) Done.
internal/store/leaf/recipients.go
Outdated
continue RECIPIENTS | ||
} | ||
|
||
for _, recipient_id := range recipient_ids { |
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.
recipientID
, please. Or just recipient
or maybe id
.
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.
Done.
RELEASE_NOTES=[BUGFIX] Fixes an issue where recipients remove may fail with "recipient not in store" Signed-off-by: Ben Phegan <benphegan@gmail.com>
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. Thanks a lot 👍
Hey, thanks! Just one quick question, the PR seems to have failed the DCO check for the |
…nst the string itself. (gopasspw#2147) * Depending on how the .gpg-ids file was written, we may not match against the string itself. We may need to do a query to crypto.FindRecipients to get their details to match against when removing. Fix for gopasspw#1964 RELEASE_NOTES=[BUGFIX] Fixes an issue where recipients remove may fail with "recipient not in store" Signed-off-by: Ben Phegan <benphegan@gmail.com> * Fixed variable naming and Printf to Warningf as per PR. RELEASE_NOTES=[BUGFIX] Fixes an issue where recipients remove may fail with "recipient not in store" Signed-off-by: Ben Phegan <benphegan@gmail.com>
We may need to do a query to crypto.FindRecipients to get their details to match against when removing. Fix for #1964
RELEASE_NOTES=[BUGFIX] Fixes an issue where recipients remove may fail
with "recipient not in store"
Signed-off-by: Ben Phegan benphegan@gmail.com