Skip to content

Commit

Permalink
Merge branch 'main' into EVEREST-1547-upgrade-reload-everest-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
percona-robot authored Jan 23, 2025
2 parents 7c25a3e + 3fa07bb commit e5f6e71
Show file tree
Hide file tree
Showing 12 changed files with 387 additions and 124 deletions.
16 changes: 8 additions & 8 deletions internal/server/handlers/rbac/backup_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestRBAC_BackupStorage(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -228,7 +228,7 @@ func TestRBAC_BackupStorage(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -395,7 +395,7 @@ func TestRBAC_BackupStorage(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -563,7 +563,7 @@ func TestRBAC_BackupStorage(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -727,7 +727,7 @@ func TestRBAC_BackupStorage(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -768,10 +768,10 @@ func newConfigMapPolicy(policy string) *corev1.ConfigMap {
}
}

func testUserGetter(ctx context.Context) (string, error) {
user, ok := ctx.Value(common.UserCtxKey).(string)
func testUserGetter(ctx context.Context) (rbac.User, error) {
user, ok := ctx.Value(common.UserCtxKey).(rbac.User)
if !ok {
return "", errors.New("user not found in context")
return rbac.User{}, errors.New("user not found in context")
}
return user, nil
}
8 changes: 4 additions & 4 deletions internal/server/handlers/rbac/database_cluster_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestRBAC_DatabaseClusterBackup(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestRBAC_DatabaseClusterBackup(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestRBAC_DatabaseClusterBackup(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -355,7 +355,7 @@ func TestRBAC_DatabaseClusterBackup(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down
10 changes: 5 additions & 5 deletions internal/server/handlers/rbac/database_cluster_restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestRBAC_DatabaseClusterRestore(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestRBAC_DatabaseClusterRestore(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -248,7 +248,7 @@ func TestRBAC_DatabaseClusterRestore(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -359,7 +359,7 @@ func TestRBAC_DatabaseClusterRestore(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -430,7 +430,7 @@ func TestRBAC_DatabaseClusterRestore(t *testing.T) {
},
}

ctx := context.WithValue(context.Background(), common.UserCtxKey, "bob")
ctx := context.WithValue(context.Background(), common.UserCtxKey, rbac.User{Subject: "bob"})
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
Expand Down
Loading

0 comments on commit e5f6e71

Please sign in to comment.