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

Set max version for google-auth #192

Closed
wants to merge 1 commit into from
Closed

Set max version for google-auth #192

wants to merge 1 commit into from

Conversation

call-dd
Copy link

@call-dd call-dd commented Sep 20, 2021

The google-auth library was recently updated, and the CLOCK_SKEW attribute has been refactored and is now REFRESH_THRESHOLD. Using google-auth 2.1.0 (latest) produces the following error:

gam info domain
Traceback (most recent call last):
  File "/gam/src/gam/__init__.py", line 56782, in ProcessGAMCommand
    MAIN_COMMANDS_WITH_OBJECTS[CL_command][CMD_FUNCTION][CL_objectName]()
  File "/gam/src/gam/__init__.py", line 12680, in doInfoDomain
    doInfoInstance()
  File "/gam/src/gam/__init__.py", line 12646, in doInfoInstance
    doInfoCustomer(customerInfo, FJQC)
  File "/gam/src/gam/__init__.py", line 12558, in doInfoCustomer
    cd = buildGAPIObject(API.DIRECTORY)
  File "/gam/src/gam/__init__.py", line 4671, in buildGAPIObject
    credentials = getClientCredentials(api=api, refreshOnly=True)
  File "/gam/src/gam/__init__.py", line 3938, in getClientCredentials
    writeCreds, credentials = getOauth2TxtCredentials(api=api, noDASA=noDASA, refreshOnly=refreshOnly)
  File "/gam/src/gam/__init__.py", line 3840, in getOauth2TxtCredentials
    creds = google.oauth2.credentials.Credentials.from_authorized_user_info(jsonDict)
  File "/gam/src/gam/google/oauth2/credentials.py", line 352, in from_authorized_user_info
    expiry = _helpers.utcnow() - _helpers.CLOCK_SKEW
AttributeError: module 'google.auth._helpers' has no attribute 'CLOCK_SKEW'

See googleapis/google-auth-library-python#863 for the upstream change. This PR simply pins the version of google-auth to <2.1.0 to avoid this issue.

A more permanent solution would be to update the CLOCK_SKEW variable to REFRESH_THRESHOLD in the vendored google code (/gam/src/gam/google/oauth2/credentials.py). I'm not quite sure why or how this google code is vendored into gam, so I just went for the simplest fix in this PR.

@taers232c
Copy link
Owner

Send me a Meet/Zoom invitation.

Ross

@call-dd
Copy link
Author

call-dd commented Sep 20, 2021

Ross updated the vendored google libraries so this change is no longer needed. Closing.

@call-dd call-dd closed this Sep 20, 2021
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.

None yet

3 participants