Repository navigation
feat(signatures): Verified badges on signed commits from profile keys (P1-7, 2/2) - #348
Merged
Merged
Conversation
Signed commits (OpenPGP and SSH, as git verify-commit reads them) show GitHub's Verified / Unverified badge on the commits list, the commit page and a PR's commits. A commit is Verified when its signature checks against a key exactly one of the repository's owner and members (and a PR's author) lists in profile.pubkeys; Unverified says why. One shared rule, forge_core::rules::signature (rPGP, ed25519-dalek) and lib/rules/signature.ts (OpenPGP.js, @noble/curves), is held equal by 31 pubkey_entry / commit_signature vectors over throwaway fixture keys. Keys are published from Settings → Public profile → Signing keys or dg profile key add/list/remove; dg verify-commit gives the badges' verdict for a clone's commits. Signers are read only when a page shows a signed commit (sg-1, sg-2 budget tests). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (66)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
P1-7 (2/2): signed-commit badges
Shows GitHub's Verified / Unverified labels on signed commits. A commit is checked against the signing keys that identities publish in their forge-community
profile.pubkeys. The contracts are unchanged: this PR uses only the existingpubkeysproperty.What ships
ssh-ed25519 …line or the output ofgpg --armor --export. You can list and remove keys, and the cost is confirmed before each write. The section is shown inside the existing profile form, and a key write no longer discards unsaved profile edits.dg profile key add|list|remove:addwith no flags publishes git's own signing key (user.signingkey,gpg.format).--ssh <file|line>and--gpg <id>work too, with gpg's subkey choice: the newest valid signing subkey,!for exactly one key, and short key ids.dg profile showlists the keys.dg verify-commit <REV>... [-R owner/name] [--author <identity>]: the same verdict as the badges, for a clone's commits. A bad signature exits with E504.Shared rule
forge_core::rules::signature(rPGP 0.20 and ed25519-dalek) andforge-web/lib/rules/signature.ts(OpenPGP.js 6 and @noble/curves) implement the same rule:ssh-ed25519 <b64> [comment], orgpg:<FPR> <b64 key packet>. A baregpg:<FPR>never verifies.parse_buffer_signed_by_header, with bothgpgsigheaders dropped.31 new vectors (
pubkey_entry__*,commit_signature__*) pass in both languages. They were built from throwaway keys and commits; the public halves are inforge-contracts/fixtures/signing. Both clients also build byte-identical entries from those fixture keys (Rust and TS tests). The entry formats and rules are documented indocs/contracts/forge-v2.md(profile row) anddocs/guides/identity-and-keys.md("Signed commits and Verified badges").Trust model (documented): Verified means "signed with a key this identity publishes". As with a key on a GitHub account, nobody proves they hold the key they list. Forge does not know commit emails. If two identities list the same key, it is ambiguous and the commit is Unverified, so a member copying someone else's key cannot take the badge from them.
Budget
The signers are read only once a page shows a signed commit: the memberships (cached, and shared with the commit page's checks) plus one
profilequery. Unsigned histories cost nothing. Measured on sakura (alice/p17-signed, 6 commits signed every way): the commits list costs 12 requests cold, a commit page 9.New tests in
page-budget.spec.ts, which pass against sakura:sg-1: the fixture's unsigned history queries no profile.sg-2: withE2E_SIGNED_REPO, the list stays ≤ 25 and reads the signers once.Live verification on sakura
dg profile key addpublished alice's SSH key and her OpenPGP Ed25519 key, and bob's OpenPGP key (dg picked its signing subkey). A duplicate key and an RSA key were refused before anything was signed.alice/p17-signedwas pushed with commits of each kind: unsigned, SSH by alice, GPG by alice, GPG by bob's subkey, GPG RSA, SSH ECDSA.dg verify-commitand the web gave the same verdicts:--author bob.overflow: hiddencannot clip it, and it flips above the label near the bottom of the viewport.dash-forge-qa/evidence/p1-7/(dg-10..12-*.txt,web/commits-badge*,web/commit-page-*,web/settings-keys-*,web/web-sig-*.log).Review
The code-review skill ran at high effort and its findings were fixed:
!and a certify-only primary are refused;gpgsig-sha256-only commit in a SHA-1 repository reads as unsigned;A simplify pass then reused
useDismissandgit::config_get.Gates:
cargo fmt,clippy -D warnings,cargo test --workspace,tsc,eslintandvitest(5,501 tests) all pass.Follows #346 (profiles, merged).
🤖 Generated with Claude Code