-
Notifications
You must be signed in to change notification settings - Fork 1k
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
google: make SDKConfig work with newer versions of gcloud #301
base: master
Are you sure you want to change the base?
Conversation
The existing implementation of SDKConfig assumes that the Cloud SDK writes a config file named `credentials`, which contains JSON-encoded OAuth2 credentials for the user. Since version 161.0.0 of the Cloud SDK, that has not been true, as the Cloud SDK has switched to storing credentials in a SQLite database instead of a JSON-encoded file. This change switches from trying to directly read the underlying credential store (which it is now clear can change without notice), to instead invoking the `gcloud` command and asking it for its credentials. This is done using the subcommand ```sh gcloud config config-helper ``` That subcommand is meant to provide auth data to external tools, so it seems to be a more appropriate choice than reading the underlying storage directly. This fixes golang#300
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
This PR (HEAD: bf936a0) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/oauth2/+/121939 to see it. Tip: You can toggle comments from me using the |
Message from Bryan C. Mills: Patch Set 2: (5 comments) Thanks for the contribution! Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
This change makes the error messages generated by the sdk component consistent both in terms of contents and in terms of when returned errors are wrapped.
This PR (HEAD: ebcc2cd) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/oauth2/+/121939 to see it. Tip: You can toggle comments from me using the |
Message from Omar Jarjur: Patch Set 4: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 5: Patch Set 4 was rebased Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 5: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Gobot Gobot: Patch Set 5: TryBots beginning. Status page: https://farmer.golang.org/try?commit=e26f11d7 Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Gobot Gobot: Patch Set 5: Build is still in progress... Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Gobot Gobot: Patch Set 5: TryBot-Result-1 2 of 17 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
This PR (HEAD: 1ebe5b9) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/oauth2/+/121939 to see it. Tip: You can toggle comments from me using the |
Message from Brad Fitzpatrick: Patch Set 6: Run-TryBot+1 (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Gobot Gobot: Patch Set 6: TryBots beginning. Status page: https://farmer.golang.org/try?commit=c88e296b Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Gobot Gobot: Patch Set 6: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
This PR (HEAD: a160a16) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/oauth2/+/121939 to see it. Tip: You can toggle comments from me using the |
Message from Omar Jarjur: Patch Set 7: (8 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 7: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Omar Jarjur: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 5: TryBots beginning. Status page: https://farmer.golang.org/try?commit=e26f11d7 Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 5: Build is still in progress... Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 5: TryBot-Result-1 2 of 17 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 6: TryBots beginning. Status page: https://farmer.golang.org/try?commit=c88e296b Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 6: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Gerrit User 5976: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Bryan C. Mills: Patch Set 2: (5 comments) Thanks for the contribution! Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Omar Jarjur: Patch Set 4: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 5: Patch Set 4 was rebased Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 5: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 5: TryBots beginning. Status page: https://farmer.golang.org/try?commit=e26f11d7 Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 5: Build is still in progress... Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 5: TryBot-Result-1 2 of 17 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 6: Run-TryBot+1 (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 6: TryBots beginning. Status page: https://farmer.golang.org/try?commit=c88e296b Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Go Bot: Patch Set 6: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Omar Jarjur: Patch Set 7: (8 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Brad Fitzpatrick: Patch Set 7: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
Message from Omar Jarjur: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/121939. |
The existing implementation of SDKConfig assumes that the Cloud SDK
writes a config file named "credentials", which contains JSON-encoded
OAuth2 credentials for the user.
Since version 161.0.0 of the Cloud SDK, that has not been true, as the
Cloud SDK has switched to storing credentials in a SQLite database
instead of a JSON-encoded file.
This change switches from trying to directly read the underlying
credential store (which it is now clear can change without notice), to
instead invoking the "gcloud" command and asking it for its
credentials. This is done using the subcommand "gcloud config config-helper"
That subcommand is meant to provide auth data to external tools, so it
seems to be a more appropriate choice than reading the underlying
storage directly.
Fixes #300