-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 SignKey gpg entity param to allow easier pgp signing of commits #1142
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1142 +/- ##
==========================================
+ Coverage 70.18% 70.32% +0.14%
==========================================
Files 84 84
Lines 5792 5820 +28
==========================================
+ Hits 4065 4093 +28
Misses 947 947
Partials 780 780
Continue to review full report at Codecov.
|
f7053bf
to
7d6eaf1
Compare
7d6eaf1
to
307fef9
Compare
Thank you, @anandkumarpatel. In the past, when "helper" functions have been suggested for this repo, we have typically requested that they be put in their own separate repo for a few reasons: it keeps the API surface area of this repo smaller, reduces the maintenance burden on this repo, and keeps its list of external dependencies smaller. However, I can see how this can be useful, and I'm game to include it in this repo. I'd like @willnorris and @gauntface to weigh in on their thoughts for including something like this first. |
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.
I don't love the idea of adding this into the Commit type like this, but given how CreateCommit
works (internally creating a createCommit
struct which carries the signature, rather than the signature being on the passed in Commit
struct directly), there's not really an option I can think of that's all that much better.
Looks fine to me in principle. I haven't thoroughly reviewed or tested the actual signature generation logic, though.
Closing abandoned PR. |
@gmlewis Sorry, forgot about this one. |
Oh, sure... no problem! I was just trying to do some Spring Cleaning in June. 😄 |
No problem! Continued here: #1198 |
This PR creates a new param for the
Commit
struct calledSignKey
.SignKey
is anopenpgp.Entity
type which is the standard way of reading and validating pgp keys.When specified the key will be used to sign the commit. This makes it so the user does not have to sign the key externally and duplicate some of the logic the
CreateCommit
function does.To maintain backward compatibility, if the
Verification.Signature
is definedSignKey
will have no effect.This provides similar functionality that go-git has: src-d/go-git@7b6c126
Note from the git docs: https://github.com/octokit/routes/blob/152c0b5d156844e17a1805d0509c9a0b7cfc848f/routes/api.github.com/git.json#L282
So I wanted to make it less complicated 😄