From ec86de47e7e4d2b30b3ddd609123412f06a16ae0 Mon Sep 17 00:00:00 2001 From: Krzysztof Ostrowski Date: Wed, 15 May 2024 17:18:43 +0200 Subject: [PATCH] pkg/authn: add context to OIDC authenticator --- cmd/kube-rbac-proxy/app/kube-rbac-proxy.go | 2 +- pkg/authn/oidc.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/kube-rbac-proxy/app/kube-rbac-proxy.go b/cmd/kube-rbac-proxy/app/kube-rbac-proxy.go index 17cf0d612..bcc14c193 100644 --- a/cmd/kube-rbac-proxy/app/kube-rbac-proxy.go +++ b/cmd/kube-rbac-proxy/app/kube-rbac-proxy.go @@ -220,7 +220,7 @@ func Run(cfg *completedProxyRunOptions) error { // If OIDC configuration provided, use oidc authenticator if cfg.auth.Authentication.OIDC.IssuerURL != "" { - oidcAuthenticator, err := authn.NewOIDCAuthenticator(cfg.auth.Authentication.OIDC) + oidcAuthenticator, err := authn.NewOIDCAuthenticator(ctx, cfg.auth.Authentication.OIDC) if err != nil { return fmt.Errorf("failed to instantiate OIDC authenticator: %w", err) } diff --git a/pkg/authn/oidc.go b/pkg/authn/oidc.go index 2402e0f72..f5faee50b 100644 --- a/pkg/authn/oidc.go +++ b/pkg/authn/oidc.go @@ -37,13 +37,13 @@ var ( ) // NewOIDCAuthenticator returns OIDC authenticator -func NewOIDCAuthenticator(config *OIDCConfig) (*OIDCAuthenticator, error) { +func NewOIDCAuthenticator(ctx context.Context, config *OIDCConfig) (*OIDCAuthenticator, error) { dyCA, err := dynamiccertificates.NewDynamicCAContentFromFile("oidc-ca", config.CAFile) if err != nil { return nil, err } - tokenAuthenticator, err := oidc.New(oidc.Options{ + tokenAuthenticator, err := oidc.New(ctx, oidc.Options{ JWTAuthenticator: apiserver.JWTAuthenticator{ Issuer: apiserver.Issuer{ URL: config.IssuerURL,