Skip to content

Commit c328202

Browse files
authored
docs(nip-fi): document Git smart-HTTP credential exemption (#7268)
Amend NIP-FI HTTP ingress with an explicit Git smart-HTTP credential-helper exemption. The exception covers method binding, endpoint-URL binding, and the `payload` tag requirement for `info/refs`, `git-upload-pack`, and `git-receive-pack`, while preserving per-request NIP-FI assertion, key pairing, and deny-map enforcement. The spec records Git's credential-protocol limitation, the required compensating controls, and the rule that this exception is limited to these endpoints and is superseded by per-request signing. Related: [PR #7264](#7264) Signed-off-by: Will Pfleger <[email protected]>
1 parent 47d068e commit c328202

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

‎docs/nips/NIP-FI.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,46 @@ admission procedure.
542542
> **Non-normative examples of surfaces that may appear in a protected set:**
543543
> HTTP API bridge, invite redemption, media storage, git smart-HTTP.
544544
545+
### Git smart-HTTP NIP-98 credential-helper exemption
546+
547+
Git smart-HTTP endpoints (`info/refs`, `git-upload-pack`, and
548+
`git-receive-pack`) use the git credential-helper proof pattern. The
549+
credential helper signs a single NIP-98 event at credential-fetch time against
550+
the repository-root URL with method `GET`, and Git reuses that event across the
551+
session. For these endpoints, the NIP-98 event is exempt from method binding,
552+
endpoint-URL binding, and the `payload` tag requirement. This exemption applies
553+
to all three requirements on all three endpoints, including both POST
554+
endpoints; it is not a payload-only exemption.
555+
556+
This exemption is required by Git's credential protocol. The credential helper
557+
receives only credential metadata and never sees request bodies
558+
(`crates/git-credential-nostr/src/lib.rs:98-132`), so a body hash cannot exist
559+
in the signed event. This limitation is architectural to Git's credential
560+
protocol.
561+
562+
The NIP-FI assertion and pairing requirement is unchanged and applies per
563+
request on every one of these endpoints. Each request MUST still carry and
564+
pass a verified NIP-FI assertion, satisfy `nostr_pubkey` == the NIP-98 event
565+
pubkey, and pass the deny-map check. These requirements are not satisfied by a
566+
prior request or by reuse of the NIP-98 event. The offboarding guarantee is
567+
therefore fully intact on Git: an offboarded key is denied on its next request.
568+
569+
The following compensating controls are REQUIRED for this proof pattern:
570+
571+
1. NIP-FI assertion verification MUST run on every request.
572+
2. The reused proof's signature and timestamp MUST be re-verified on every
573+
request.
574+
3. The proof timestamp MUST remain within a `±60s` window for every request.
575+
4. Production deployments MUST use TLS.
576+
5. The NIP-98 event MUST bind to the repository-root URL. This binding is
577+
repo-scoped, not endpoint-scoped or service-scoped.
578+
6. Git endpoint routing MUST separate clone endpoints from push endpoints.
579+
7. Every push MUST pass pre-receive hook push authorization.
580+
581+
This exemption applies solely to the Git credential-helper proof pattern on
582+
these three endpoints. It is not a precedent for any other surface. A client
583+
change that enables per-request signing supersedes this exemption.
584+
545585
### Request format
546586

547587
Each protected HTTP request MUST present both of the following:

0 commit comments

Comments
 (0)