Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: call gcloud config get project to get project for user cred #1243

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

arithmetic1728
Copy link
Contributor

Fix #1239

google.auth.default() returns the ADC cred and project id. If the cred is user cred, currently we use gcloud config config-helper --format json to obtain the json of all properties and find the project property from the json. The problem is that this command refreshes the credentials after expiry, and if reauth is enabled, it will prompt for user interaction. This is not the right behavior. We should use gcloud config get project instead because it simply return the project id and not do any refresh.

@arithmetic1728 arithmetic1728 merged commit c078a13 into main Mar 2, 2023
@arithmetic1728 arithmetic1728 deleted the fix_reauth branch March 2, 2023 18:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Password prompt opened by google.auth.default() when credentials have expired
2 participants