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

@ChristianPavilonis ChristianPavilonis force-pushed the feature/jws branch 2 times, most recently from 3d63afa to 69172e3 Compare November 3, 2025 21:34
@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
@aram356 aram356 marked this pull request as ready for review November 10, 2025 15:38
Copy link
Collaborator

@aram356 aram356 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 Please resolve conflicts
🔧 Please include issues that this PR will close

@ChristianPavilonis ChristianPavilonis force-pushed the feature/jws branch 3 times, most recently from 78bd6f2 to 3d7cf35 Compare November 10, 2025 20:12
Copy link
Collaborator

@aram356 aram356 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Can you also update README.md to include setup instructions
🔧 Resolve conflicts

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

Labels

None yet

Projects

None yet

3 participants