-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent panics on client-cert authenticated requests #132
Conversation
@@ -42,19 +42,20 @@ func NewDelegatingAuthenticator(client authenticationclient.TokenReviewInterface | |||
p *dynamiccertificates.DynamicFileCAContent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this still need to be declared up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used in the return value
TokenAccessReviewClient: client, | ||
APIAudiences: authenticator.Audiences(authn.Token.Audiences), | ||
} | ||
|
||
if len(authn.X509.ClientCAFile) > 0 { | ||
p, err = dynamiccertificates.NewDynamicCAContentFromFile("client-ca", authn.X509.ClientCAFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p, err :=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm on green
Fix for CI failure is in #133 |
Setting a nil-value typed object in the `DelegatingAuthenticatorConfig` will cause the generic logic to still evaluate is as non-nil since Golang does not consider `(*type)(nil)` as `nil` in `== nil` comparison unless `type == nil`, too. This leads to a setup of an x509 authenticator that attempts to call `VerifyOptions` on a nil object.
I rebased the PR myself as @stlaz is on vacations :) |
Setting a nil-value typed object in the
DelegatingAuthenticatorConfig
will cause the generic logic to still evaluate is as non-nil since
Golang does not consider
(*type)(nil)
asnil
in== nil
comparisonunless
type == nil
, too.This leads to a setup of an x509 authenticator that attempts to call
VerifyOptions
on a nil object.fixes #131