Repository navigation
Conversation
…seconds remaining The previous refresh trigger refreshed the browser-session access token on every request as soon as less than five minutes were left on a five-minute token, causing a high volume of redundant refresh-token calls to the identity provider. Only refresh with less than 60 seconds remaining instead, and expose the clock via a protected getTime() helper so tests can freeze time. Signed-off-by: Hendrik Linka <[email protected]>
|
|
5 of 12 tasks
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.
The current refresh trigger in
SessionVerifier::refreshToken()refreshes the browser session's access token when less than 5 minutes remain. For the common case of 5-minute access tokens this means a refresh-token request is sent to the identity provider on virtually every request, because a token is almost always within its last 5 minutes right after it was refreshed — most of those refresh calls are redundant.This PR:
protected getTime()helper so unit tests can freeze timeTests
testRefreshWindow— data provider covering 32 remaining-expiry values (from far future to expired) × 3 token sources (cached-expiry, JWT payload, token introspection): no refresh at 60 s or more remaining, refresh below 60 stestRepeatedRequestsDoNotImmediatelyRefreshRotatedTokens— 600-request simulation over 10 minutes with token rotation: refreshes happen exactly when the (rotated) token enters its final 60 s, and the very next requests (a few seconds later, on the fresh token) do not refresh againBackground
Split out of #377 as requested in the review there: this PR contains only the
SessionVerifierrefresh-window change and no other parts of that PR.