Skip to content

fix(conversations): allow workspace-token conversation listing - #731

Draft
AKAICH00 wants to merge 1 commit into
ChatbotXIO:mainfrom
AKAICH00:fix/ezer-conversation-token
Draft

fix(conversations): allow workspace-token conversation listing#731
AKAICH00 wants to merge 1 commit into
ChatbotXIO:mainfrom
AKAICH00:fix/ezer-conversation-token

Conversation

@AKAICH00

@AKAICH00 AKAICH00 commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • add an explicit workspace-token conversation query entrypoint
  • preserve session membership checks for the existing shared query
  • keep all results scoped to the workspace resolved from the developer token
  • clarify the workspace-token middleware context comment

Security boundary

The public handler authenticates through workspaceTokenAuthAPI, which resolves the opaque developer token to context.workspace and supplies that server-derived workspace ID to listConversationsForAPI. The existing listConversations entrypoint remains fail-closed with assertCurrentUserCanAccessChatbot.

This mirrors the existing contacts API pattern: token callers opt into a clearly named API entrypoint while session-authenticated callers retain membership enforcement. The private query implementation remains workspace-scoped.

Verification

  • pnpm exec vitest run __tests__/conversation-workspace-token-api.test.ts src/features/conversations/queries/__tests__/list-conversations.query.test.ts — 2 files, 6 tests passed
  • pnpm --filter builder check-types — passed
  • pnpm lint — passed

The regressions cover valid-token/no-session success, invalid-token rejection, token-derived workspace scoping, and retained membership enforcement for session callers.

@AKAICH00
AKAICH00 force-pushed the fix/ezer-conversation-token branch from 4a933b9 to 1547a54 Compare July 13, 2026 05:28
@viethung0o0
viethung0o0 requested review from viethung0o0 and removed request for viethung0o0 July 13, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant