Skip to content

Agent Identification by API Key Mapping #8

Description

@kaissb

Branch: feature/0.1.1-apikey-agent-mapping
Version: v0.1.1 — Gate Completion

Build

  1. Read [gate.identification] method from config.
  2. "header" (default) → use X-Oberwatch-Agent.
  3. "api_key" → match Authorization header against [[gate.api_key_map]] by api_key_prefix. Longest prefix wins.
  4. Explicit X-Oberwatch-Agent header overrides API key mapping.
  5. Never log/store full API keys.

Tests

  • Unit: header method works; api_key matches; no match → "unknown"; header overrides api_key; longest prefix wins.

Commit message

feat: support agent identification by API key mapping

- Match Authorization header against api_key_map by prefix
- Longest prefix match wins
- Explicit X-Oberwatch-Agent header overrides mapping
- Never log or store full API keys

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions