Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

fix: don't retry if error or error_description is not string#1241

Merged
arithmetic1728 merged 3 commits intomainfrom
fix_reauth
Mar 1, 2023
Merged

fix: don't retry if error or error_description is not string#1241
arithmetic1728 merged 3 commits intomainfrom
fix_reauth

Conversation

@arithmetic1728
Copy link
Copy Markdown
Contributor

@arithmetic1728 arithmetic1728 commented Mar 1, 2023

If users forget to set quota project id in user credential ADC file, and reauth is needed, the server returns the following error:

{'error': 
    {'code': 403, 
      'message': "Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the reauth.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting..."
    }
}

Note that the 'error' value is not a string, so the if any(e in retryable_error_descriptions for e in (error_code, error_desc)) line throws an exception saying unhashable type: 'dict'. We should simply return if either error or error_description is not a string.

Internal bug: b/270627288

This PR also fixes a flaky sample test by setting a 10 seconds clock skew when verifying id token.

@arithmetic1728 arithmetic1728 marked this pull request as ready for review March 1, 2023 03:06
@arithmetic1728 arithmetic1728 requested review from a team March 1, 2023 03:06
@arithmetic1728 arithmetic1728 requested a review from a team as a code owner March 1, 2023 03:16
@arithmetic1728 arithmetic1728 requested a review from dandhlee March 1, 2023 03:16
@arithmetic1728 arithmetic1728 merged commit e2d263a into main Mar 1, 2023
@arithmetic1728 arithmetic1728 deleted the fix_reauth branch March 1, 2023 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants