Repository navigation
DEV-2386: Document chat security, identity and V3 usage - #327
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying fliplet-cli with
|
| Latest commit: |
a348622
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cd20e803.fliplet-cli.pages.dev |
| Branch Preview URL: | https://fix-dev-2386-chat-security-d.fliplet-cli.pages.dev |
zeryabkhan91
left a comment
There was a problem hiding this comment.
Code review (via /fliplet-pr-review)
Review basis: subject=08d301a0342de94954b75fb319907a1b20a03464 standards=fliplet-engineering@0.18.0 revision=f4d849381caf20afa0da555c062d3b31f802471c source=fliplet-pr-review digest=sha256:40c49b60a8bd5384
Summary: Adds a "Security and identity" section, the V3 way to use Fliplet.Chat, and updates the method docs to match fliplet-api#8958.
Regression risk: Docs only, but the Studio builder catalog reads this page's frontmatter (description, notes).
Release order: fliplet-api#8958 first (live in production) → fliplet-cli#327 merged once the API is live → regenerate Studio's src/v3/ai/data/fliplet-apis.json from the live docs (npm run fetch-fliplet-apis) → fliplet-studio#9130. The three PRs don't block each other's review; this is only the order to ship them.
Findings: 1 Warning inline. Also, the page doesn't say that two rows with the same login value can't use chat: the API returns 400 for both (see the Warning on fliplet-api#8958, libs/chat-identity.js:326). Please add it to "Security and identity" once the API settles how it handles that.
CI: Green.
| The server says which column identifies chat users, and `connect()` always uses its answer: | ||
|
|
||
| * in a V2 app with a Chat component, the component's `primaryKey` (or none, if the component has none); | ||
| * in a V2 app with no Chat component, none, so the chat runs in legacy mode; |
There was a problem hiding this comment.
Warning: this no longer matches the API (fliplet-api#8958, commit 13625477d).
In a V2 app with no Chat component, the API now keeps a primaryKey passed to connect() when it is the contacts data source's login column and the user is signed in to it. This line, line 50 ("so leave it out") and line 54 ("V2 apps without a Chat component run in legacy mode") say the opposite. An app that follows the doc drops to legacy IDs and stops listing its existing conversations, which is what 13625477d fixed.
| * in a V2 app with no Chat component, none, so the chat runs in legacy mode; | |
| * in a V2 app with no Chat component, the `primaryKey` passed to `connect()` when it is the data source's login column and the user is signed in to that data source; otherwise none, so the chat runs in legacy mode; |
Lines 50 and 54 need the same change: keep "leave it out" for V3 apps and apps with a Chat component only.
There was a problem hiding this comment.
Verified against fliplet-api 13625477d (routes/v1/apps-chat.js getComponentlessSettings, test SHOULD keep a primary key given to connect() when it is the login column, for a signed-in user only) — correct. Fixed in a348622:
- Line 47: now says a V2 app with no Chat component uses the
primaryKeywhen it is the login column and the user is signed in, otherwise legacy mode (your suggested wording). - Line 50 ("leave it out"): scoped to V3 apps and apps with a Chat component; the V2 no-component case now says to pass the login column, and that any other value is ignored (falls back to legacy).
- Line 54 (V2 section): same correction.
Also added the deferred note to "Security and identity", since 13625477d settled it: a login value shared by two rows means neither row is a chat user (not a 400 any more), and a contact with no login value is left out of the contacts list.
…rimaryKey A V2 app with no Chat component is no longer always legacy mode: the API (fliplet-api 13625477d) keeps a primaryKey passed to connect() when it is the data source's login column and the user is signed in to it. Correct the three lines that said the opposite (identity list, "leave it out", V2 section), and add the shared/empty login-value rule to "Security and identity". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
JIRA Issue
https://weboo.atlassian.net/browse/DEV-2386
Summary
Documents the chat security and identity model, and the V3 way to use Fliplet.Chat, in
docs/API/fliplet-chat.md. This matches the fliplet-api change https://github.com/Fliplet/fliplet-api/pull/8958.Merge only after https://github.com/Fliplet/fliplet-api/pull/8958 is live in production. The page describes behaviour that API change adds.
## Security and identitysection, which covers:primaryKeypassed toconnect()is replaced by the server's value.Fliplet.Chat.connect({ dataSourceId }), thenawait chat.login({}), plus:connect()options,login(),logout(),contacts()andcreate(). Fixed the Vuechat.stream()example.descriptionandnotesnow describe the V3 path. The V3 builder catalog in Studio reads these fields.Testing
npm run check:docs(strict) passes. The regenerated.well-knownfiles are not committed, as in earlier doc PRs.Testing notes
connect({ dataSourceId })followed bychat.login({}).🤖 Generated with Claude Code