Auth: use IdentityType from authlib (#91763)
This commit is contained in:
@@ -3,6 +3,7 @@ package authntest
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/authlib/claims"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/models/usertoken"
|
||||
"github.com/grafana/grafana/pkg/services/authn"
|
||||
@@ -77,7 +78,7 @@ type MockClient struct {
|
||||
PriorityFunc func() uint
|
||||
HookFunc func(ctx context.Context, identity *authn.Identity, r *authn.Request) error
|
||||
LogoutFunc func(ctx context.Context, user identity.Requester) (*authn.Redirect, bool)
|
||||
IdentityTypeFunc func() identity.IdentityType
|
||||
IdentityTypeFunc func() claims.IdentityType
|
||||
ResolveIdentityFunc func(ctx context.Context, orgID int64, namespaceID identity.TypedID) (*authn.Identity, error)
|
||||
}
|
||||
|
||||
@@ -127,11 +128,11 @@ func (m *MockClient) Logout(ctx context.Context, user identity.Requester) (*auth
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (m *MockClient) IdentityType() identity.IdentityType {
|
||||
func (m *MockClient) IdentityType() claims.IdentityType {
|
||||
if m.IdentityTypeFunc != nil {
|
||||
return m.IdentityTypeFunc()
|
||||
}
|
||||
return identity.TypeEmpty
|
||||
return claims.TypeEmpty
|
||||
}
|
||||
|
||||
// ResolveIdentity implements authn.IdentityResolverClient.
|
||||
|
||||
Reference in New Issue
Block a user