feat: support unsigned oidc request objects#785
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughFrontend: adds JWT Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Frontend as Frontend (useOIDCParams)
participant Backend as Backend (.well-known)
Client->>Frontend: Navigate /auth?...&request=<JWT>
Frontend->>Frontend: b64urlDecode & decodeRequestObject(JWT)\n(require alg:"none", empty signature)\nfilter string claims
Frontend->>Frontend: Object.assign(params, decodedClaims)\nvalidate via oidcParamsSchema
Client->>Backend: GET /.well-known/openid-configuration
Backend-->>Client: JSON including request_parameter_supported:true\nand request_object_signing_alg_values_supported:["none"]
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #785 +/- ##
==========================================
+ Coverage 19.97% 20.01% +0.04%
==========================================
Files 50 50
Lines 3960 3962 +2
==========================================
+ Hits 791 793 +2
Misses 3100 3100
Partials 69 69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 `@frontend/src/lib/hooks/oidc.ts`:
- Around line 14-31: The function decodeRequestObject currently decodes the
payload without checking the JOSE header; update decodeRequestObject to first
base64url-decode and JSON.parse the header (parts[0]) and validate its "alg"
field before trusting payload claims—return {} if header is malformed or alg is
missing/not "none" (or not an explicitly allowed algorithm), then only proceed
to decode and return string-valued keys from the payload; ensure any header
parse errors are caught so the function still returns {} on failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a87a2671-60ad-4316-a943-8ee2962ba701
📒 Files selected for processing (3)
frontend/src/lib/hooks/oidc.tsinternal/controller/well_known_controller.gointernal/controller/well_known_controller_test.go
a7131e7 to
0345102
Compare
advertises
request_parameter_supportedandrequest_object_signing_alg_values_supportedin discoverydecodes jwt in frontend to merge claims
now passes the "oidcc-unsigned-request-object-supported-correctly-or-rejected-as-unsupported" conformance test:
Summary by CodeRabbit