Auth: use IdentityType from authlib (#91763)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/grafana/authlib/claims"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
)
|
||||
|
||||
@@ -26,7 +27,7 @@ func WithRequester(handler http.Handler) http.Handler {
|
||||
if ok {
|
||||
if info.GetName() == user.Anonymous {
|
||||
requester = &identity.StaticRequester{
|
||||
Type: identity.TypeAnonymous,
|
||||
Type: claims.TypeAnonymous,
|
||||
Name: info.GetName(),
|
||||
Login: info.GetName(),
|
||||
Permissions: map[int64]map[string][]string{},
|
||||
@@ -37,7 +38,7 @@ func WithRequester(handler http.Handler) http.Handler {
|
||||
slices.Contains(info.GetGroups(), user.SystemPrivilegedGroup) {
|
||||
orgId := int64(1)
|
||||
requester = &identity.StaticRequester{
|
||||
Type: identity.TypeServiceAccount, // system:apiserver
|
||||
Type: claims.TypeServiceAccount, // system:apiserver
|
||||
UserID: 1,
|
||||
OrgID: orgId,
|
||||
Name: info.GetName(),
|
||||
|
||||
Reference in New Issue
Block a user