-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
api, pkg: refactor guard package #1834
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aac562a
to
4099ca2
Compare
a4b6f77
to
9343fbf
Compare
otavio
requested changes
Apr 19, 2022
9343fbf
to
5d52b73
Compare
henrybarreto
commented
Apr 19, 2022
5d52b73
to
5ceb0e1
Compare
guard and authorizer were splitting the same responsibility, help ShellHub to control the roles. In a package, authorizer, were all role, actions and permissions, and another, guard, were all logic to validate if a role has permission to execute an action, what obligated the programmer change at two district places when he/she wants to add a permission, action or role. The old authorizer package was not remove, but marked as "deprecated", so we can remove its call at pieces. Some comments on guard were improved too, giving more precise description and code usage examples.
3dd93cb
to
1f0ecc8
Compare
otavio
requested changes
Apr 20, 2022
7d3f093
to
68bc68e
Compare
otavio
approved these changes
Apr 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/api
go
Pull requests that update Go code
kind/refactor
product/cloud
Issue/PR related to Cloud Edition
status/needs-review
status/require-tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
guard and authorizer were splitting the same responsibility, help ShellHub
to control the roles.
In a package, authorizer, were all role, actions and permissions, and another,
guard, were all logic to validate if a role has permission to execute an action,
what obligated the programmer change at two district places when he/she wants
to add a permission, action or role.
The old authorizer package was not remove, but marked as "deprecated", so we
can remove its call at pieces.
Some comments on guard were improved too, giving more precise description
and code usage examples.