Authlib: Use types package rather than claims (#99243)

This commit is contained in:
Ryan McKinley
2025-01-21 12:06:55 +03:00
committed by GitHub
parent b2d0359e72
commit 680e6bc1f8
149 changed files with 394 additions and 376 deletions
+6 -5
View File
@@ -4,12 +4,13 @@ import (
"context"
"testing"
"github.com/grafana/authlib/authz"
"github.com/stretchr/testify/assert"
authlib "github.com/grafana/authlib/types"
)
func TestAuthzLimitedClient_Check(t *testing.T) {
mockClient := &staticAuthzClient{allowed: false}
mockClient := authlib.FixedAccessClient(false)
client := NewAuthzLimitedClient(mockClient, AuthzOptions{})
tests := []struct {
@@ -23,7 +24,7 @@ func TestAuthzLimitedClient_Check(t *testing.T) {
}
for _, test := range tests {
req := authz.CheckRequest{
req := authlib.CheckRequest{
Group: test.group,
Resource: test.resource,
}
@@ -34,7 +35,7 @@ func TestAuthzLimitedClient_Check(t *testing.T) {
}
func TestAuthzLimitedClient_Compile(t *testing.T) {
mockClient := &staticAuthzClient{allowed: false}
mockClient := authlib.FixedAccessClient(false)
client := NewAuthzLimitedClient(mockClient, AuthzOptions{})
tests := []struct {
@@ -48,7 +49,7 @@ func TestAuthzLimitedClient_Compile(t *testing.T) {
}
for _, test := range tests {
req := authz.ListRequest{
req := authlib.ListRequest{
Group: test.group,
Resource: test.resource,
}