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

Retry reading default GCP credentials in the expired case #34

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

liutikas
Copy link
Member

Currently, Google Auth library caches default credentials indefinitely in a static field. This means if user's credentials expire, they run gcloud auth command, then try runnning Gradle again the old credentials are used. This change adds a reflection based mechanism to clear default credentials cache and retrying one additional time to get new credentials.

Additionally, allow specifying the message on authentication failure.

@liutikas liutikas force-pushed the betterretries branch 2 times, most recently from 884bfcb to 639bf44 Compare July 26, 2023 17:56
Currently, Google Auth library caches default credentials indefinitely
in a static field. This means if user's credentials expire, they run
gcloud auth command, then try runnning Gradle again the old credentials
are used. This change adds a reflection based mechanism to clear default
credentials cache and retrying one additional time to get new
credentials.

Additionally, allow specifying the message on authentication failure.
@liutikas liutikas merged commit 9ac2daf into main Jul 26, 2023
2 checks passed
@liutikas liutikas deleted the betterretries branch July 26, 2023 20:12
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.

2 participants