mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: remove rbac psuedo resources, add custom verbs (#13276)
Removes our pseudo rbac resources like `WorkspaceApplicationConnect` in favor of additional verbs like `ssh`. This is to make more intuitive permissions for building custom roles. The source of truth is now `policy.go`
This commit is contained in:
@@ -160,7 +160,7 @@ func BenchmarkRBACAuthorize(b *testing.B) {
|
||||
|
||||
// There is no caching that occurs because a fresh context is used for each
|
||||
// call. And the context needs 'WithCacheCtx' to work.
|
||||
authorizer := rbac.NewCachingAuthorizer(prometheus.NewRegistry())
|
||||
authorizer := rbac.NewStrictCachingAuthorizer(prometheus.NewRegistry())
|
||||
// This benchmarks all the simple cases using just user permissions. Groups
|
||||
// are added as noise, but do not do anything.
|
||||
for _, c := range benchCases {
|
||||
@@ -187,7 +187,7 @@ func BenchmarkRBACAuthorizeGroups(b *testing.B) {
|
||||
uuid.MustParse("0632b012-49e0-4d70-a5b3-f4398f1dcd52"),
|
||||
uuid.MustParse("70dbaa7a-ea9c-4f68-a781-97b08af8461d"),
|
||||
)
|
||||
authorizer := rbac.NewCachingAuthorizer(prometheus.NewRegistry())
|
||||
authorizer := rbac.NewStrictCachingAuthorizer(prometheus.NewRegistry())
|
||||
|
||||
// Same benchmark cases, but this time groups will be used to match.
|
||||
// Some '*' permissions will still match, but using a fake action reduces
|
||||
@@ -239,7 +239,7 @@ func BenchmarkRBACFilter(b *testing.B) {
|
||||
uuid.MustParse("70dbaa7a-ea9c-4f68-a781-97b08af8461d"),
|
||||
)
|
||||
|
||||
authorizer := rbac.NewCachingAuthorizer(prometheus.NewRegistry())
|
||||
authorizer := rbac.NewStrictCachingAuthorizer(prometheus.NewRegistry())
|
||||
|
||||
for _, c := range benchCases {
|
||||
b.Run("PrepareOnly-"+c.Name, func(b *testing.B) {
|
||||
|
||||
Reference in New Issue
Block a user