Skip to content

Commit

Permalink
Merge pull request #132 from stlaz/clientca_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom authored Jul 22, 2021
2 parents 77f8adf + 6c0e103 commit b33e775
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/authn/delegating.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ func NewDelegatingAuthenticator(client authenticationclient.TokenReviewInterface
p *dynamiccertificates.DynamicFileCAContent
err error
)

authenticatorConfig := authenticatorfactory.DelegatingAuthenticatorConfig{
Anonymous: false, // always require authentication
CacheTTL: 2 * time.Minute,
TokenAccessReviewClient: client,
APIAudiences: authenticator.Audiences(authn.Token.Audiences),
}

if len(authn.X509.ClientCAFile) > 0 {
p, err = dynamiccertificates.NewDynamicCAContentFromFile("client-ca", authn.X509.ClientCAFile)
if err != nil {
return nil, err
}
}

authenticatorConfig := authenticatorfactory.DelegatingAuthenticatorConfig{
Anonymous: false, // always require authentication
CacheTTL: 2 * time.Minute,
ClientCertificateCAContentProvider: p,
TokenAccessReviewClient: client,
APIAudiences: authenticator.Audiences(authn.Token.Audiences),
authenticatorConfig.ClientCertificateCAContentProvider = p
}

authenticator, _, err := authenticatorConfig.New()
Expand Down

0 comments on commit b33e775

Please sign in to comment.