Repository navigation
Add full User and Groups lists to Access page - #3211
Open
charliepark wants to merge 92 commits into
Open
charliepark wants to merge 92 commits into
charliepark wants to merge 92 commits into
Conversation
…nks to direct paths
…ilo, and group names
Contributor
Author
|
The CI test will fail until I merge this branch, but holding off until we're sure it's the right path, to reduce noise on Omicron. https://github.com/oxidecomputer/omicron/tree/routes-for-access-v2 |
Contributor
Author
|
Nexus updates are in oxidecomputer/omicron#11700 |
Contributor
Author
Contributor
Author
|
@claude review |
Contributor
Author
|
Prompted by the Claude review from yesterday, I also have some work in oxidecomputer/omicron#11713 looking at doing a better job cleaning up role rows when deleting users and groups. |
charliepark
added a commit
to oxidecomputer/oxide.ts
that referenced
this pull request
Nov 16, 2026
…ses (#394) Closes #386 Mock handlers for endpoints without a JSON success type had the return type `Promisable<StatusCode>`, but some of those endpoints need headers or a body in the response. Console's `supportBundleHead` handler returns an `HttpResponse` with `Content-Type` and `Content-Length`, and it needed a `@ts-expect-error` to do that. (See [here](https://github.com/oxidecomputer/console/blob/94b120278fb515269ab97a09b26020e98a862df0/mock-api/msw/handlers.ts#L2133-L2136).) The dispatcher already passes `Response` instances through at runtime, so accepting only the StatusCode (in the handlers where we needed the response) was too narrow. The generator now makes a distinction between two cases. Operations with a 204 success response keep `Promisable<StatusCode>`. Operations that respond with something other than JSON or a 204 (binary download, HEAD, redirect) get `Promisable<StatusOrResponse>`, where `StatusOrResponse` is a new alias for `StatusCode | Response` in the generated file. To support this, `Operation` now has a `successCode` field (the key of the success response in the spec, e.g. `"200"`, `"204"`, `"default"`), and the MSW generator checks `successCode === "204"`. `getOperations` now throws if an operation does not have exactly one non-error response; this replaces `getSuccessResponse`, which picked the first of 200, 201, 202 and 204 without a check. Every operation in the current Nexus spec has exactly one, so the generated client is unchanged. In the current Nexus spec, nine handlers get the new result type; others are unchanged. - `supportBundleHead`, `supportBundleHeadFile` - `supportBundleDownload`, `supportBundleDownloadFile`, `supportBundleIndex` - `deviceAuthRequest`, `deviceAccessToken` - `loginSaml`, `instanceSerialConsoleStream` When we merge this, (and update to the new version in console) we'll be able to remove the `@ts-expect-error` [here](https://github.com/oxidecomputer/console/blob/94b120278fb515269ab97a09b26020e98a862df0/mock-api/msw/handlers.ts#L2133-L2136). I checked this locally, as I'm working on an OMICRON_VERSION bump as a part of oxidecomputer/console#3211 and I hit an issue with new missing handlers that weren't getting caught by `npm run tsc` until I dug into this. To test: linked the local build of `openapi-gen-ts` (this code) into local console's `node_modules`, then ran `npm run gen-api` and `npm run tsc`. It caught the missing handlers and then `tsc` passed once I added them in. This also bumps the version to 0.17.0, as the generated handler types change.
david-crespo
pushed a commit
to oxidecomputer/omicron
that referenced
this pull request
Nov 17, 2026
…ed (#11713) In working on a console PR (oxidecomputer/console#3211) I discovered that #8605 was still open. (#9276 handled deletion of role assignments for SCIM-managed users / groups, but not for local ones). This PR adds a method that handles the deletion of role assignments for locally-managed users and groups, and calls it when the user / group is deleted. It also deletes silo-scoped role assignments when a silo is deleted. Note: there is no method to delete groups locally, but deleting a silo without addressing the roles would leave some orphaned rows, so this code cleans up the roles during the silo deletion process. "But wait!", I hear you say, "what about the orphaned rows from users that have already been deleted from the silo? Isn't that what prompted #8605 in the first place?" Good question. That is outside the scope of this PR, but the robot suggests there's a migration from before that covers similar territory: `schema/crdb/cleanup-orphaned-subnet-pool-silo-links` (version 248): ```sql SET LOCAL disallow_full_table_scans = off; DELETE FROM omicron.public.subnet_pool_silo_link WHERE subnet_pool_id NOT IN ( SELECT id FROM omicron.public.subnet_pool WHERE time_deleted IS NULL ); ``` So that's something we can talk through separately. Unrelated, but I also came across some old uncalled code in `silo_group_delete`; this PR removes that method as well. #8605 will still be open after this merges. We will need to clean up the leftover rows, per the note above, to fully close that issue.
Contributor
Author
|
@claude review |
This branch was successfully deployed
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.

The screenshots at the top are the "before"; scroll down to "In Issue #2887" to see the screenshots of this PR's code.




Currently, the Silo Access and Project Access page don't show all users, except when you open up the "Add user or group" form and access the dropdown:
In issue #2887, @askfongjojo requested a view where all users and groups would be displayed. This PR does that, adding a tabbed interface to show Groups / Users, and, then, on those pages, shows all groups and users.
Here we see the Silo index page for Groups:

And the tab for Users on the Silo:

And the equivalent Project Access page for Groups:

The overview pages show the user or group's "effective role", which is more generally what someone wants to know — "What is it that this user can do within this project (including inherited silo roles, group-assigned roles, etc.)?" — rather than just "What role have they been assigned within this project?". So, in this case, we see that the operator can see the effective role on the overview page, or click through to see Hannah's suite of roles in the side modal.
(Here, we see Hannah's effective role, of


ADMIN…)(… but if we click in to the side modal, we can see that she also has a project role of
LIMITED_COLLABORATOR…)If the operator wants to see the specific policy for that project, the project and silo access pages also show the policy for that silo/project, via the "show policy" button in the top right (where we see Hannah's

LIMITED_COLLABORATORrole assignment):The operator can then click through to the user/group's page to see the side modal for that user/group, showing all roles. All role edits / removals happen on the specific user/group page (side modal), where the operator has the full context around that user/group.
When a user has just one admin role (whether directly assigned or via a group) and they then move to change their own permission level (or the group's permission level), they get a warning with a required action in order to remove that role:


This warning does not show up if the user has multiple admin roles.
Another restriction to note is that a silo-scoped role assignment can't be modified from the Project Access page:

One ongoing situation that I want to mention is that we don't have a way to order / filter the responses from the API, and the default ordering from the API is by User ID. Instead of having pagination with 50 users per page, we select all-ish users (1,000) and then sort them by name on the client. This deviates from the vanilla API response, but gives a more useful listing of users. I checked with Will about whether that 1,000 user cap would be a problem, and he said that in the far future it might be something to address, but that there are no current customers where that limit would be problematic, based on how they configure users/silos.
Closes #2887
Closes #1146
Closes #1359