caelum0x cea412982e fix(toolgate): narrow http allowlist for SearXNG + Menivor x-api-key auth
web.search.searxng called the internal products-net SearXNG host over plain
http and the egress client's https-only policy blocked it ("only https is
allowed: http://"). EgressConfig gets a new http_hosts: exact host:port
entries (never a wildcard) derived only from SWITCHYARD_SEARXNG_URL when it
is http -- those hosts, and only those, are also exempted from the
private/internal-address block (the whole point of allowing http for an
internal Docker-network service name). Every other host keeps the existing
SSRF policy unchanged: https only, no private IPs, no other internal hosts.
4 new egress tests cover the scoping (own host only, not via allow_hosts,
not via IP literal).

Separately, Toolgate's native Menivor adapter sent the platform credential
as `Authorization: Bearer <token>`, but Menivor's resolve_principal only
accepts a raw key via `x-api-key` (Bearer is Clerk-JWT-only there) -- a
protocol mismatch that made every menivor.* call 401 regardless of token
validity (confirmed live: the same real service-account key gets 401 via
Bearer, 200 against GET /api/v1/jobs via x-api-key). Added with_api_key()
(send the credential verbatim, no prefix) and switched menivor_render/
menivor_status/menivor_tts to it; left Scribase/Rally on with_bearer
unchanged. Catalog's menivor provider credential placement corrected to
match (x-api-key, no prefix) for documentation accuracy.

cargo test --workspace: 0 failures.
2026-11-18 00:39:44 +03:00
..