-
Notifications
You must be signed in to change notification settings - Fork 11
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
X509 Certificate Validation - x5t Thumbprint #35
Conversation
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.
Just a few remarks to consider, overall looking good 👍🏻
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.
I like your table tests 👍
Added however some remarks and questions.
Co-authored-by: f-blass <42929142+f-blass@users.noreply.github.com>
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.
approved 😄 I hope you checked the fwd-cert header format coming from k8s
and fix doc
f68607c
to
8a86b2f
Compare
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!
I have just a few comments mainly in speeding up the tests.
auth/proofOfPossession_test.go
Outdated
} | ||
|
||
func generateCert(t *testing.T, pemEncoded bool) string { | ||
key, err := rsa.GenerateKey(rand.Reader, 2048) |
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.
Based on the PR from Jakob yesterday. Does it make sense to cache this cert or do you actually need new certs each test run? Maybe the key can also be shortened to 512 bits.
Provides Certificate Thumbprint (x5t) validator which becomes part of a set of proof of possession validators.
cnf
claim withx5t#S256
member.Example:
cnf
token claim.auth.ClientCertificateFromCtx(request)
to get a x509.Certificate if provided within thex-forwarded-client-cert
header.token
anderr
token
,*x509.Certificate
anderr