Skip to content

Conversation

rafibarash
Copy link
Contributor

@rafibarash rafibarash commented Jun 25, 2025

Up until last year an auth token was considered valid if it didn't expire in the next 10 seconds, but this was changed to 255s last year in https://github.com/googleapis/google-cloud-go/pull/9139/files. This is causing issues with tokens returned from GKE Metadata server, which may be almost expired, expecting a refresh in the background. Let's revert to the previous behavior of allowing tokens to be used until they're within 10s of expiry, and then refreshing them at that time.

It would be more optimal to refresh in the background, but for now I want to do this simpler fix and revert to our previous behavior.

Fixes #182.

…0s from now, instead of token.IsValid(), which only allows tokens that expire up to 255s from now.
@rafibarash rafibarash requested review from kmontg, ardagnir and jedouard1994 and removed request for kmontg and jedouard1994 June 25, 2025 20:25
@rafibarash rafibarash changed the title Increase the amount of time an auth token is considered "valid" from 255s -> 10s. Increase the amount of time an auth token is considered "valid" Jun 25, 2025
@rafibarash rafibarash merged commit e4e0596 into GoogleCloudPlatform:master Jun 25, 2025
8 checks passed
@rafibarash rafibarash deleted the token branch June 25, 2025 21:32
dziemba added a commit to dziemba/buildbuddy that referenced this pull request Jul 31, 2025
sluongng pushed a commit to dziemba/buildbuddy that referenced this pull request Aug 5, 2025
sluongng pushed a commit to buildbuddy-io/buildbuddy that referenced this pull request Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase the amount of time an auth token is considered "valid" for
2 participants