Chore: Update authlib (foder as top level argument) (#111800)
This commit is contained in:
@@ -85,7 +85,7 @@ type LegacyAccessClient struct {
|
||||
opts map[string]ResourceAuthorizerOptions
|
||||
}
|
||||
|
||||
func (c *LegacyAccessClient) Check(ctx context.Context, id claims.AuthInfo, req claims.CheckRequest) (claims.CheckResponse, error) {
|
||||
func (c *LegacyAccessClient) Check(ctx context.Context, id claims.AuthInfo, req claims.CheckRequest, folder string) (claims.CheckResponse, error) {
|
||||
ident, ok := id.(identity.Requester)
|
||||
if !ok {
|
||||
return claims.CheckResponse{}, errors.New("expected identity.Requester for legacy access control")
|
||||
@@ -140,6 +140,9 @@ func (c *LegacyAccessClient) Check(ctx context.Context, id claims.AuthInfo, req
|
||||
return claims.CheckResponse{}, err
|
||||
}
|
||||
|
||||
// NOTE: folder is looked up again in the evaluator:
|
||||
// pkg/services/accesscontrol/acimpl/accesscontrol.go#L77
|
||||
|
||||
return claims.CheckResponse{Allowed: allowed}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestLegacyAccessClient_Check(t *testing.T) {
|
||||
Resource: "dashboards",
|
||||
Namespace: "default",
|
||||
Name: "1",
|
||||
})
|
||||
}, "")
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, false, res.Allowed)
|
||||
})
|
||||
@@ -47,7 +47,7 @@ func TestLegacyAccessClient_Check(t *testing.T) {
|
||||
Namespace: "default",
|
||||
Resource: "dashboards",
|
||||
Name: "1",
|
||||
})
|
||||
}, "")
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, false, res.Allowed)
|
||||
@@ -70,7 +70,7 @@ func TestLegacyAccessClient_Check(t *testing.T) {
|
||||
Verb: "list",
|
||||
Namespace: "default",
|
||||
Resource: "dashboards",
|
||||
})
|
||||
}, "")
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, true, res.Allowed)
|
||||
@@ -94,7 +94,7 @@ func TestLegacyAccessClient_Check(t *testing.T) {
|
||||
Namespace: "default",
|
||||
Resource: "dashboards",
|
||||
Name: "1",
|
||||
})
|
||||
}, "")
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, true, res.Allowed)
|
||||
@@ -119,7 +119,7 @@ func TestLegacyAccessClient_Check(t *testing.T) {
|
||||
Namespace: "default",
|
||||
Resource: "dashboards",
|
||||
Name: "1",
|
||||
})
|
||||
}, "")
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, true, res.Allowed)
|
||||
@@ -129,7 +129,7 @@ func TestLegacyAccessClient_Check(t *testing.T) {
|
||||
Namespace: "default",
|
||||
Resource: "dashboards",
|
||||
Name: "1",
|
||||
})
|
||||
}, "")
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, false, res.Allowed)
|
||||
|
||||
Reference in New Issue
Block a user