-
Notifications
You must be signed in to change notification settings - Fork 128
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
Support for Service Authorizations #349
Conversation
cd50287
to
6b72cc6
Compare
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.
Hi @noseglid 👋🏻
Thank you for opening this PR. It's really appreciated.
For the sake of consistency with the rest of the code base I've requested some changes to help keep the code aligned.
When a user has the "engineer" level, specific access to specific services can be granted using service authorizations. This change adds support for creating, retrieving, updating and deleting service authorizations using the Go client.
We can use the string directly instead of creating new types for permissions and data types as we do not require any extra functionality on these types.
8053d3b
to
e172702
Compare
Using `jsonapi` saves us from constructing a lot of extra models because the API provided by fastly already follows the conventions outlined by `jsonapi`.
Anonymizes the IDs used for service authorizations as well as adds a new "default" id for user, which can be anonymized to a default User ID in the `fix-fixtures` target of the makefile.
e172702
to
c508116
Compare
Add Godocs to the exposed functions and structs used as inputs.
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 @noseglid this is looking a lot better. Just a few small comments. Thanks!
Only the serviceid needs to be default and normalized.
6eb50fb
to
d9bf2fa
Compare
Instead of re-using amibuous error messages, create and use a dedicated error when CreateServiceAuthorization is used incorrectly.
d9bf2fa
to
3b516a2
Compare
I have now addressed all your comments |
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.
Made two suggested edits (which I'll apply in a moment), but otherwise this looks good to me.
Thanks @noseglid 🙂
🙌 |
When a user has the "engineer" level, specific access to specific
services can be granted using service authorizations.
This change adds support for creating, retrieving, updating and deleting
service authorizations using the Go client.