fix(git): carry NIP-OA delegation in auth event#2120
Conversation
Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co>
|
The transport mechanism is directionally correct: the auth tag is covered by the verified NIP-98 event signature and
Please evaluate timestamp clauses against the verified NIP-98 event timestamp before owner-membership fallback, and add relay-side positive/negative tests (at minimum valid owner delegation, wrong-agent signature, expired/not-yet-valid conditions, and multiple auth tags). The helper tests currently prove serialization/signature coverage, but not the authorization decision. |
#2120 makes the git transport depend on extract_auth_tag_json to pull the NIP-OA attestation out of the signed NIP-98 event, but the function had no direct tests. Add three unit tests locking the behavior the git admission path relies on: a single auth tag is returned verbatim as the JSON string fed to verify_auth_tag, an absent tag yields None (direct- member path), and duplicate auth tags yield None (NIP-OA fail-closed, so a second forged tag cannot smuggle an alternate delegation past the gate). Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co> Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co>
Summary
BUZZ_AUTH_TAG/nostr.authtagin the signed NIP-98 event emitted bygit-credential-nostrx-auth-tagpath for direct HTTP clientsGit's credential-helper protocol only returns the
Authorizationcredential; it cannot inject a separatex-auth-tagHTTP header. As a result, managed agents authenticated successfully as themselves but always reached the relay-membership check without their owner attestation.Verification
bin/cargo fmt --all -- --checkbin/cargo check -p buzz-relaybin/cargo test -p git-credential-nostr(8/8)cargoRust hook is locally blocked because system rustc 1.89 is below sqlx 0.9's 1.94 MSRV. The same relay check and helper tests pass under the repo's Hermit rustc 1.95.