From 448407a972ca9da0c1e13d49ee2c2170821be8a2 Mon Sep 17 00:00:00 2001 From: Will Pfleger Date: Fri, 2 Oct 2026 10:34:28 -0400 Subject: [PATCH] test(relay): configure a community in the Git ban-lookup fixture (#8039) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Follows #8036 (merged). The Postgres test `failed_restriction_lookup_is_503_not_403` in `crates/buzz-relay/src/api/git/transport.rs` sets `nip_fi.mode = Enforce` but configured no NIP-FI communities. Since #8028, enforce mode refuses that request at Host-to-community lookup with the same `503 authorization unavailable` the test expects, so the enforce half never reached the ban lookup it is meant to guard. Deleting the `unavailable` mapping on the ban-lookup error in `GitAuth::from_request_parts` left the test passing. The fixture now binds a community with `test_support::any_host`, the same way #8028 fixed the other enforce fixtures in this file. With the mapping deleted, the enforce half now fails. Found by @loganj's review comment on #8036. Signed-off-by: Will Pfleger Co-authored-by: Duncan --- crates/buzz-relay/src/api/git/transport.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/buzz-relay/src/api/git/transport.rs b/crates/buzz-relay/src/api/git/transport.rs index c2d441c4bb..04c1f79a42 100644 --- a/crates/buzz-relay/src/api/git/transport.rs +++ b/crates/buzz-relay/src/api/git/transport.rs @@ -4162,6 +4162,10 @@ mod off_mode_precedence_tests { let s = Arc::get_mut(&mut state).expect("fixture state is uniquely owned"); s.db = db; Arc::make_mut(&mut s.config).nip_fi.mode = mode; + Arc::make_mut(&mut s.config).nip_fi.communities = + crate::nip_fi_core::test_support::any_host( + "https://git-ban-lookup.relay.invalid", + ); s.nip_fi_verifier = Some(Arc::new(AdmitAnyAssertion(keys.public_key()))); } let scheme = if state.config.relay_url.starts_with("wss://") {