Skip to content

fix(git-credential-nostr): accept BUZZ_PRIVATE_KEY with NOSTR_PRIVATE_KEY fallback - #4723

Open
santhiprakash wants to merge 1 commit into
block:mainfrom
santhiprakash:fix/est-1804-git-credential-buzz-key
Open

fix(git-credential-nostr): accept BUZZ_PRIVATE_KEY with NOSTR_PRIVATE_KEY fallback#4723
santhiprakash wants to merge 1 commit into
block:mainfrom
santhiprakash:fix/est-1804-git-credential-buzz-key

Conversation

@santhiprakash

Copy link
Copy Markdown

Summary

git-credential-nostr was the only Buzz component that did not read BUZZ_PRIVATE_KEY. Users who exported the ecosystem-standard env var got silent wrong-identity signing because the helper fell back to nostr.keyfile (or no credentials) instead.

This change:

  • Resolves identity in this order: $NOSTR_PRIVATE_KEY, $BUZZ_PRIVATE_KEY, then git config nostr.keyfile.
  • Warns on stderr when both env vars are set to different values and $NOSTR_PRIVATE_KEY wins, so the silent wrong-identity trap is at least audible.
  • Updates the helper README and docs/remote-agents.md to document the precedence.
  • Adds integration tests for BUZZ_PRIVATE_KEY-only and the conflict-warning path.

Related issue

Fixes #4712.

No duplicate PR found (searched open/closed PRs for 4712, BUZZ_PRIVATE_KEY, and git-credential-nostr).

Testing

Targeted package-level verification:

source bin/activate-hermit
cargo fmt -p git-credential-nostr -- --check
cargo clippy -p git-credential-nostr --all-targets --all-features -- -D warnings
cargo test -p git-credential-nostr

All passed:

  • cargo fmt — clean
  • cargo clippy — clean (-D warnings)
  • cargo test -p git-credential-nostr — 10 integration tests passed (including the two new regression tests)

Full just ci was not run because this is an isolated Rust crate change; the targeted tests above exercise the modified surface.

…_KEY fallback

`git-credential-nostr` was the only Buzz component that did not read
`BUZZ_PRIVATE_KEY`. Users who exported the ecosystem-standard env var got
silent wrong-identity signing because the helper fell back to a keyfile or
to an unset `NOSTR_PRIVATE_KEY`.

- Resolve identity in this order: `$NOSTR_PRIVATE_KEY`, `$BUZZ_PRIVATE_KEY`,
  then `git config nostr.keyfile`.
- Warn on stderr when both env vars are set to different values and
  `$NOSTR_PRIVATE_KEY` wins, so the conflict is at least audible.
- Update the helper README and `docs/remote-agents.md` to document the
  precedence.
- Add integration tests for (a) `BUZZ_PRIVATE_KEY`-only and (b) both envs
  set to different values with the expected warning.

Fixes block#4712.

Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
@santhiprakash
santhiprakash requested a review from a team as a code owner August 4, 2026 14:26
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.

git-credential-nostr silently ignores BUZZ_PRIVATE_KEY — its env override is NOSTR_PRIVATE_KEY, unlike other components

1 participant