Conversation
…t to corresponding subgraph requests
WalkthroughA new subtest was added to the WebSocket tests to verify that authentication context values can be used in header expressions for subgraph requests. Supporting code in the WebSocket handler was updated to clone the expression context from the original request context into the subscription execution context, ensuring correct propagation of authentication-derived values. Changes
Estimated code review effort2 (10–30 minutes) 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
router-tests/websocket_test.go(3 hunks)router/core/websocket.go(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Router CI
router/core/websocket.go
[error] 990-990: go vet error: cannot use origCtx.expressionContext.Clone() (value of type *github.com/wundergraph/cosmo/router/internal/expr.Context) as github.com/wundergraph/cosmo/router/internal/expr.Context value in assignment
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: build-router
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: integration_test (./events)
- GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
- GitHub Check: integration_test (./telemetry)
- GitHub Check: image_scan
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: build_test
🔇 Additional comments (3)
router-tests/websocket_test.go (3)
4-4: LGTM: Context import added appropriately.The context import is correctly added to support the new TestAuthenticator implementation.
86-96: LGTM: Well-implemented test authenticator.The TestAuthenticator is correctly implemented with:
- Proper interface compliance with
authentication.Authenticator- Fixed test claims that are predictable for testing
- Clean and simple implementation suitable for test purposes
863-919: LGTM: Comprehensive test for authentication context in header expressions.This test effectively validates that authentication context values can be used in header expressions for subgraph requests during WebSocket subscription execution. Key strengths:
- Proper test setup: Configures header rules with authentication context expressions
- Verification strategy: Uses GlobalMiddleware to assert headers are correctly set
- Complete flow testing: Establishes WebSocket connection, sends subscription, and verifies response
- Good assertions: Validates both
request.auth.isAuthenticatedandrequest.auth.claims.favorite_animalexpressionsThe test follows the established patterns in the file and provides good coverage for the new functionality.
e230eab to
5c3b845
Compare
1ccbd7e to
8d7a5c4
Compare
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
This PR is to verify a PR from a fork due to current limitations on fork CI checks. This is for #1957
Checklist
Summary by CodeRabbit
New Features
Tests