-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
server: fix expiry detection for verification keys #829
Conversation
server/rotation.go
Outdated
@@ -132,7 +132,7 @@ func (k keyRotater) rotate() error { | |||
i := 0 | |||
|
|||
for _, key := range keys.VerificationKeys { | |||
if !key.Expiry.After(tNow) { | |||
if key.Expiry.After(tNow) { |
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.
// key is still valid, include it in the VerificationKeys
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.
Thanks for the fix. LGTM!
ff35c6f
to
e2e6e0e
Compare
@rithujohn191 can you take a look at the PR again? I've added a few more comments to the rotation code. |
for _, key := range keys.VerificationKeys { | ||
if !key.Expiry.After(tNow) { | ||
if !expired(key) { |
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.
Only functional change. Everything else is comments and renaming.
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.
Thanks for the comments. Just one suggestion.
server/rotation.go
Outdated
// After demoting the signing key, keep the token around for at least | ||
// the amount of time an ID Token is valid for. This ensures the | ||
// verification key won't expire until all ID Tokens is could have | ||
// signed have expired as well. |
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.
"This ensures the verification key won't expire until all ID Tokens it has signed have expired as well"?
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.
thanks, updated.
e2e6e0e
to
2c4752d
Compare
updates #828