Skip to content

Remove TokenState import for backward compatibility #1514

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CoteTommy
Copy link

@CoteTommy CoteTommy commented May 27, 2025

Removes dependency on google.auth.credentials.TokenState, which was introduced in google-auth v2.26.0.
To maintain compatibility with earlier versions, replaces TokenState.FRESH with its equivalent hardcoded value 1.

Reference: https://github.com/googleapis/google-auth-library-python/blob/7c61c7d0a42ceec3eab693065745a74f524acab0/google/auth/credentials.py#L520

Fixes:
Could not load Google Cloud Storage bindings error when using google-auth < 2.26.0 with django-storages >= 1.14.6.

I give @martey all the credit for the solution (issue 1449)

@CoteTommy CoteTommy changed the title fix(gcloud): remove TokenState import for backward compatibility Remove TokenState import for backward compatibility May 27, 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.

1 participant