oxidecomputer / oxidecomputer/omicron
Want DB constraints preventing bad combination of silo settings (e.g., local + saml)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
A low priority correctness improvement I noticed while reviewing something else.
In the silo create request body, the user can specify an identity mode — LocalOnly, SamlJit, or SamlScim — and that mode is then translated into two other properties corresponding to DB columns: authentication mode and user provision type. Because the identity mode can only be passed at silo create time and cannot be updated, this is more or less guaranteed to be correct because the only way that these database columns can be set is by being processed through the below code.
However, it would be an easy extra layer of safety to put in constraints in the DB that guarantee you can't accidentally mess up that code.
We do similar things elsewhere.
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 with the identity-mode mapping in nexus/types/src/external_api/shared.rs, then inspect the related table definitions in schema/crdb/dbinit.sql, including the nearby examples of existing constraints. Add database constraints that enforce the valid authentication-mode and user-provision-type combinations, and verify that schema initialization accepts the valid combinations while rejecting invalid ones.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100