feat(runtime): dispatch /api/v1/share-links to per-env shareLinks service#1986
Merged
Conversation
…vice Add HttpDispatcher.handleShareLinks — resolves the per-env shareLinks service (env from hostname) for create/list/revoke + public token resolve/messages, mirroring handleI18n/handleAI. Whitelist the public resolve/messages paths in enforceProjectMembership so a signed-in non-member opening a public link isn't 403'd. Register the share-link service in SharingServicePlugin regardless of the enforce flag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
handleShareLinks fetched the record via resolveService('objectql', env),
which can return a different (host/scoped) engine that lacks the per-env
rows — so resolve/messages 410'd even though the record existed. Read
objectql from this.kernel (the request's resolved per-env kernel), the
same engine SharingServicePlugin bound the shareLinks service to.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 19 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mounts the share-link REST surface for the multi-tenant runtime by adding a
/share-linksbranch +HttpDispatcher.handleShareLinksthat resolves the per-envshareLinksservice (env from hostname) — mirroringhandleI18n/handleAI. Per-env kernels have no HTTP server, so a plugin's ownhttp.post()routes are invisible; this is the dispatch seam they need.POST/GET/DELETE /share-links(authenticated) + publicGET /:token/resolveand/:token/messages.enforceProjectMembership(a signed-in non-member opening a public link must not 403).SharingServicePlugin.startnow registers theshareLinksservice regardless of theenforceflag (it previously early-returned onenforce:falsebefore reaching it).this.kernel(the request's resolved per-env kernel) — the same engine the service is bound to — notresolveService('objectql', env), which could return a host/scoped engine lacking the rows.Pairs with objectstack-ai/objectui#feat-share-links-public-page and objectstack-ai/cloud (per-env
SharingServicePluginregistration). Verified browser-E2E on the full local stack: create→link, public/s/:tokenrenders an AI conversation read-only with no login.🤖 Generated with Claude Code