Skip to content

Commit 7f8ed8c

Browse files
Haytwpfleger96
andcommitted
chore(nip-fi-http): rebase onto main, update NIP-FI.md line cites
Rebase onto c328202 (git smart-HTTP exemption amendment merged as #7268). Update NIP-FI.md line references throughout nip_fi_http.rs, bridge.rs, and workflows.rs to match the amended spec's new line numbers: - NIP-FI.md:547-567 / :547-578 -> :594-607 (carrier spec / no-fallback clause) - NIP-FI.md:579-597 -> :619-637 (payload-binding clause) - NIP-FI.md:584-587 -> :624-627 (deny-set check) Update route inventory comment to cite the merged git exemption with PR and commit references (#7268 / c328202, NIP-FI.md:545-583). Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
1 parent e87b737 commit 7f8ed8c

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

crates/buzz-relay/src/api/bridge.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,11 @@ pub async fn submit_event(
747747
let url = nip98_expected_url(&state.config.relay_url, &tenant, "/events");
748748
// In NIP-FI enforce/deny-protected mode, a real NIP-98 event is mandatory —
749749
// the X-Pubkey dev-mode fallback must never satisfy the pairing requirement.
750-
// [NIP-FI.md:547-567, FI-TRACE-HTTP-INGRESS]
750+
// [NIP-FI.md:594-607, FI-TRACE-HTTP-INGRESS]
751751
let nip_fi_active = !matches!(state.config.nip_fi.mode, NipFiMode::Off);
752752
// POST /events carries an authorization-relevant body (the event determines
753753
// resource, effect, and state change), so a payload tag is required in
754-
// NIP-FI enforce mode. [NIP-FI.md:579-597]
754+
// NIP-FI enforce mode. [NIP-FI.md:619-637]
755755
let nip_fi_enforce = matches!(state.config.nip_fi.mode, NipFiMode::Enforce);
756756
let VerifiedBridgeAuth {
757757
pubkey,
@@ -1054,11 +1054,11 @@ pub async fn query_events(
10541054

10551055
let url = nip98_expected_url(&state.config.relay_url, &tenant, "/query");
10561056
// In NIP-FI enforce/deny-protected mode, a real NIP-98 event is mandatory.
1057-
// [NIP-FI.md:547-567, FI-TRACE-HTTP-INGRESS]
1057+
// [NIP-FI.md:594-607, FI-TRACE-HTTP-INGRESS]
10581058
let nip_fi_active = !matches!(state.config.nip_fi.mode, NipFiMode::Off);
10591059
// POST /query carries an authorization-relevant body (filter selects the
10601060
// resources returned), so a payload tag is required in enforce mode.
1061-
// [NIP-FI.md:579-597]
1061+
// [NIP-FI.md:619-637]
10621062
let nip_fi_enforce = matches!(state.config.nip_fi.mode, NipFiMode::Enforce);
10631063
let VerifiedBridgeAuth {
10641064
pubkey,
@@ -1614,11 +1614,11 @@ pub async fn count_events(
16141614

16151615
let url = nip98_expected_url(&state.config.relay_url, &tenant, "/count");
16161616
// In NIP-FI enforce/deny-protected mode, a real NIP-98 event is mandatory.
1617-
// [NIP-FI.md:547-567, FI-TRACE-HTTP-INGRESS]
1617+
// [NIP-FI.md:594-607, FI-TRACE-HTTP-INGRESS]
16181618
let nip_fi_active = !matches!(state.config.nip_fi.mode, NipFiMode::Off);
16191619
// POST /count carries an authorization-relevant body (filter selects what
16201620
// is counted), so a payload tag is required in enforce mode.
1621-
// [NIP-FI.md:579-597]
1621+
// [NIP-FI.md:619-637]
16221622
let nip_fi_enforce = matches!(state.config.nip_fi.mode, NipFiMode::Enforce);
16231623
let VerifiedBridgeAuth {
16241624
pubkey,
@@ -2431,7 +2431,7 @@ async fn authorize_moderation_read(
24312431
let url = nip98_expected_url(&state.config.relay_url, &tenant, &path_with_query);
24322432
// In NIP-FI enforce/deny-protected mode a real NIP-98 event is mandatory —
24332433
// the X-Pubkey dev-mode fallback must never satisfy the pairing requirement.
2434-
// [NIP-FI.md:547-578, FI-TRACE-HTTP-INGRESS]
2434+
// [NIP-FI.md:594-607, FI-TRACE-HTTP-INGRESS]
24352435
let nip_fi_active = !matches!(state.config.nip_fi.mode, NipFiMode::Off);
24362436
let VerifiedBridgeAuth {
24372437
pubkey,
@@ -4374,7 +4374,9 @@ mod postgres_tests {
43744374
// PUT /upload / /media/upload (media — upload_blob; covered by media.rs seam test)
43754375
// GET /media/{sha256} (media — get_blob; Blossom GET auth + relay membership)
43764376
// HEAD /media/{sha256} (media — head_blob; Blossom GET auth + relay membership)
4377-
// git info/refs, upload-pack, receive-pack (git transport; covered by git/transport.rs)
4377+
// git info/refs, upload-pack, receive-pack (git transport; covered by git/transport.rs;
4378+
// credential-helper proof pattern exempt from method/endpoint/payload binding per
4379+
// NIP-FI.md:545-583, merged as #7268 / c328202cb)
43784380
// POST /api/invites (invites — mint_invite; NIP-98 mint requires admin key)
43794381
//
43804382
// EXEMPT — explicitly excluded, reason given:

crates/buzz-relay/src/api/workflows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async fn authorize_workflow_read(
6868
let url = bridge::nip98_expected_url(&state.config.relay_url, &tenant, &path_with_query);
6969
// In NIP-FI enforce/deny-protected mode a real NIP-98 event is mandatory —
7070
// the X-Pubkey dev-mode fallback must never satisfy the pairing requirement.
71-
// [NIP-FI.md:547-578, FI-TRACE-HTTP-INGRESS]
71+
// [NIP-FI.md:594-607, FI-TRACE-HTTP-INGRESS]
7272
let nip_fi_active = !matches!(state.config.nip_fi.mode, NipFiMode::Off);
7373
let bridge::VerifiedBridgeAuth {
7474
pubkey,

crates/buzz-relay/src/nip_fi_http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use nostr::PublicKey;
6262
/// one-liner: replace `AlwaysAdmitStubDenyMap` with the shared map.
6363
///
6464
/// `(issuer, pubkey, now)` are required because the deny set is issuer-
65-
/// scoped per `NIP-FI.md:584-587`. Passing only pubkey would collide
65+
/// scoped per `NIP-FI.md:624-627`. Passing only pubkey would collide
6666
/// across issuers — a deny for `(iss-A, k)` must not block `(iss-B, k)`.
6767
///
6868
/// Sealed: only implementations in this crate are accepted.
@@ -193,7 +193,7 @@ pub(crate) fn check_nip_fi_http<S: IssuerKeySource, D: HttpDenyMap>(
193193

194194
// Deny-map check: (iss, pubkey) must not be in an active deny window.
195195
// The issuer comes from the already-verified assertion; `now` is used by
196-
// the real map for TTL comparison. [FI-INV-14] [NIP-FI.md:584-587]
196+
// the real map for TTL comparison. [FI-INV-14] [NIP-FI.md:624-627]
197197
let issuer = assertion.identity().issuer();
198198
if deny_map.is_denied(issuer, proven_pubkey, Utc::now()) {
199199
metrics::counter!(

0 commit comments

Comments
 (0)