Auth: use IdentityType from authlib (#91763)
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/authlib/claims"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
@@ -21,7 +21,7 @@ func TestPermissionCacheKey(t *testing.T) {
|
||||
signedInUser: &user.SignedInUser{
|
||||
OrgID: 1,
|
||||
UserID: 1,
|
||||
FallbackType: identity.TypeUser,
|
||||
FallbackType: claims.TypeUser,
|
||||
},
|
||||
expected: "rbac-permissions-1-user-1",
|
||||
},
|
||||
@@ -31,7 +31,7 @@ func TestPermissionCacheKey(t *testing.T) {
|
||||
OrgID: 1,
|
||||
ApiKeyID: 1,
|
||||
IsServiceAccount: false,
|
||||
FallbackType: identity.TypeUser,
|
||||
FallbackType: claims.TypeUser,
|
||||
},
|
||||
expected: "rbac-permissions-1-api-key-1",
|
||||
},
|
||||
@@ -41,7 +41,7 @@ func TestPermissionCacheKey(t *testing.T) {
|
||||
OrgID: 1,
|
||||
UserID: 1,
|
||||
IsServiceAccount: true,
|
||||
FallbackType: identity.TypeUser,
|
||||
FallbackType: claims.TypeUser,
|
||||
},
|
||||
expected: "rbac-permissions-1-service-account-1",
|
||||
},
|
||||
@@ -51,7 +51,7 @@ func TestPermissionCacheKey(t *testing.T) {
|
||||
OrgID: 1,
|
||||
UserID: -1,
|
||||
IsServiceAccount: true,
|
||||
FallbackType: identity.TypeUser, // NOTE, this is still a service account!
|
||||
FallbackType: claims.TypeUser, // NOTE, this is still a service account!
|
||||
},
|
||||
expected: "rbac-permissions-1-service-account--1",
|
||||
},
|
||||
@@ -60,7 +60,7 @@ func TestPermissionCacheKey(t *testing.T) {
|
||||
signedInUser: &user.SignedInUser{
|
||||
OrgID: 1,
|
||||
OrgRole: org.RoleNone,
|
||||
FallbackType: identity.TypeUser,
|
||||
FallbackType: claims.TypeUser,
|
||||
},
|
||||
expected: "rbac-permissions-1-user-None",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user