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

google: make SDKConfig work with newer versions of gcloud #301

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ojarjur
Copy link

@ojarjur ojarjur commented Jul 2, 2018

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

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
@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@ojarjur ojarjur changed the title make SDKConfig work with newer versions of gcloud google: make SDKConfig work with newer versions of gcloud Dec 20, 2018
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.
@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Omar Jarjur:

Patch Set 4:

(5 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 4:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 5: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 5:

Build is still in progress...
This change failed on windows-amd64-2016:
See https://storage.googleapis.com/go-build-log/a2bb68de/windows-amd64-2016_aab653ea.log

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 5: TryBot-Result-1

2 of 17 TryBots failed:
Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/a2bb68de/windows-amd64-2016_aab653ea.log
Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/a2bb68de/windows-386-2008_b2da18bc.log

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Omar Jarjur:

Patch Set 7:

(8 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 7:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Omar Jarjur:

Patch Set 7:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5:

Build is still in progress...
This change failed on windows-amd64-2016:
See https://storage.googleapis.com/go-build-log/a2bb68de/windows-amd64-2016_aab653ea.log

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5: TryBot-Result-1

2 of 17 TryBots failed:
Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/a2bb68de/windows-amd64-2016_aab653ea.log
Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/a2bb68de/windows-386-2008_b2da18bc.log

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Omar Jarjur:

Patch Set 4:

(5 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 4:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 5: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5:

Build is still in progress...
This change failed on windows-amd64-2016:
See https://storage.googleapis.com/go-build-log/a2bb68de/windows-amd64-2016_aab653ea.log

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5: TryBot-Result-1

2 of 17 TryBots failed:
Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/a2bb68de/windows-amd64-2016_aab653ea.log
Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/a2bb68de/windows-386-2008_b2da18bc.log

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Omar Jarjur:

Patch Set 7:

(8 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 7:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Omar Jarjur:

Patch Set 7:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/121939.
After addressing review feedback, remember to publish your drafts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDKConfig doesn't work past gcloud v179.0.0
3 participants