-
Notifications
You must be signed in to change notification settings - Fork 1.6k
First pass at Authentication summary in docs. #830
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
Conversation
@tmatsuo : FYI, feedback welcome. |
Order of evaluation | ||
------------------- | ||
|
||
``gcloud`` will look in a bunch of different places |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Summary | ||
======= | ||
|
||
For the majority of cases, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
authentication should "just work" | ||
as credentials can be loaded implicitly | ||
based on the environment you're application is running in | ||
and therefore there is no extra code required to authenticate. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Changes Unknown when pulling 5a88b2f on jgeewax:authentication into * on GoogleCloudPlatform:master*. |
@dhermes can you take a look? |
from gcloud import pubsub | ||
|
||
# Create the credentials from the keyfile and set the default connection. | ||
credentials = get_for_service_account_json('/path/to/key.json') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
the easiest way to authenticate is using the Cloud SDK. | ||
|
||
**If you're running your application elsewhere**, | ||
you should download the service account JSON keyfile |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
(and add the answer to your question here). | ||
|
||
.. _Google Developers Console: https://console.developers.google.com/project | ||
.. _Credentials: https://pantheon.corp.google.com/project/_/apiui/credential |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I came up with a little concern about thread safety and multiprocessing safety. Is the implicit method thread safe? For example, when I did the following, the apiary client object breaks:
BTW the document looks great now :) |
@tmatsuo Thanks for pointing this out. I've also worried about how our implicit code would work in a multithreaded environment. (Easy becomes hard very quickly.) Are you referring to our library or |
@dhermes That's the Unfortunately I lost the stacktraces now, I tried to reproduce it, but now I'm failing to repro.
Then it threw some kind of SSL handshake error. I will update here once I can reproduce it. |
Thanks. That's "good news" for us since we don't do config with The flipside is that this could be a larger issue in a threaded environment. I thought I filed an issue about enabling a "bring your own |
This means that you can set your credentials a bunch of different ways. | ||
We recommend using some form of implicitly discovered credentials | ||
(ie, set in an environment variable or auto-discovered in GCE/GAE) | ||
so that youre code can be |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@jgeewax I just tried to revisit this and #805, but realized it's not worth moving forward on until the client pattern is fully in. When I do move forward on it, I'm going to start with a tiny document (i.e. one paragraph) and then "launch and iterate" so we don't have so many comments to address in a single PR. |
Took a crack at this, related to #805