Authn: Sync authlib and update how we construct authn client interceptor (#101124)
* Sync authlib and update how we construct authn client interceptor * Remove namespace from checker
This commit is contained in:
@@ -25,7 +25,9 @@ func (t *tokenAuth) GetRequestMetadata(ctx context.Context, _ ...string) (map[st
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return map[string]string{authn.DefaultAccessTokenMetadataKey: token.Token}, nil
|
||||
const metadataKey = "X-Access-Token"
|
||||
|
||||
return map[string]string{metadataKey: token.Token}, nil
|
||||
}
|
||||
|
||||
func (t *tokenAuth) RequireTransportSecurity() bool { return false }
|
||||
|
||||
@@ -79,7 +79,7 @@ func (c *Client) Compile(ctx context.Context, id authlib.AuthInfo, req authlib.L
|
||||
func newItemChecker(res *authzv1.ListResponse) authlib.ItemChecker {
|
||||
// if we can see all resource of this type we can just return a function that always return true
|
||||
if res.GetAll() {
|
||||
return func(_, _, _ string) bool { return true }
|
||||
return func(_, _ string) bool { return true }
|
||||
}
|
||||
|
||||
folders := make(map[string]struct{}, len(res.Folders))
|
||||
@@ -92,7 +92,7 @@ func newItemChecker(res *authzv1.ListResponse) authlib.ItemChecker {
|
||||
items[i] = struct{}{}
|
||||
}
|
||||
|
||||
return func(_, name, folder string) bool {
|
||||
return func(name, folder string) bool {
|
||||
if _, ok := items[name]; ok {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user