CI: Bump golangci-lint to 2.0.2 (#103572)
This commit is contained in:
committed by
GitHub
parent
b58b6e828e
commit
757be6365a
@@ -268,7 +268,7 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
|
||||
|
||||
t.Run("plugin route with admin role and user is admin", func(t *testing.T) {
|
||||
ctx, _ := setUp()
|
||||
ctx.SignedInUser.OrgRole = org.RoleAdmin
|
||||
ctx.OrgRole = org.RoleAdmin
|
||||
proxy, err := setupDSProxyTest(t, ctx, ds, routes, "api/admin")
|
||||
require.NoError(t, err)
|
||||
err = proxy.validateRequest()
|
||||
@@ -278,9 +278,9 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
|
||||
|
||||
t.Run("plugin route with RBAC protection user is allowed", func(t *testing.T) {
|
||||
ctx, _ := setUp()
|
||||
ctx.SignedInUser.OrgID = int64(1)
|
||||
ctx.SignedInUser.OrgRole = identity.RoleNone
|
||||
ctx.SignedInUser.Permissions = map[int64]map[string][]string{1: {"test-app.settings:read": nil}}
|
||||
ctx.OrgID = int64(1)
|
||||
ctx.OrgRole = identity.RoleNone
|
||||
ctx.Permissions = map[int64]map[string][]string{1: {"test-app.settings:read": nil}}
|
||||
proxy, err := setupDSProxyTest(t, ctx, ds, routes, "api/rbac-restricted")
|
||||
require.NoError(t, err)
|
||||
err = proxy.validateRequest()
|
||||
@@ -289,9 +289,9 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
|
||||
|
||||
t.Run("plugin route with RBAC protection user is not allowed", func(t *testing.T) {
|
||||
ctx, _ := setUp()
|
||||
ctx.SignedInUser.OrgID = int64(1)
|
||||
ctx.SignedInUser.OrgRole = identity.RoleNone
|
||||
ctx.SignedInUser.Permissions = map[int64]map[string][]string{1: {"test-app:read": nil}}
|
||||
ctx.OrgID = int64(1)
|
||||
ctx.OrgRole = identity.RoleNone
|
||||
ctx.Permissions = map[int64]map[string][]string{1: {"test-app:read": nil}}
|
||||
proxy, err := setupDSProxyTest(t, ctx, ds, routes, "api/rbac-restricted")
|
||||
require.NoError(t, err)
|
||||
err = proxy.validateRequest()
|
||||
@@ -300,9 +300,9 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
|
||||
|
||||
t.Run("plugin route with dynamic RBAC protection user is allowed", func(t *testing.T) {
|
||||
ctx, _ := setUp()
|
||||
ctx.SignedInUser.OrgID = int64(1)
|
||||
ctx.SignedInUser.OrgRole = identity.RoleNone
|
||||
ctx.SignedInUser.Permissions = map[int64]map[string][]string{1: {"datasources:read": {"datasources:uid:dsUID"}}}
|
||||
ctx.OrgID = int64(1)
|
||||
ctx.OrgRole = identity.RoleNone
|
||||
ctx.Permissions = map[int64]map[string][]string{1: {"datasources:read": {"datasources:uid:dsUID"}}}
|
||||
proxy, err := setupDSProxyTest(t, ctx, ds, routes, "api/rbac-home")
|
||||
require.NoError(t, err)
|
||||
err = proxy.validateRequest()
|
||||
@@ -311,10 +311,10 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
|
||||
|
||||
t.Run("plugin route with dynamic RBAC protection user is not allowed", func(t *testing.T) {
|
||||
ctx, _ := setUp()
|
||||
ctx.SignedInUser.OrgID = int64(1)
|
||||
ctx.SignedInUser.OrgRole = identity.RoleNone
|
||||
ctx.OrgID = int64(1)
|
||||
ctx.OrgRole = identity.RoleNone
|
||||
// Has access but to another app
|
||||
ctx.SignedInUser.Permissions = map[int64]map[string][]string{1: {"datasources:read": {"datasources:uid:notTheDsUID"}}}
|
||||
ctx.Permissions = map[int64]map[string][]string{1: {"datasources:read": {"datasources:uid:notTheDsUID"}}}
|
||||
proxy, err := setupDSProxyTest(t, ctx, ds, routes, "api/rbac-home")
|
||||
require.NoError(t, err)
|
||||
err = proxy.validateRequest()
|
||||
|
||||
Reference in New Issue
Block a user