mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
test(relay): configure a community in the Git ban-lookup fixture (#8039)
🤖 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 <pfleger.will@gmail.com> Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -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://") {
|
||||
|
||||
Reference in New Issue
Block a user