-
Notifications
You must be signed in to change notification settings - Fork 129
[Graphite MQ] Draft PR GROUP:spec_1687e5 (PRs 3341, 3344) #3364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Graphite MQ] Draft PR GROUP:spec_1687e5 (PRs 3341, 3344) #3364
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR Review: CORS Gateway Handling & Engine Version Auto-UpdateThis PR combines two changes:
Overall Assessment✅ Approved - The changes are well-implemented with good security considerations. Minor suggestions below. 1. CORS Gateway Implementation (PR #3341)Strengths✅ Security-conscious design: Properly echoes the ✅ Cache poisoning prevention: Correctly adds ✅ Consistent implementation: The Rust gateway code in ✅ Good architectural reasoning: The comment on lines 99-104 clearly explains why CORS must be handled at the gateway level (OPTIONS requests can't reach actors without the ✅ Proper OPTIONS handling: Returns 204 No Content with empty body for preflight requests, which is HTTP spec-compliant. Potential Issues
Recommendation: Consider documenting the security implications and ensuring actors are aware they MUST validate origins if needed.
Recommendation: Add documentation or runtime warnings if sensitive operations (like inspector access) are exposed without origin restrictions.
Code Quality✅ Clean removal: Properly removed the old CORS configuration from multiple files without leaving dead code. ✅ Logging: Good use of Suggested refactor: fn add_cors_headers(response: ResponseBuilder, origin: &str) -> ResponseBuilder {
let mut response = response
.header("access-control-allow-origin", origin)
.header("access-control-allow-credentials", "true")
.header("access-control-expose-headers", "*");
if origin != "*" {
response = response.header("vary", "Origin");
}
response
}2. Engine Version Auto-Update (PR #3344)Strengths✅ Sensible default: Using ✅ Maintains override capability: The Potential IssuesRecommendation: Ensure your release process keeps these versions synchronized, or add validation to check engine compatibility.
Recommendation: Add a comment explaining that this uses the RivetKit package version. Suggested documentation: .default(
// Use RivetKit package version by default to keep engine in sync
() => getEnvUniversal("RIVET_RUN_ENGINE_VERSION") ?? VERSION,
),3. Test Coverage❌ No tests found: I couldn't find any tests for the new CORS functionality or engine version behavior. Recommendations:
4. Style & Conventions✅ Follows CLAUDE.md:
Security Considerations🔒 Key Security Notes:
Performance Considerations✅ Early return for OPTIONS: Handling OPTIONS at the gateway without forwarding to actors is efficient. ✅ Minimal overhead: Adding headers has negligible performance impact. Recommendations SummaryHigh Priority:
Medium Priority: Low Priority: ConclusionThe implementation is solid and security-aware. The main concern is the shift from a restrictive CORS policy (with origin whitelist) to a permissive one (allowing all origins). Ensure this is intentional and that actors properly validate origins when needed. Overall: ✅ Approved with suggestions |
This draft PR was created by the Graphite merge queue.
Trunk will be fast forwarded to the HEAD of this PR when CI passes, and the original PRs will be closed.
The following PRs are included in this draft PR: