Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

[FR] Add method PGPPayload() for tag and commit #1116

Closed
sapk opened this issue Apr 18, 2019 · 2 comments
Closed

[FR] Add method PGPPayload() for tag and commit #1116

sapk opened this issue Apr 18, 2019 · 2 comments

Comments

@sapk
Copy link
Contributor

sapk commented Apr 18, 2019

Before doing a PR I would like to know your if it would be accepted and what it should look like to be accepted.

Currently only the full Encode method of a commit/tag is exposed publicly. In the goal of being able to verify the payload directly from a keyring and not a armored key string like the Verify method of tag and commit, I would suggest to add another method like PGPPayload() string that export the result of t.encode(o, false). This method could also be re-use in the Verify of commit and tag.

I mainly ask because it doesn't follow the contributing rule: You should be able to run the same query using git. We don't accept features that are not implemented in the official git implementation. as I don't think we can export without the sig with the git cli. But this method would be very useful and limit the duplication of code in and outside go-git to do the same.

@filipnavara
Copy link
Contributor

Notably it's something we run into in Gitea. The GitHub API exposes the PGP payload to the users (https://developer.github.com/v3/git/commits/) and libgit2 has an API to get it (https://libgit2.org/libgit2/#HEAD/group/commit/git_commit_extract_signature).

sapk added a commit to sapk-fork/go-git that referenced this issue Apr 21, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 21, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 21, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 24, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 24, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 24, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 24, 2019
sapk added a commit to sapk-fork/go-git that referenced this issue Apr 24, 2019
mcuadros added a commit that referenced this issue Apr 24, 2019
plumbing: object/{commit,tag} add EncodeWithoutSignature, Implement #1116
@sapk
Copy link
Contributor Author

sapk commented Apr 24, 2019

Closed by #1127

@sapk sapk closed this as completed Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants