Skip to content

feat: expose commit signature and payload on getCommit#32

Merged
unknwon merged 6 commits into
mainfrom
jc/get-commit-signature-payload
Jun 3, 2026
Merged

feat: expose commit signature and payload on getCommit#32
unknwon merged 6 commits into
mainfrom
jc/get-commit-signature-payload

Conversation

@unknwon
Copy link
Copy Markdown
Contributor

@unknwon unknwon commented Jun 3, 2026

Summary

Surfaces the new commit-signature verification feature in all three SDKs.

1. verify-sig ref-policy op

Adds the new push policy op alongside no-push / no-force-push, so callers can require that every commit introduced to a matching ref carries a valid signature from a signing key registered for the tenant:

  • Go: storage.OpVerifySig
  • TypeScript: OP_VERIFY_SIG
  • Python: OP_VERIFY_SIG

Used like the other ops in refPolicies when minting JWTs / remote URLs; the op passes through to the JWT refs claim unchanged.

2. Signature/payload on getCommit

GET /repos/commit now returns two optional fields for signed commits:

  • signature — the armored OpenPGP/SSH block from the commit's gpgsig header
  • payload — the exact signed bytes (raw commit object with the gpgsig header removed)

These are exposed as optional fields on the existing CommitInfo type (not a type swap on GetCommitResult.commit), so the change is purely additive / non-breaking in all three SDKs. They are populated only by getCommit for signed commits and are empty/undefined/absent otherwise.

Version bumps (minor)

SDK From To
Go (code-storage-go) 0.9.0 0.10.0
Python (pierre-storage) 1.10.0 1.11.0
TypeScript (@pierre/storage) 1.9.0 1.10.0

Docs updated: skills/code-storage/SKILL.md (ops table + response shape) and TS/Python READMEs.

Test plan

All 3 SDKs tested e2e against locally running servers.

unknwon added 4 commits June 2, 2026 22:18
The GET /repos/commit endpoint now returns optional `signature` (armored
OpenPGP/SSH block from the commit's gpgsig header) and `payload` (the exact
signed bytes) fields for signed commits. Surface them across all three SDKs
via a new CommitInfoWithSignature type; both are absent for unsigned commits.

Bumps minor versions: Go 0.9.0 -> 0.10.0, Python 1.10.0 -> 1.11.0,
TypeScript 1.9.0 -> 1.10.0.
…CommitInfo

Avoid the source-breaking change of swapping GetCommitResult.Commit's type
(Go consumers using the field as a CommitInfo value would no longer compile).
Instead add optional signature/payload directly onto CommitInfo and revert
GetCommitResult to hold a plain CommitInfo, dropping CommitInfoWithSignature.
The fields are populated only by getCommit for signed commits and remain
empty/undefined/absent everywhere else, so the change is purely additive in
all three SDKs.
Expose the new `verify-sig` push policy op (OpVerifySig / OP_VERIFY_SIG)
alongside no-push / no-force-push so callers can require signed commits on
matching refs when minting JWTs / remote URLs. Ops pass through to the refs
claim unchanged. Adds per-language tests and documents the op in SKILL.md.
Size int64 `json:"size"`
LastCommitSHA string `json:"last_commit_sha"`
Type string `json:"type,omitempty"`
Type string `json:"type"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omitempty is redundant on the unmarshalling side

@unknwon
Copy link
Copy Markdown
Contributor Author

unknwon commented Jun 3, 2026

Merging as-is, happy to address post-merge feedback!

@unknwon unknwon merged commit 2c22b40 into main Jun 3, 2026
3 checks passed
@unknwon unknwon deleted the jc/get-commit-signature-payload branch June 3, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants