-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add option to provide custom user transformer #1103
Conversation
Signed-off-by: Iana Kotreleva <[email protected]>
Signed-off-by: Iana Kotreleva <[email protected]>
Fantastic thank you for this. It looks great. Would you mind adding to the groups as well? |
Yes, of course! I will add this for groups as well 👍 |
@kissmikijr Hey! I added functionality to the groups as well and also updated the documentation. Would be nice if you could take a look once you have time. Thanks! |
metadata: expect.objectContaining({ | ||
name: 'asdfwefwefwef', | ||
description: 'Everyone in the company', |
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.
Shouldn't we add the annotations to this as well?
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.
Sorry, I am not sure I understand. Do you mean to check annotations object in metadata? The untransformed group doesn't have any custom annotations that's why I didn't add any checks here. Only for the new profile.displayName
which isn't available in the default transformer
export type OktaGroupEntityTransformer = ( | ||
group: OktaGroup, | ||
namingStrategy: GroupNamingStrategy, | ||
parentGroup: OktaGroup | undefined, |
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 think we could make parentGroup optional so we dont need to write out the explicit undefined here
parentGroup: OktaGroup | undefined, | |
parentGroup?: OktaGroup, |
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.
Good catch! Done
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.
Thank you! Left some tiny tiny comments, otherwise it looks good!
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.
Thank you! Let's ship it!
This PR adds an option to provide a custom user transformer for okta users in user and org providers. It is a similar feature that LDAP has. If the transformer is provided it will be used instead of userEntityFromOktaUser.
In our use case, we want to fill some of the fields of the user entity which isn't possible to do now. For example,
profile.picture
ormetadata.description
.Something similar was discussed in this issue #900
If this approach is accepted, I can also do that for groups.
✔️ Checklist
yarn changeset
in the root)