Skip to content

feat(signature)!: verify commits via GitHub public key lookup#79

Merged
benner merged 1 commit into
mainfrom
feat/signature-github-key-lookup
May 1, 2026
Merged

feat(signature)!: verify commits via GitHub public key lookup#79
benner merged 1 commit into
mainfrom
feat/signature-github-key-lookup

Conversation

@benner
Copy link
Copy Markdown
Owner

@benner benner commented May 1, 2026

Eliminates the need for a pre-configured local keyring by fetching the
author's public GPG and SSH keys directly from GitHub at check time.

Lookup flow:

  1. Resolve author email → GitHub username via the search API
  2. Fetch github.com/{username}.gpg and github.com/{username}.keys
  3. Try GPG verification with a temporary GNUPGHOME
  4. Try SSH verification with a temporary allowed_signers file
  5. Fail explicitly if the API is unreachable or author not found on GitHub

BREAKING CHANGE: previously, API errors and unknown authors silently fell
back to git verify-commit. Both cases now fail with a clear error message.
Disable the signature check if GitHub API access is unavailable.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Coverage

Coverage Report (Δ +0.0%)
FileStmtsMissCoverMissing
src/git_commit_guard
   __init__.py4320100% 
TOTAL4320100% 

@benner benner force-pushed the feat/signature-github-key-lookup branch from 6a385eb to f455da4 Compare May 1, 2026 07:27
@benner benner changed the title feat(signature): verify commits via GitHub public key lookup feat(signature)!: verify commits via GitHub public key lookup May 1, 2026
@benner benner force-pushed the feat/signature-github-key-lookup branch from f455da4 to 2d845b2 Compare May 1, 2026 07:32
@benner benner marked this pull request as ready for review May 1, 2026 07:33
Eliminates the need for a pre-configured local keyring by fetching the
author's public GPG and SSH keys directly from GitHub at check time.

Lookup flow:
1. Resolve author email → GitHub username via the search API
2. Fetch `github.com/{username}.gpg` and `github.com/{username}.keys`
3. Try GPG verification with a temporary GNUPGHOME
4. Try SSH verification with a temporary allowed_signers file
5. Fail explicitly if the API is unreachable or author not found on GitHub

BREAKING CHANGE: previously, API errors and unknown authors silently fell
back to `git verify-commit`. Both cases now fail with a clear error message.
Disable the `signature` check if GitHub API access is unavailable.

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
@benner benner force-pushed the feat/signature-github-key-lookup branch from 2d845b2 to 7c533fd Compare May 1, 2026 07:44
@benner benner merged commit d53a9da into main May 1, 2026
7 checks passed
@benner benner deleted the feat/signature-github-key-lookup branch May 1, 2026 07:46
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.

1 participant