-
Notifications
You must be signed in to change notification settings - Fork 24
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 permissions APIs and values #133
Conversation
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.
have a question about the check api
final request = ListAuthorizationsRequest() | ||
..organizationId = organizationId | ||
..resourceIds.addAll(resourceIds); |
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.
..
is neat a language feature
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.
Ya SUPER useful in not having to create temporary objects for assignment
return response.authorizedPermissions.first.permissions | ||
.map((e) => Permission.values.firstWhere((element) => element.value == e)) | ||
.toList(); |
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.
[q] (mainly because I'm unfamiliar with the shape of the API response) - why are we only considering the first authorized permission in the response? (response.authorizedPermissions.first
)
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 a great question! It's because the API actually takes in an array of of permissions to check, and then returns an array of validated permissions.
This method only allows for a single permission check, so we will only get (at most) a single permission response back
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
We need permissions in the SDK for proactive checks around auth