feat(identity): store and retrieve full GPG keys#1527
Draft
feat(identity): store and retrieve full GPG keys#1527
Conversation
d0209e5 to
a1a1629
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR stores the full GPG private key to the
git-bugkeyring and marshals the full GPG public key into thegit-bugIdentityentity (user) that's committed to Git. This change is non-breaking but foundational - it allows future features such as exporting the GPG public keys associated with one or all users and unifiesgit-bug's commit signing and verification with Git itself.Storing just the ASCII-armored
*packet.PrivateKeymakes it impossible to recover the associated public key as the identities, sub-keys and certifications are stripped. Likewise, marshaling just the*packet.PublicKeyinto thegit-bugidentity results in a public key that can perform certain verification functions, but can't be imported into GPG and therefore would never be used by Git.For example, the current
git-bugrelease produces the following ASCII-armored public key:This key cannot be imported into GPG due to the missing identity and self-signed certification (and because the creation time is set to the Go zero value of
time.Time):Therefore,
gitcan't verify the signature produced when the associated user commits a new bug:The updated code produces an ASCII-armored public key that includes the identities, sub-keys and certifications. This key is therefore noticeably larger:
But more importantly, this key can be imported into GPG:
The
git-bugcommit is now recognized as having a valid signature:Note that the presence or absence of signatures on
git-bugcommits doesn't impact the behavior of "Require sIgned commits" on GitHub branch rules: