Skip to main content

authenticate_with

Function authenticate_with 

Source
pub fn authenticate_with(
    keyring: Option<&KeyStore>,
    single_key: Option<&str>,
    bearer: Option<&str>,
) -> Result<TenantCtx, AuthDenied>
Expand description

The full auth law, pure over its inputs (unit-testable without env): keyring key match -> that key’s tenant (or Disabled -> 403) single static key match-> tenant “default” (the back-compat daily driver) nothing configured -> open, tenant “default” anything else -> Unknown -> 401 The keyring and the single key COMPOSE: setting MEMRA_API_KEYS does not break MEMRA_API_KEY callers (the owner’s serve scripts keep working unchanged).