-
Notifications
You must be signed in to change notification settings - Fork 62
update Silo APIs for RFD 321 #1768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Meant to CC @smklein because of the Remote Access Preview procedure change. |
|
Heads up: I'm going to go ahead and rebase on top of "main" because the dependency on #1757 is very minimal and we may as well keep these separately. That's going to involve a force push to this branch so you may want to defer review until I've done that. |
527b660 to
a98dced
Compare
|
This is ready for review now. |
|
One thing I want to call out: per RFD 321, the A consequence of all this is that it's possible to store Silo configurations that aren't valid. The only time this will cause a problem is if someone tries to fetch a Silo with an invalid config (either by listing Silos or fetching it explicitly). In that case, the request will fail to convert the In an ideal world, I think |
This will break our test SAML config(s), yeah. But the URL can be updated as soon as this lands (or before in order to test?) |
jmpesp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
nexus/src/app/silo.rs
Outdated
| // If the user provision type is fixed, do not a new user if | ||
| // one does not exist. | ||
| db::model::UserProvisionType::Fixed => { | ||
| // If the user provision type is ApiOnly, do not a new user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look right - maybe it should be "do not create a new user"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 394c3be.
| #[endpoint { | ||
| method = POST, | ||
| path = "/login/{silo_name}/{provider_name}", | ||
| path = "/login/{silo_name}/saml/{provider_name}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the URL that will have to change in the Keycloak configuration, it's the path the IdP POSTs to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also maybe update the remote access docs to use a different name for the provider instead of saml, lest we end up with the repetitive /login/mercury/saml/saml 😅
|
|
||
| const SILO_NAME: &str = "saml-silo"; | ||
| create_silo(&client, SILO_NAME, true, shared::UserProvisionType::Fixed) | ||
| create_silo(&client, SILO_NAME, true, shared::SiloIdentityMode::LocalOnly) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be LocalOnly, right? one of the future planned changes is to reject configuring an identity provider if it doesn't match the identity mode, which means this test will be broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good call. I was separately trying to sneak in one more change that validates that and updates several of these tests accordingly. That's coming shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 394c3be.
| let nexus = &cptestctx.server.apictx.nexus; | ||
|
|
||
| let test_cases: Vec<TestSiloUserProvisionTypes> = vec![ | ||
| // A silo configured with a "fixed" user provision type should fetch a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment has to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 394c3be.
| pub enum SiloIdentityMode { | ||
| /// Users are authenticated with SAML using an external authentication | ||
| /// provider. The system updates information about users and groups only | ||
| /// during authentication (i.e,. "JIT provisioning" of users and groups). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The system updates information about users and groups only during authentication
Nit: only as a result of successful authentication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 394c3be.
|
I fixed the tests, but it was more complicated than expected. The "unauthorized" test implicitly relied on being able to create an IdP in the default Silo, which is no longer allowed. So I had it use a new Silo. But I had to give the privileged test user permissions on that Silo. Then we trip on the belt-and-suspenders check in the lookup macro that you're not accessing a resource from outside your Silo. I think the solution here is an allowlist (or config option, really) to allow certain resources to be accessible to users in other Silos. We've long known this would be needed for a few resources like identity providers. There's one remaining issue here, which is the hardcoded "allowlist" -- the XXX -- in the db lookup macro. |
|
There are two notable changes since this was last reviewed, both falling out of the "unauthorized.rs" test failure.
|
|
I didn't review in detail, but I'm standing by to update the console once this is merged. |
Crucible changes are: update to latest `vergen` (#1770) Update rand dependencies, and fallout from that. (#1764) [crucible-downstairs] migrate to API traits (#1768) [crucible-agent] migrate to API trait (#1766) [crucible-pantry] migrate to API trait (#1767) Add back job delays in the downstairs with the --lossy flag (#1761) Propolis changes are: Crucible update plus a few other dependency changes. (#948) [2/n] [propolis-server] switch to API trait (#946) [1/n] add a temporary indent to propolis server APIs (#945) Handle Intel CPUID leaves 4 and 18h, specialize CPUID for VM shape (#941) Increase viona receive queue length to 2048 (#935) Expand viona header pad to account for options (#937) fix linux p9fs multi message reads (#932) add a D script to report VMs' CPUID queries (#934) Update GH actions Re-enable viona packet data loaning
Crucible changes are: update to latest `vergen` (#1770) Update rand dependencies, and fallout from that. (#1764) [crucible-downstairs] migrate to API traits (#1768) [crucible-agent] migrate to API trait (#1766) [crucible-pantry] migrate to API trait (#1767) Add back job delays in the downstairs with the --lossy flag (#1761) Propolis changes are: Crucible update plus a few other dependency changes. (#948) [2/n] [propolis-server] switch to API trait (#946) [1/n] add a temporary indent to propolis server APIs (#945) Handle Intel CPUID leaves 4 and 18h, specialize CPUID for VM shape (#941) Increase viona receive queue length to 2048 (#935) Expand viona header pad to account for options (#937) fix linux p9fs multi message reads (#932) add a D script to report VMs' CPUID queries (#934) Update GH actions Re-enable viona packet data loaning --------- Co-authored-by: Alan Hanson <alan@oxide.computer> Co-authored-by: Sean Klein <sean@oxide.computer> Co-authored-by: Rain <rain@oxide.computer> Co-authored-by: John Gallagher <john@oxidecomputer.com> Co-authored-by: iliana etaoin <iliana@oxide.computer> Co-authored-by: Sean Klein <sean@oxidecomputer.com> Co-authored-by: Alex Plotnick <alex@oxidecomputer.com> Co-authored-by: David Pacheco <dap@oxidecomputer.com> Co-authored-by: Andrew J. Stone <andrew@oxidecomputer.com>
This makes a few changes based on the determinations of RFD 321 in preparation for support for password-based login. I hope there are no surprises here!
Changes here:
/system/silos/:silo_name/saml-identity-providersto/system/silos/:silo_name/identity-providers/saml/login/:silo_name/:provider_nameto/login/:silo_name/saml/:provider_nameuser_provision_type/UserProvisionTypehas turned intosilo_identity_mode/SiloIdentityMode, which encapsulates both the authentication mode and the user provision type.This also renames
UserProvisionType::FixedtoUserProvisionType::ApiOnlyfor clarity.This does not implement the "local" identity provider tyep, CRUD for local users, or password login -- those will be in follow-up PRs.
This will be a breaking change to the API because of the change to
params::SiloCreate,views::Silo, and the change in route structure. CC @david-crespo @zephraph @karencfv.This will be a breaking change to the Remote Access Preview procedure (both Mercury and Pluto) for the same reason. (Those procedures use these APIs directly.) Further, if you have a Silo that's already set up with an identity provider (like saml.eng), I'm not sure if it will continue to work because the login URL that the IdP POSTs back to has changed. I'm not sure if this is recorded anywhere though. If this is a problem for anyone, I'm happy to dig in further.