-
Notifications
You must be signed in to change notification settings - Fork 339
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
feat(kuma-cp) user token with RSA256 #2992
Conversation
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2992 +/- ##
==========================================
+ Coverage 52.30% 52.33% +0.03%
==========================================
Files 916 919 +3
Lines 52962 52999 +37
==========================================
+ Hits 27701 27739 +38
+ Misses 23056 23048 -8
- Partials 2205 2212 +7
Continue to review full report at Codecov.
|
pkg/plugins/authn/api-server/tokens/issuer/singing_key_accessor.go
Outdated
Show resolved
Hide resolved
pkg/plugins/authn/api-server/tokens/issuer/singing_key_accessor.go
Outdated
Show resolved
Hide resolved
Oh, also I think the commentary from the PR is really useful context that should be included in the commit message :) |
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.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.
I had some minor quibbles about error propagation, but overall this looks great 👍
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Summary
After discussing offline with @jpeach #2923 (comment) we decided we want to switch to RSA256 to provide the future possibility of extending User Token to be able to generate private key offline, issue tokens offline, and provide the public key as plain config.
Full changelog
UserTokenIssuer
was split toUserTokenIssuer
/UserTokenValidator
andUserTokenValidator
is now usingSigningKeyAccessor
. In the future, we can implement static version ofUserTokenValidator
that relies ONLY on public key provided as a config (for exampleKUMA_API_SERVER_AUTHN_USER_TOKEN_PUB_KEYS
). Of course, that means that token issuer would not be available in the control plane, but tokens will be issued offline somewhere else (other system like Vault or kumactl).GlobalSecret
resources, one for private key and one for public key, but since public key can be retrieved from private key inPKCS1
format, it seems like a duplication of information. Additionally, it's an extra hassle (generate two resources, when rotate you need to set two of them etc.). We can addkumactl extract public-key --private-key-file=key.pem
or something like this.Issues resolved
Related #2955
Documentation
Testing
Backwards compatibility