API key management and revocation

DesignMedium35 minStripe and Microsoft style

Your task

Design API-key management and revocation for a developer platform where customers create long-lived API keys (some live for years in CI, scripts, and servers) that authenticate millions of requests/sec. Requirements: validate keys with minimal latency, let customers rotate and revoke keys instantly, scope a key to specific permissions/resources, and detect and auto-revoke a key that's been leaked publicly (e.g., committed to GitHub). Walk through how you store and validate keys, how revocation propagates fast, and the secret-storage trade-off.

It covers

  • Api keys
  • Rotation
  • Leak detection