Title: Scoped tokens can't read or activate dormant workspaces · Issue #32192 · coder/coder · GitHub
Open Graph Title: Scoped tokens can't read or activate dormant workspaces · Issue #32192 · coder/coder
X Title: Scoped tokens can't read or activate dormant workspaces · Issue #32192 · coder/coder
Description: Found while checking the VS Code extension's OAuth scopes against v2.38.0 (coder/vscode-coder#1168). A dormant workspace's RBAC object is workspace_dormant (Workspace.RBACObject in coderd/database/modelmethods.go), but no scope a token c...
Open Graph Description: Found while checking the VS Code extension's OAuth scopes against v2.38.0 (coder/vscode-coder#1168). A dormant workspace's RBAC object is workspace_dormant (Workspace.RBACObject in coderd/database/...
X Description: Found while checking the VS Code extension's OAuth scopes against v2.38.0 (coder/vscode-coder#1168). A dormant workspace's RBAC object is workspace_dormant (Workspace.RBACObject in coderd/d...
Opengraph URL: https://github.com/coder/coder/issues/32192
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Scoped tokens can't read or activate dormant workspaces","articleBody":"Found while checking the VS Code extension's OAuth scopes against v2.38.0 (coder/vscode-coder#1168).\n\nA dormant workspace's RBAC object is `workspace_dormant` (`Workspace.RBACObject` in `coderd/database/modelmethods.go`), but no scope a token can request covers that type:\n\n- The `coder:workspaces.*` composites grant only `workspace` (`compositePerms` in `coderd/rbac/scopes.go`).\n- `workspace_dormant:*` is internal. Requesting it fails with `API key scope \"workspace_dormant:update\" is internal and cannot be requested by a token`.\n\nSo once a workspace is dormant, its owner's scoped token gets 404 for both `GET /api/v2/workspaces/{id}` and `PUT /api/v2/workspaces/{id}/dormant`. Only `coder:all` works. The same user's password session activates the workspace (200), so OAuth clients can't do what the dashboard does.\n\n**Repro**\n\n1. As an admin, mark a member's workspace dormant: `PUT /api/v2/workspaces/{id}/dormant` with `{\"dormant\": true}`.\n2. As the member, create a token with `coder:workspaces.operate coder:workspaces.access workspace:create workspace:update user:read`.\n3. With that token, call `GET /api/v2/workspaces/{id}` and `PUT /api/v2/workspaces/{id}/dormant` with `{\"dormant\": false}`. Both return 404.\n\n**Suggested fix**\n\nGrant the dormant type next to the workspace type in `coder:workspaces.operate`, which already grants `read` and `update` on workspaces:\n\n```go\n\"coder:workspaces.operate\": {\n\tResourceTemplate.Type: {policy.ActionRead},\n\tResourceWorkspace.Type: {policy.ActionWorkspaceStop, policy.ActionWorkspaceStart, policy.ActionRead, policy.ActionUpdate},\n\tResourceWorkspaceDormant.Type: {policy.ActionRead, policy.ActionUpdate},\n\tResourceOrganizationMember.Type: {policy.ActionRead},\n},\n```\n\nAlternatively, add `workspace_dormant:read` and `workspace_dormant:update` to `externalLowLevel` in `coderd/rbac/scopes_catalog.go`.\n","author":{"url":"https://github.com/EhabY","@type":"Person","name":"EhabY"},"datePublished":"2026-11-13T18:48:58Z","url":"https://github.com/coder/coder/issues/32192"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1c03b2c7-f833-0795-36bd-8be9653f7e69 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A626:14ECB:B6F115:E9F546:6B00F969 |
| html-safe-nonce | 8c8c2a50e7c4265642def36626b2b7b25adb1f614a15834079ff64ab3a799c06 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjI2OjE0RUNCOkI2RjExNTpFOUY1NDY6NkIwMEY5NjkiLCJ2aXNpdG9yX2lkIjoiNTkzNjM4MDg1MDU5MjYxMDY2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8ab5f4310c4bf515c61e6e832b22bea15fbbb2d025c5b1b8515320a286c81928 |
| hovercard-subject-tag | issue:6377851355 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/32192/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7b44f0dd7a841fbf3aedaf8e9fe37a1d945d3e34a41fdada315bb6767da4f1a0/coder/coder/issues/32192 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7b44f0dd7a841fbf3aedaf8e9fe37a1d945d3e34a41fdada315bb6767da4f1a0/coder/coder/issues/32192 |
| og:image:alt | Found while checking the VS Code extension's OAuth scopes against v2.38.0 (coder/vscode-coder#1168). A dormant workspace's RBAC object is workspace_dormant (Workspace.RBACObject in coderd/database/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EhabY |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width