-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat: SCIM list provider users #3379
Conversation
- add SCIM list users endpoint - add SCIM role
bd75fea
to
40c966e
Compare
@@ -64,7 +64,7 @@ func AssignIdentityToGroups(tx GormTxn, user *models.Identity, provider *models. | |||
} | |||
addIDs = append(addIDs, item) | |||
} | |||
if rows.Err() != nil { | |||
if err := rows.Err(); err != nil { |
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 like this would have returned nil previously, which doesnt seem intentional.
|
||
if p != nil { | ||
// apply scim parameters | ||
if p.Count != 0 { |
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.
These are similar to our pagination, but slightly more complicated. Our pagination only allows set page sizes, but SCIM requires a "start index" which offsets the results.
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! Mostly questions, some of which I suspect will be answered when the create/update endpoints are added.
@@ -105,7 +105,7 @@ func AssignIdentityToGroups(tx GormTxn, user *models.Identity, provider *models. | |||
} | |||
ids = append(ids, item) | |||
} | |||
if rows.Err() != nil { | |||
if err := rows.Err(); err != nil { |
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.
Thanks for fixing these!
ADD COLUMN IF NOT EXISTS given_name text, | ||
ADD COLUMN IF NOT EXISTS family_name text, | ||
ADD COLUMN IF NOT EXISTS active boolean DEFAULT true; |
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.
These aren't being used yet, but I guess the next PR will include an update endpoint where these will be set, is that right?
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, control of these will be set through the SCIM create user endpoint, I'll make some updates to the just-in-time logic too. These are required fields for the SCIM spec.
err := CreateProvider(tx, provider) | ||
assert.NilError(t, err) | ||
|
||
pu := createTestProviderUser(t, tx, provider, "david@example.com") |
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.
Not a blocker, but I've been trying to include a few records that I expect not to match the query in most of the tests for List
operations. Something like same email different provider.
- add SCIM list users endpoint - add SCIM role
Summary
This change adds the necessary logic for a SCIM identity provider to list the users it has associated with it.
It does not include the changes necessary to create an access key for an identity provider (which this functionality will rely on) so the code path can't be accessed yet.
Checklist
Related Issues
Part of #3378