oxidecomputer / oxidecomputer/omicron
Make role names an enum in the DB
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Followup to #7477, especially https://github.com/oxidecomputer/omicron/pull/7477#discussion_r1942129596.
Role names are currently represented as free-form strings, but as far as I know the only actual values are admin, collaborator, viewer, or external-authenticator. This was originally expected to be a more flexible system, but we've managed to get a lot out of this basic set of roles. After the cleanup in #7477 made clear we are not using a dynamic list of roles, we have an opportunity to simplify things even further by locking down the set of roles to a Rust enum backed by a Rust enum.
External API structs
Missing external-authenticator because it is never exposed externally.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading schema/crdb/dbinit.sql, nexus/db-model/src/role_assignment.rs, and the cited external API structs to trace how role names are represented. Follow existing role references and verify that the database and Rust representations use the four listed values while external API types continue to omit external-authenticator.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- backend-api-design, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100