feat(schema): add OIDC tables for embedded OIDC provider#1845
Conversation
Add three tables to support the embedded OIDC authorization server: - oidc_public_keys: RSA public keys for JWT signing/JWKS endpoint - oidc_auth_requests: in-flight authorization requests (10min TTL) - oidc_refresh_tokens: opaque refresh tokens with rotation family tracking
Benchstat (Other)Base: ✅ 2 improvement(s)
Full benchstat output |
Benchstat (RLS)Base: 📊 8 minor regression(s) (all within 5% threshold)
✅ 4 improvement(s)
Full benchstat output |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds a new HCL schema file that creates three PostgreSQL tables for OIDC: Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@schema/oidc.hcl`:
- Around line 104-107: The index definition oidc_auth_requests_code_idx
currently lacks uniqueness; update the index block for
oidc_auth_requests_code_idx (the index on column.code) to include unique = true
so the authorization codes are enforced as unique at the schema level, and then
regenerate/apply the migration so the database enforces the constraint.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Summary
oidc_public_keystable for RSA public keys used by the JWKS endpoint (/.well-known/jwks.json)oidc_auth_requeststable for in-flight PKCE authorization requests (10-minute TTL, cleaned up by background job)oidc_refresh_tokenstable for opaque refresh tokens with rotation-family replay detection (30-day expiry)These tables support the embedded OIDC provider being added to incident-commander (
--oidcflag on top of--auth basic), enabling theincident-commander auth loginCLI browser flow.All three tables are purely additive — no existing tables are modified. Running without
--oidcdoes not touch these tables.Test plan
Summary by CodeRabbit