Expand description
resolving the authenticated write audience at the HTTP edge Resolving the authenticated write audience at the HTTP edge.
rust/public is the only crate that sees both AuthContext (micromegas-auth) and the
ingestion service (micromegas-ingestion), so this is where an Option<&Extension<AuthContext>>
– the request extension every ingestion route carries – turns into a
micromegas_ingestion::write_audience::WriteAudience. WriteAudience is single-state: a
credential carrying no bound audience, or one that fails WriteAudience::new validation,
resolves to the deployment default here rather than to a distinct unstamped state.
Functions§
- resolve_
write_ audience - Resolves the write audience for one request: a credential carrying a bound audience gets
stamped with it (or, if that label fails
WriteAudience::newvalidation, withdefault_audienceinstead,warn!-logged); one without a bound audience – or with no auth provider at all,ctx: None– resolves straight todefault_audience. The result is always a real audience: there is no unstamped state left to resolve to.