Merged
requested to merge fix/get-firebasev1-access-token-returns-wrong-token-lifetime into release/2.3
Overview
Previously, we used datetime.datetime.utcnow()
which gives a datetime object without timezone information (offset-naive datetime object). This can lead to errors. The new recommended approach is datetime.datetime.now(datetime.timezone.utc)
, which provides a more accurate "aware" datetime object that includes UTC timezone.
This became important because the expiry time from the python-google-auth library is also an "offset-naive" datetime object. Using these two different types together caused incorrect lifetime calculations.
To fix this, we are now using offset-aware datetime objects for both expiry
and now
time values.