Repository navigation
feat(server)!: require session tokens by default, with allowAnonymous to opt out - #462
Merged
Merged
Conversation
This was referenced Oct 29, 2026
Merged
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.
F3 of the 1.0 freeze (F-04 task 15), as decided: session tokens are required by default, and
allowAnonymous: truereplacesrequireSession: false.sessionSecretssessionSecrets+allowAnonymous: truerequireSession: false)openssl rand -base64 32) orallowAnonymous: trueallowAnonymous: truealonerequireSessionallowAnonymousCode:
packages/server/src/config.tsandsecurity/sessions.ts:allowAnonymousreplacesrequireSession. The no-secrets case now throws unlessallowAnonymousis set.removed-options.tsnow also catchesrequireSession.packages/cli/src/test/run.ts:chatcops testpassesallowAnonymous: true, since it calls the handler in process and there's no widget to fetch tokens.e2e/server.mjs: the plain endpoint is anonymous, and/api/secure-chatkeeps requiring tokens.allowAnonymous: truenext to its optional secret, as it did withrequireSession: false.packages/server/src/examples/readCHATCOPS_SESSION_SECRET.Docs:
app.use.app.all('/chat')misses/chat/session, where the widget gets its token.sessionSecrets, and give the session path a route where one is needed.allowAnonymous: trueand says why:useChatdoesn't fetch tokens.allowAnonymous, and says the short snippets on other pages leave the secret out.conversationStore(removed in feat!: remove the APIs deprecated in 0.6 to 0.8, with an upgrade guide #441) is fixed.Tests: 80 handler configs in the server tests that had no session setup now set
allowAnonymous: true. Tests that do set up sessions are unchanged. New tests cover the startup error and its message,requiredfor each combination, andrequireSessionbeing refused. Build, typecheck, test:coverage, lint (dev baseline),api:check(requireSessionbecomesallowAnonymous), publint, docs:check (146 blocks), the website build and the full e2e suite (69, Chrome) pass. Docs bot index rebuilt: replay 9 of 9, citations 49 of 50 (98%).