-
Notifications
You must be signed in to change notification settings - Fork 894
feat: Dbauthz is now default, remove out of experimental #6650
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
32 commits
Select commit
Hold shift + click to select a range
ac597a5
feat: dbauthz always on, out of experimental
Emyrk 7118bf0
Add ability to do rbac checks in unit tests
Emyrk c555c57
Remove AuthorizeAllEndpoints
Emyrk c6210c4
Remove some duplicate rbac checks
Emyrk d48a5c3
Remove rest of duplicate rbac checks
Emyrk 7672f6e
Adding unit tests for rbac checks
Emyrk 263801b
Add method to unit test rbac
Emyrk 893198a
Add comment
Emyrk 6b2c3f9
Add comments
Emyrk 84ba18d
Add comment
Emyrk 38bec6d
Merge remote-tracking branch 'origin/main' into stevenmasley/dbauthz_on
Emyrk a5ff7fc
Make gen
Emyrk bb788a4
Make golden files
Emyrk c0f6ff0
linting
Emyrk 386a967
Merge remote-tracking branch 'origin/main' into stevenmasley/dbauthz_on
Emyrk f7842ee
linting
Emyrk b6130e3
linting
Emyrk 8b744ac
Merge lost a config section
Emyrk 55f01c5
Linting
Emyrk 4965c10
Make gen
Emyrk d038934
Make gen
Emyrk 55b1308
remove experiment enum
Emyrk f7923df
Make gen
Emyrk 549a34d
Linting
Emyrk 2ae9eac
Correct unit test
Emyrk faf0714
Merge remote-tracking branch 'origin/main' into stevenmasley/dbauthz_on
Emyrk 899cc69
Override a copy of the error
Emyrk 4fcc69e
have nicer status codes
Emyrk 4ab765f
Test be parallel
Emyrk 9b69f39
This test takes way too long
Emyrk 974d915
Paginated users was taking too long
Emyrk 0934326
Subtest context is shared :(
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
Adding unit tests for rbac checks
- Loading branch information
commit 7672f6e60dad72822c6e808e9009d79f35dc877d
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package codersdk | ||
|
||
import "github.com/coder/coder/coderd/rbac" | ||
|
||
// This mirrors modelmethods.go in /database. | ||
// For unit testing, it helps to have these convenience functions for asserting | ||
// rbac authorization calls. | ||
|
||
func (t Template) RBACObject(userACL, groupACL map[string][]rbac.Action) rbac.Object { | ||
return rbac.ResourceTemplate.WithID(t.ID). | ||
InOrg(t.OrganizationID). | ||
WithACLUserList(userACL). | ||
WithGroupACL(groupACL) | ||
} | ||
|
||
// RBACObjectNoTemplate is for orphaned template versions. | ||
func (v TemplateVersion) RBACObjectNoTemplate() rbac.Object { | ||
return rbac.ResourceTemplate.InOrg(v.OrganizationID) | ||
} |
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.
💪