Skip to content

Conversation

@ChristianPavilonis
Copy link
Collaborator

@ChristianPavilonis ChristianPavilonis commented Oct 28, 2025

Implements request signing for OpenRTB bid requests with automatic key rotation

Related Issues

New Endpoints

• GET /.well-known/jwks.json - Returns current public keys in JWKS format for signature verification
• POST /admin/rotate-keys - Triggers key rotation (generates new keypair, updates stores, deprecates old key)
• POST /admin/deactivate-key/:kid - Deactivates a specific key by its Key ID
• POST /admin/verify-signature - Verifies request signatures for testing/debugging

Request Signing

• All OpenRTB bid requests now include a signature in ext.trusted_server.signature and ext.trusted_server.kid
• Uses Ed25519
• Signs the request ID (bid_request.id) to ensure request authenticity

Key Rotation

Storage Model:

• Config Store (jwks_store): Stores current-kid (active key ID) and jwks (public JWKS document)
• Secret Store (signing_keys): Stores private keys indexed by KID (e.g., kid_abc123...)

Rotation Process:

  1. Generates fresh keypair
  2. Stores new private key in Secret Store under new KID
  3. Updates current-kid in Config Store
  4. Updates JWKS with both new (active) and old (deprecated) public keys
  5. Cleanup endpoint removes deprecated keys from both stores

Todos

  • make opt in

@ChristianPavilonis ChristianPavilonis marked this pull request as ready for review November 3, 2025 21:51
@ChristianPavilonis ChristianPavilonis marked this pull request as draft November 4, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants