X-API-Key authentication to the new token hierarchy.
Overview
The migration is non-breaking. Both authentication methods work simultaneously during the transition period.Phase 1: Deploy
Deploy the auth service and database migration. No changes to existing API behavior.X-API-Key continues to work exactly as before. The only visible difference is a new response header on legacy-authenticated requests:
Phase 2: Bootstrap
Generate signing keys and app tokens for each existing customer.Phase 3: Migrate
Customers derive their token chain and switch their integration.Step 1: Get a Bearer Token
Step 2: Create Agent Tokens
Step 3: Switch Authentication Headers
- Before (legacy)
- After (token)
- With session
Step 4: Verify
X-Quint-Deprecation header.
Phase 4: Cutover
After all customers have migrated (monitor forX-Quint-Deprecation header in access logs):
- Remove the
_handle_legacy_auth()method fromAuthMiddleware - Remove the
X-API-Keyheader check - Return 401 for any request without
Authorization: Bearer qt_* - Remove
api_key_hashcolumn frompublic.customers(optional cleanup)
Comparison: Before and After
Request Flow — Before
- No agent identity
- No RBAC
- No delegation
- No revocation (except deleting customer)
- No audit trail of which agent performed which action
Request Flow — After
- Full agent identity and delegation chain
- RBAC with glob pattern matching
- O(1) revocation via bloom filter
- Action signatures for non-repudiation
- Session-scoped event counting
- Human override flow for high-risk events
FAQ
Q: Will my existing integration break? No.X-API-Key auth continues to work during the transition. You’ll see a deprecation header in responses.
Q: How long is the migration window?
TBD — we’ll communicate a timeline. Expect at least 90 days after bootstrap.
Q: What if I lose my app token?
Contact support. A new app token can be generated, but the old one cannot be recovered. The old one will be revoked.
Q: Can I use both auth methods simultaneously?
Yes, but not in the same request. The middleware checks Authorization: Bearer qt_* first, then falls back to X-API-Key.
Q: What happens to my API key after migration?
It continues to work until Phase 4 cutover. After cutover, API keys are no longer accepted.
Q: How do I handle token expiry?
Agent tokens expire after 24 hours by default. Your integration should detect 401 responses and re-derive tokens from your bearer token (90-day TTL).
Q: What if the bloom filter has a false positive on my valid token?
You’ll receive a 401 with a revocation error. Re-derive the token from your bearer. This affects ~0.8% of tokens at most. Contact support if persistent.