Title: API: Users, Projects, and Workspaces middleware should support UUID and friendly names · Issue #380 · coder/coder · GitHub
Open Graph Title: API: Users, Projects, and Workspaces middleware should support UUID and friendly names · Issue #380 · coder/coder
X Title: API: Users, Projects, and Workspaces middleware should support UUID and friendly names · Issue #380 · coder/coder
Description: For all the top-level entities in v2 - users, organizations, projects, workspaces` - there are two modes of identification. There is a unique id (ie, 3590cc6d-92aa-478a-b6a8-62b1518cc599) and a friendly name that is enforced to be unique...
Open Graph Description: For all the top-level entities in v2 - users, organizations, projects, workspaces` - there are two modes of identification. There is a unique id (ie, 3590cc6d-92aa-478a-b6a8-62b1518cc599) and a fri...
X Description: For all the top-level entities in v2 - users, organizations, projects, workspaces` - there are two modes of identification. There is a unique id (ie, 3590cc6d-92aa-478a-b6a8-62b1518cc599) and a fri...
Opengraph URL: https://github.com/coder/coder/issues/380
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"API: Users, Projects, and Workspaces middleware should support UUID and friendly names","articleBody":"For all the top-level entities in v2 - `users`, `organizations`, `projects, `workspaces` - there are two modes of identification.\r\n\r\nThere is a unique id (ie, `3590cc6d-92aa-478a-b6a8-62b1518cc599`) and a friendly name that is enforced to be unique (ie, `my-project`).\r\n\r\nOur API routes currently only support the _friendly name_.\r\n\r\nSo for the above example, in the current world - assuming we're calling as a user with perms to read the org / project:\r\n- `GET` `/api/v2/projects/acme-corp/my-project` would succeed\r\n- `GET` `/api/v2/projects/acme-corp/3590cc6d-92aa-478a-b6a8-62b1518cc599` would fail\r\n\r\nThis is problematic - because in some cases, we _only_ have the unique id to work with.\r\n\r\nFor example, in the `GET` workspaces API:\r\n- `GET` `/api/v2/workspaces/me/my-workspace`\r\n\r\nThe following is returned:\r\n```json\r\n{\"id\":\"3590cc6d-92aa-478a-b6a8-62b1518cc599\",\"created_at\":\"2022-02-28T18:33:24.724734181Z\",\"updated_at\":\"2022-02-28T18:33:24.724734291Z\",\"owner_id\":\"4aeaa38d-d119-47f8-9008-3858e145a076\",\"project_id\":\"0b0fa178-ab74-41c7-81e3-583a9bc08610\",\"name\":\"my-workspace\"}\r\n```\r\n\r\nTo make use of this data - and to read information about the project or organization of the workspace, __the apis need to also support referencing by unique id__.\r\n\r\nThe work required is:\r\n- Update [ExtractUserParam](https://github.com/coder/coder/blob/58f3e439dd8547fe237398f5ec8567d88913cd16/httpmw/userparam.go#L26) to support referencing by friendly-name OR unique ID\r\n- Update [ExtractProjectParam](https://github.com/coder/coder/blob/58f3e439dd8547fe237398f5ec8567d88913cd16/httpmw/projectparam.go#L27) to support referencing by friendly-name OR unique ID\r\n- Update [ExtractUserParam](https://github.com/coder/coder/blob/58f3e439dd8547fe237398f5ec8567d88913cd16/httpmw/userparam.go) to support referencing by friendly-name OR unique ID\r\n- Add relevant test cases","author":{"url":"https://github.com/bryphe-coder","@type":"Person","name":"bryphe-coder"},"datePublished":"2022-02-28T18:46:55Z","url":"https://github.com/coder/coder/issues/380"}
| 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:7cfb4430-b4f6-96b0-e162-5a8f8aa2eac5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 913A:E9D16:142B8F3:19871C6:6B01627A |
| html-safe-nonce | cd4c6d01490b1ee2da297e66c14c7f4312547702f3686aaf19f557635b8909fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTNBOkU5RDE2OjE0MkI4RjM6MTk4NzFDNjo2QjAxNjI3QSIsInZpc2l0b3JfaWQiOiI3ODE5OTU4NzcyODAxMDM2OTIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 59a39eb8fab8b0c8f56c8e600850c5a82ce0db56f325f0fe1240176a74ec93ee |
| hovercard-subject-tag | issue:1154430411 |
| 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/380/issue_layout |
| twitter:image | https://opengraph.githubassets.com/36c4bffb0ae381a5ad5fe3a8e64cb199b9febf2d14f7c7221140ffe5aaf43dbe/coder/coder/issues/380 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/36c4bffb0ae381a5ad5fe3a8e64cb199b9febf2d14f7c7221140ffe5aaf43dbe/coder/coder/issues/380 |
| og:image:alt | For all the top-level entities in v2 - users, organizations, projects, workspaces` - there are two modes of identification. There is a unique id (ie, 3590cc6d-92aa-478a-b6a8-62b1518cc599) and a fri... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bryphe-coder |
| 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