Open dbalabka opened 1 week ago
This change requires v2.26.0
Since that version is pretty new, we should support both ways rather than force everyone to upgrade. Can you please link where the new behaviour was introduced upstream, please (or a link to TokenState's doc) ?
@martindurant , here is a PR: https://github.com/googleapis/google-auth-library-python/pull/1368
I'm not sure they have documentation yet. Also, let's skip this change for now unless it is required. I assumed it would fix my issue with a token refresh (see #627), but it seems it is not related. Hence, we can close this PR unmerged
let's skip this change for now unless it is required
I'm happy to leave it open for others to see, and we'll probably need it eventually.
In the scope of #627, I found that
gcsfs
uses a deprecated approach to check the token validity. Usingself.credentials.token_state == google.auth.credentials.TokenState.FRESH
allows to refresh the token a bit earlier using a threshold:Important! This change requires v2.26.0
Now, a token might have 3 states:
In a nutshell,
FRESH
means that a token has more than 3 minutes and 45 seconds till the real expiration time.