-
Notifications
You must be signed in to change notification settings - Fork 146
feat(rivetkit): allow defining public namespace & token for client redirects via metadata endpoint #3891
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
Conversation
|
🚅 Deployed to the rivet-pr-3891 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: feat(rivetkit): allow defining public namespace & token for client redirects via metadata endpointOverviewThis PR enhances RivetKit's configuration system to support specifying public namespace and token credentials for client redirects through the metadata endpoint. The changes introduce cleaner URL-based auth syntax and better separation between backend and frontend credentials. Positive Aspects1. Well-Structured Configuration FlowThe refactoring significantly improves how endpoint parsing and configuration resolution works:
2. Comprehensive URL Auth SupportThe URL auth syntax is consistently supported across RIVET_ENDPOINT and RIVET_PUBLIC_ENDPOINT with proper handling of percent-encoded characters. 3. Good Documentation
4. Test CoverageThe endpoint parser tests are comprehensive covering basic parsing, error cases, duplicate credential detection, and edge cases. Issues & Concerns1. Critical: Potential Configuration ConfusionIn registry/config/index.ts:214, the serveManager default logic could leave clients without a valid endpoint in edge cases. Add validation to ensure that if serveManager is false and not in dev mode, either endpoint or publicEndpoint must be specified. 2. Medium: Error Message QualityIn registry/config/index.ts:207-210, error messages for namespace mismatch could be more actionable with guidance on how to fix the issue. 3. Medium: Inconsistent Default HandlingClient and registry configs have different default endpoint logic that could cause confusion. Client uses window.location.origin while registry uses hardcoded localhost. Consider consolidating or documenting the differences. 4. Minor Issues
5. Documentation TypoIn connect-backend.mdx:3 - exlpicitly should be explicitly Security ConsiderationsGood practices: No credential logging and proper URL encoding handling. Important consideration: The metadata endpoint now returns clientToken. Add documentation clarifying that publicToken should be a limited-privilege token suitable for public exposure, not the backends privileged token. Testing Recommendations
SummaryThis is a solid PR that improves RivetKits configuration flexibility. The core implementation is sound with good structure and test coverage. Recommendation: Approve with minor changes The PR is functionally correct and safe to merge, but would benefit from:
Suggested Follow-ups:
|
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
3c56ebe to
bcd4a21
Compare
4662ef8 to
f35697e
Compare
bcd4a21 to
62bde92
Compare
…directs via metadata endpoint
62bde92 to
a53dc0f
Compare
f35697e to
41511a3
Compare
Merge activity
|
…directs via metadata endpoint (#3891)

No description provided.