Skip to content

feat(runtime): dispatch /api/v1/share-links to per-env shareLinks service#1986

Merged
os-zhuang merged 2 commits into
mainfrom
feat/share-links-dispatch
Jun 17, 2026
Merged

feat(runtime): dispatch /api/v1/share-links to per-env shareLinks service#1986
os-zhuang merged 2 commits into
mainfrom
feat/share-links-dispatch

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Mounts the share-link REST surface for the multi-tenant runtime by adding a /share-links branch + HttpDispatcher.handleShareLinks that resolves the per-env shareLinks service (env from hostname) — mirroring handleI18n/handleAI. Per-env kernels have no HTTP server, so a plugin's own http.post() routes are invisible; this is the dispatch seam they need.

  • POST/GET/DELETE /share-links (authenticated) + public GET /:token/resolve and /:token/messages.
  • Whitelists the public resolve/messages paths in enforceProjectMembership (a signed-in non-member opening a public link must not 403).
  • SharingServicePlugin.start now registers the shareLinks service regardless of the enforce flag (it previously early-returned on enforce:false before reaching it).
  • Record/messages are fetched from this.kernel (the request's resolved per-env kernel) — the same engine the service is bound to — not resolveService('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 SharingServicePlugin registration). Verified browser-E2E on the full local stack: create→link, public /s/:token renders an AI conversation read-only with no login.

🤖 Generated with Claude Code

os-zhuang and others added 2 commits June 16, 2026 23:29
…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>
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 16, 2026 10:10pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-sharing, @objectstack/runtime.

19 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/cloud-artifact-api.mdx (via packages/runtime)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/runtime)
  • content/docs/concepts/north-star.mdx (via packages/runtime)
  • content/docs/concepts/packages.mdx (via @objectstack/plugin-sharing, @objectstack/runtime)
  • content/docs/guides/api-reference.mdx (via @objectstack/runtime)
  • content/docs/guides/authentication.mdx (via @objectstack/runtime)
  • content/docs/guides/cheatsheets/permissions-matrix.mdx (via packages/plugins/plugin-sharing)
  • content/docs/guides/cloud-deployment.mdx (via @objectstack/runtime)
  • content/docs/guides/deployment-vercel.mdx (via @objectstack/runtime)
  • content/docs/guides/driver-configuration.mdx (via @objectstack/runtime)
  • content/docs/guides/hook-bodies.mdx (via @objectstack/runtime)
  • content/docs/guides/packages.mdx (via @objectstack/plugin-sharing, @objectstack/runtime)
  • content/docs/guides/plugin-chatbot-integration.mdx (via @objectstack/runtime)
  • content/docs/guides/production-readiness.mdx (via @objectstack/runtime)
  • content/docs/guides/single-project-mode.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectos/http-protocol.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectos/index.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectos/lifecycle.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectql/security.mdx (via packages/plugins/plugin-sharing)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 36b738f into main Jun 17, 2026
14 checks passed
@os-zhuang
os-zhuang deleted the feat/share-links-dispatch branch June 17, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant