Skip to content

Auth level 1: registry auth spec and a single apply_auth #174

Description

@cunninghamcard-bit

Part of #166 (track B); RFC-0033 §8.6 level 1; extends RFC-0032 §3.3.

The registry can only express one kind of auth: env_var → read an API key → Authorization: Bearer. Everything else is hand-written per provider with no shared function: azure sends api-key, google x-goog-api-key, lmnt / exa_ai / parallel_ai / you_com / tinyfish x-api-key, bedrock-family providers each call bedrock/sigv4.rs, vertex takes an externally minted access token, and the 33 local-service wrappers send a PLACEHOLDER_API_KEY. Twelve header-building sites, zero reuse.

Work

  1. Row schema: replace env_var with
    "auth": { "kind": "api_key", "env": "AZURE_API_KEY", "header": "api-key" }
    kindapi_key (header defaults to Bearer; may be x-api-key, api-key, x-goog-api-key), none (local services; retire every PLACEHOLDER_API_KEY), sigv4 (params.region), bearer_token (externally supplied token, vertex). Legacy env_var keeps loading as api_key + Bearer during the transition.
  2. aimux_provider_utils::apply_auth(headers: &mut HeaderMap, spec: &AuthSpec, credential: &Credential) — the single place that turns a credential into headers (SigV4 signing stays in bedrock/sigv4.rs but is invoked from here). Replace the twelve hand-written sites.
  3. Registry validation test: every row's auth is well-formed; none rows never send an Authorization header (unit test on apply_auth).

Lands with or right after B1 (protocol column). Net deletion expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions