-
Notifications
You must be signed in to change notification settings - Fork 985
feat: Implement list roles & enforce authorize examples #1273
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
30e2031
feat: First draft of adding authorize to an http endpoint
Emyrk 2161f84
WIP: Using middleware to change auth object params
Emyrk 54bc054
feat: Implement basic authorize and unit test
Emyrk d083a7c
Some cleanup
Emyrk 95b9a14
Merge remote-tracking branch 'origin/main' into stevenmasley/list_roles
Emyrk 1498dcd
Expand 'orgs' to 'organizations' in func namings
Emyrk f36ae37
Renamings
Emyrk b831260
Use rbac.object directly
Emyrk db04d67
Fix broken tests
Emyrk b76f373
Add some comments
Emyrk 117f838
Linting
Emyrk 42b42ab
Handle out of order lists
Emyrk 0efe72c
Add unit test
Emyrk dba617d
Add unit test for mw
Emyrk 190940f
parallel unit test
Emyrk c86c67c
style order
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some cleanup
- Loading branch information
commit d083a7c87ecf363c009f61ec2674dff192cf28f9
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
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.
Authorizefeels like action, not something that would return a handler.What do you think about renaming this to
EnforceRBAC?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
EnforceRBACis also weak though. I was thinking the packagehttpmwprovides enough context, and it does do the actionAuthorize().Authorizeis the correct word for what is happening, as it's not authentication. I feelEnforceRBACdoesn't indicate theobjectandactionare included.Another word that comes to mind is "Access". Idk,
EnforceAccess,EnforcePermissions. MaybeEnforceRBACisn't that bad, just felt odd to me at 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.
Fair enough. I'm primarily trying to display that the
RBACpackage is being leveraged when calling this handle.Enforceis a bit sketchy too.While it is authorizing, I'm nervous that this will get conflated with authentication really easily.
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.
yea this is classic authorization vs authentication. If you aren't familiar with it, it's easy to mix up.
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.
Agreed agreed