Repository navigation
Workspaces phase 2a: the request's workspace, projects scoped (#277) - #316
Merged
Merged
Conversation
The request context resolves the workspace a dashboard request works in: the one named by X-MATE-Workspace, else workspace 1 for a platform administrator, else the caller's first membership. A workspace that doesn't exist, is deleted, or that the caller isn't a member of is a 404. ctx.is_admin stays the platform administrator until every route is scoped (phase 2e), so a workspace's own admin can't reach a route that doesn't filter yet. Projects are the first group scoped: the list holds the current workspace's, a new one lands in it, and another workspace's project is a 404 on update and delete. Project create, update and delete are audited; the delete passes the workspace, as the project is gone. shared/test/test_cross_workspace.py runs the real app over two workspaces. Every /dashboard/api GET route is called from workspace A and must not show B's data; every route that names a row is called with B's ids and must answer 404. Routes still to do are in NOT_YET_SCOPED, which the rest of phase 2 empties. The 2.0 plan records the membership decision for users the platform creates (end users through /run_sse, A2A and Slack users join the workspace of the agent or integration) and the five PRs of phase 2.
This was referenced Nov 1, 2026
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.
First of the five PRs of phase 2 (
documents/design/2.0-plan.md, Phase 2).What changes
RequestContextgainsworkspace_id,workspace_roleandis_platform_admin. The workspace is the one named byX-MATE-Workspace, else workspace 1 for a platform administrator, else the caller's first membership. A missing, deleted or foreign workspace is a 404.ctx.is_adminis unchanged (platform administrator only) until phase 2e. A workspace's own admin gets the dashboard API only once every route filters.project.create,project.update,project.delete). The delete passesworkspace_id, since the project is gone (audit_service.log(..., workspace_id=...)).shared/test/test_cross_workspace.pyruns the real app over two workspaces:/dashboard/apiGET route is called from A, and none may show B's data;COVERED_BY_TEST.NOT_YET_SCOPEDlists the routes phase 2 still has to scope, andPLATFORM_ONLYthe installation-wide ones. A new route is checked the day it is added.Behaviour on a 1.x installation
None. Nothing creates a second workspace yet, so every request resolves to workspace 1, which holds every project.
test_client_contract.pypasses unchanged.Checked
test_cross_workspace.pyfail.X-MATE-Workspace: 2answers 404;Docs
docs/dev/auth-and-access.md: new section "The workspace of a request", and the route table.docs/dev/database-and-migrations.md: project delete keeps its workspace, and phase 2 reads the schema.CLAUDE.md: dashboard routes filter byctx.workspace_id.docs/reference/api.md: regenerated.dashboard_server.pyas a whole (agents, alerts, templates, triggers, eval, EU AI Act, template format, trigger engine). Their code is unchanged here, so they still hold.docs/user/usage-and-audit.mdalready says projects are audited, which is now true.