- Notifications
You must be signed in to change notification settings - Fork928
feat: implement key rotation system#14710
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Ensure the test cleans up the clock's trap to avoid potentialresource leaks.
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.
Some comments inline, but I don't need to review again.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
}) | ||
require.NoError(t, err) | ||
require.Equal(t, now.Add(defaultRotationInterval*3), rotatedKey.StartsAt.UTC()) | ||
}) |
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.
One more slightly insidious edge case:
2 Workspace apps keys in the database
seq 19, expiresAt 2 hours ago, valid secret
seq 20, deletesAt now, NULL secret (e.g. manually deleted)
We should insert a new key with sequence 21, startsAt 30 minutes from now.
We should set key 19 deletesAt to 1h5m fromnow, since as far as we know, it could be being used to mint tokens right now.
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 fixed it so thatdeletes_at
is dependent on thestarts_at
of the new key. So thedeletes_at
would be1hr35m
from now.
2d5c068
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR implements an abstraction for rotating our internal signing keys. It's intentionally not integrated into the broader application in an attempt to keep the PR to a reasonable (although regrettably still large) size.
Contributes towardscoder/internal#52