-
Notifications
You must be signed in to change notification settings - Fork 55
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 Roles field to OrganizationMember struct #293
Add Roles field to OrganizationMember struct #293
Conversation
Thanks for the PR @renxinhe! I had started adding this and hadn't got round to the PR yet. I don't want to close this though so you mind if I push some changes to your PR? It's just some minor changes around the struct (as description is missing) and documentation |
Hey not at all! You do whatever you need to; I'm just happy to help. Right now our code is hitting a lot of rate limit issue since we have to fetch all the users' roles one by one. Hope we can patch this one - luckily the Go struct annotation makes this change fairly simple. Thanks a lot! :) |
I augmented All tests still passing:
|
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 this @renxinhe!
We have some other changes that I'd like to release alongside this, but I'm hopeful this should be out mid to late next week.
🔧 Changes
Roles
field toOrganizationMember
such that fetching roles with organization API /get_members endpoint would also return the user roles when requested.📚 References
Issue: #291
🔬 Testing
Ran all the existing tests and all passing locally:
I also tested manually by calling
Member()
and observed that the newRoles
slice is indeed populated with the role name and IDs.Here is an example HTTP response from Auth0 management API. Note that the field is called
roles
, and Go'sjson:roles,omitempty
syntax is able to automatically unmarshall it.📝 Checklist