Repository navigation
Conversation
…rver-rotated tokens - Added optional `refreshToken` and `revokeToken` results to `RefreshJWTToken`, along with a persisted `pendingRevokeToken` state for deferred vault writes. - Updated logic to persist refresh and revoke tokens even when the vault is locked, ensuring tokens are managed correctly without unnecessary renewals or revocations. - Introduced tests to validate the new behavior of token persistence and state management during various controller operations. This update improves the handling of authentication tokens, particularly in scenarios where server-side token rotation occurs, enhancing overall security and user experience.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
auth-service is moving to one-time-use refresh tokens with family revocation (EMBED-529). A refresh now consumes the presented token and returns its successor (refresh_token and revoke_token). The controller must persist that successor, or the next renew/revoke will present a consumed token, the server will treat it as theft, and the user will be logged out.
This ships the core change so clients can release ahead of the server deploy.
Backward compatibility
The old-server path is unchanged: when the refresh response has no new tokens, the controller updates the vault, calls rotateRefreshToken(), and queues the old pair for revocation as before. New state is optional, so no migration is needed.
Known limitation
#serverRotatesRefreshTokens is an in-memory flag and resets on restart. Until auth-service rotation is deployed everywhere, a standalone rotateRefreshToken() before the first refresh after a restart can still queue a consumed pair. Tracked in code with a shortcut: comment.
Follow-ups (other repos)
References
Checklist