Repository navigation
feat(auth): a Demo role and demo mode for a published demo - #554
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/testing/TEST_IDS.md
…setup read From the simplify and review pass: - A demo login made owner of a workspace kept that role in every service that reads it (the pending invites list, scripts, the settings dialog): cappedRole now caps a member at its own account too (memberRoleCeiling), and a demo account does not run its own workspace's members. - /auth/verify/send refuses a demo account: any visitor could mail its address. A demo account may switch workspaces (POST /workspaces/:id/select). - The guard refuses a demo write before the workspace reads it does not need. - Demo mode comes with GET /auth/setup, read once at startup, instead of its own endpoint and cache; the admin's save updates this tab at once. - VIEWER builds on DEMO; DEMO_HINT_MAX is shared; e2e uses helpers/accounts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 8733cf30-1585-4c84-b052-6f510c31468f) |
Test IDsAdded (6)
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c42ed250-126c-48bc-a5b6-a68993e766eb) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 06d218d2-1651-4876-9fe1-02ffbb4bfdae) |
What this adds
A public demo needs one shared login that anyone can use, safely.
demo-account.test.ts.docs/DEPLOYMENT.md→ Publishing a demo. It recommends pointing demo connections at read-only database accounts.Review pass (2026-10-25)
Four reviewers covered reuse, simplification, efficiency and altitude. Fixes:
cappedRole/memberRoleCeiling)./auth/verify/sendis refused for demo.GET /auth/setup.VIEWERnow builds onDEMO.DEMO_HINT_MAXis shared. The e2e spec useshelpers/accounts.Tests
demo-account.test.tsruns against a live server. It covers every guarded write as demo, the owner-workspace cap, invites, scripts, verify/send, workspace switching, sign-out-others, forgot-password, and demo mode. Each new check fails without its fix and passes with it.demo-rolepasses 3/3;workspacesandworkspaces-sharing-limitspass 10/10 against this branch.eslint .and the security lint are clean. 968 related unit tests pass.Not in this PR (on the board)
The reviewers suggested making read-only a permission declared on each route, instead of a URL allow-list plus a role check. That is a bigger RBAC change, and the allow-list is guarded by a test over the real route table.
🤖 Generated with Claude Code
Note
Medium Risk
Changes authentication guards, RBAC, and workspace role resolution for a shared public login; impact is broad but covered by integration and e2e tests.
Overview
Adds a published demo story: a new
demoapp role for a shared read-only login, plus demo mode so admins can show a global banner and a public sign-in hint.Server: Demo accounts are limited by an allow-listed write guard (
demo-access) before workspace resolution; workspace effective role is capped to viewer; password reset, verify-email, and sign-out-others are blocked. Demo mode is stored in app settings, exposed onGET /auth/setupandPUT /admin/sign-in/demo.Web:
DemoBannerand sign-in hint UI; admin Sign-in panel to toggle demo mode and save the hint; demo users no longer see “Sign out other sessions”. SQL runs skip App Secrets resolution when the user lackssecrets.view(fixes spurious warnings for demo/viewer).Tests & docs: Live-server
demo-account.test.ts, new e2edemo-rolesuite, unit tests for banner/auth/admin;DEPLOYMENT.mdsection on publishing a demo.Reviewed by Cursor Bugbot for commit f75b790. Bugbot is set up for automated code reviews on this repo. Configure here.