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:
Karl Persson
2025-02-26 09:22:09 +01:00
committed by GitHub
parent a7ecb19c31
commit fa74d1c36d
25 changed files with 105 additions and 107 deletions
+3 -1
View File
@@ -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 }
+2 -2
View File
@@ -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
}