Skip to content
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

Add a bit of lag to the JWT renewal time. #3592

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Nov 13, 2024

BugDX-3151 `state checkout` with expired JWT gives unhelpful error message

It was possible to land within the interval between actual expired time and expected expired time.

I did my best to try and reproduce this, but I wasn't able to. I genuinely think I landed in the brief window of time where the JWT expired on the Platform, but state-svc or state tool thought it was still valid. Reducing the time state-svc or state tool think it's valid should avoid this. Either way, it's not something our users will run into on a regular basis (and waiting a minute or two for the state-svc poller to refresh would have silently fixed this error).

It was possible to land within the interval between actual expired time and expected expired time.
@mitchell-as mitchell-as requested a review from Naatan November 14, 2024 18:41
@mitchell-as mitchell-as marked this pull request as ready for review November 14, 2024 18:41
Copy link
Member

@Naatan Naatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively duplicating the logic here:

if s.cutoffReached(time.Now()) {

Suggest instead lowering the lifetime to say 50 minutes:

const jwtLifetime = (1 * time.Hour) - (1 * time.Minute)

@mitchell-as mitchell-as requested a review from Naatan November 14, 2024 20:57
@mitchell-as mitchell-as merged commit bc92b12 into version/0-48-0-RC1 Nov 14, 2024
8 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-3151 branch November 14, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants