Skip to content

Commit

Permalink
pkg/authn: add context to OIDC authenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
ibihim authored and stlaz committed May 29, 2024
1 parent c3563f8 commit ec86de4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/kube-rbac-proxy/app/kube-rbac-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/authn/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ec86de4

Please sign in to comment.