-
Notifications
You must be signed in to change notification settings - Fork 58
[SCIM 2/4]: Add SCIM user, group, and IDP #9162
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
[SCIM 2/4]: Add SCIM user, group, and IDP #9162
Conversation
Build on oxidecomputer#8981 and add the SCIM user provision type to users and groups. Users must have a user name, and optionally have an external id field and/or an active field. Groups must have a display name and optionally have an external id field. Also add a new SiloIdentityMode named SamlScim. A few functions have to change to account for these new variants, but not many. Silos using the SamlScim identity mode will use all the same SAML code that exists today.
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.
I picked a lot of very minor nits, but overall, this seems fine and I have no major concerns!
user_name TEXT, | ||
|
||
active BOOL, |
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.
since these are SCIM-specific columns, perhaps the name ought to be scim_user_name
and scim_active
to make that super-duper extra clear? it's a bit uglier but it might make the code a bit easier to follow when you're reading through it in a context outside of reviewing this PR...
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.
I'm hesitant to - in world where we support additional user types, there may be additional overlap in these fields, and they'll no longer be SCIM specific.
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.
hmm, i guess i wonder if it's correct for such fields with overlapping meanings to be represented by the same columns, but i suppose we're already doing that with external_id
a bit. 🤷♀️
"/login/{}/saml/some-totally-real-saml-provider", | ||
SILO_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.
tiny style nit: could be
"/login/{}/saml/some-totally-real-saml-provider", | |
SILO_NAME | |
"/login/{SILO_NAME}/saml/some-totally-real-saml-provider", |
although maybe that exceeds 80 characters, in which case 🤷♀️
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.
nope, still under 80! 86f0064
|
||
let _silo_saml_idp: views::SamlIdentityProvider = object_create( | ||
client, | ||
&format!("/v1/system/identity-providers/saml?silo={}", SILO_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.
style nit: could be
&format!("/v1/system/identity-providers/saml?silo={}", SILO_NAME), | |
&format!("/v1/system/identity-providers/saml?silo={SILO_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.
|
||
let silo_saml_idp: views::SamlIdentityProvider = object_create( | ||
client, | ||
&format!("/v1/system/identity-providers/saml?silo={}", SILO_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.
tiny style nit: could be
&format!("/v1/system/identity-providers/saml?silo={}", SILO_NAME), | |
&format!("/v1/system/identity-providers/saml?silo={SILO_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.
.await; | ||
let silo: Silo = NexusRequest::object_get( | ||
&client, | ||
&format!("/v1/system/silos/{}", SILO_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.
tiny style nit: could be
&format!("/v1/system/silos/{}", SILO_NAME), | |
&format!("/v1/system/silos/{SILO_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.
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.
looks good to me!
Build on #8981 and add the SCIM user provision type to users and groups. Users must have a user name, and optionally have an external id field and/or an active field. Groups must have a display name and optionally have an external id field.
Also add a new SiloIdentityMode named SamlScim.
A few functions have to change to account for these new variants, but not many. Silos using the SamlScim identity mode will use all the same SAML code that exists today.