Title: Database Migrations: scopes array + typed allow-list · Issue #19845 · coder/coder · GitHub
Open Graph Title: Database Migrations: scopes array + typed allow-list · Issue #19845 · coder/coder
X Title: Database Migrations: scopes array + typed allow-list · Issue #19845 · coder/coder
Description: Description Migrate API keys from a single scope column to scopes api_key_scope[] and add allow_list text[] supporting entries like workspace:
Open Graph Description: Description Migrate API keys from a single scope column to scopes api_key_scope[] and add allow_list text[] supporting entries like workspace:
X Description: Description Migrate API keys from a single scope column to scopes api_key_scope[] and add allow_list text[] supporting entries like workspace:<uuid>, template:*, or *:*. Default/backfill exis...
Opengraph URL: https://github.com/coder/coder/issues/19845
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Database Migrations: scopes array + typed allow-list","articleBody":"Description\n\n- Migrate API keys from a single `scope` column to `scopes api_key_scope[]` and add `allow_list text[]` supporting entries like `workspace:\u003cuuid>`, `template:*`, or `*:*`.\n- Default/backfill existing rows to `scopes=['all']` and `allow_list=['*:*']` to maintain backward compatibility.\n- Extend the existing `api_key_scope` enum with the new low-level scope names introduced in this RFC (e.g., `workspace:read`, `template:read`, `api_key:create`, etc.).\n\nKey files/areas\n\n- SQL migrations in `coderd/database/migrations/` (both up/down).\n- Generated models in `coderd/database/models.go` (via `make gen`).\n- Reference low-level scope names from `coderd/rbac/policy/policy.go` (`RBACPermissions`) when updating `api_key_scope` enum values.\n\nAcceptance criteria\n\n- Running `make gen` succeeds; compiled models expose `[]APIKeyScope` (or `[]string`) and `[]string allow_list`.\n- Existing installations upgrade without breaking token usage; no data loss.\n- Add a down migration returning to the old schema.\n- Enum updated with new low-level scope values when enum array is selected; down migration accounts for removed enum variants if needed.\n- `api_key_scope` enum includes all known `\u003cresource>:\u003caction>` from `policy.RBACPermissions` (public and internal). The public catalog exposed to users is a filtered subset defined in the low‑level catalog task; document how to update the enum when RBAC evolves.\n","author":{"url":"https://github.com/ThomasK33","@type":"Person","name":"ThomasK33"},"datePublished":"2025-09-17T13:49:50Z","url":"https://github.com/coder/coder/issues/19845"}
| 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:ecfc019f-d7dc-fd6d-2658-fb1075f3be61 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6D6:B53AF:1C71948:25CCD6D:6B0163DC |
| html-safe-nonce | 242cda45de091afcb4cab7f0c0f584d149fc95e21e3c2d30421cf051be392d29 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkQ2OkI1M0FGOjFDNzE5NDg6MjVDQ0Q2RDo2QjAxNjNEQyIsInZpc2l0b3JfaWQiOiIyODEwNjMxOTQyMjE0Mzc5MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7c2785984ce63c21d6aeb6ad118743c6a9f9cdff59dd9375dcac6ed7a4ee671a |
| hovercard-subject-tag | issue:3426405029 |
| 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/19845/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94e81db52a8706f314b0ca17c2e0e46a445d0a69e160ca6c36952a4f37d037a6/coder/coder/issues/19845 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94e81db52a8706f314b0ca17c2e0e46a445d0a69e160ca6c36952a4f37d037a6/coder/coder/issues/19845 |
| og:image:alt | Description Migrate API keys from a single scope column to scopes api_key_scope[] and add allow_list text[] supporting entries like workspace: |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ThomasK33 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width