mirror of
https://github.com/block/buzz.git
synced 2026-11-03 16:01:35 +00:00
Resolve the community from the connection host BEFORE the WebSocket upgrade (conformance row-zero) and carry it as ConnectionState.tenant for the whole connection lifetime. Handlers read &conn.tenant and pass it into scoped DB/pub-sub calls; nothing downstream can mint or change it. - RelayError::HostNotMapped: fail-closed, generic message (no host oracle). - normalize_host(&HeaderMap, fallback): request Host header, lowercased, port-stripped; falls back to the configured relay_url host (N=1 parity). - AppState::resolve_tenant: the ONLY mint site, via the buzz-db lookup seam. Integration seam: depends on buzz-db Db::lookup_community_by_host (Mari's lane). Until that lands on rebase, the crate has exactly that one unresolved symbol; everything else (normalize_host + tests, the field plumbing) compiles clean. Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>