Skip to content

Commit 1658976

Browse files
authored
Update docs about credentials (#609)
1 parent d615109 commit 1658976

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

docs/source/index.rst

+20-6
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,33 @@ Several modes of authentication are supported:
9999
or container engine) and fetch the credentials automatically from the
100100
metadata service.
101101

102-
- if ``token=dict(...)`` or ``token=<filepath>``, you may supply a token generated by the
103-
gcloud_ utility; this is either a python dictionary, or the name of a file
104-
containing the JSON returned by logging in with the gcloud CLI tool (e.g.,
105-
``~/.config/gcloud/application_default_credentials.json`` or
106-
``~/.config/gcloud/legacy_credentials/<YOUR GOOGLE USERNAME>/adc.json``)
107-
or any value google ``Credentials`` object.
102+
- if ``token=dict(...)`` or ``token=<filepath>``, you may supply a token
103+
generated by the gcloud_ utility. This can be
104+
105+
- a python dictionary
106+
107+
- the path to a file containing the JSON returned by logging in with the
108+
gcloud CLI tool (e.g.,
109+
``~/.config/gcloud/application_default_credentials.json`` or
110+
``~/.config/gcloud/legacy_credentials/<YOUR GOOGLE
111+
USERNAME>/adc.json``)
112+
113+
- the path to a service account key
114+
115+
- a google.auth.credentials.Credentials_ object
116+
117+
Note that ``~`` will not be automatically expanded to the user home
118+
directory, and must be manually expanded with a utility like
119+
``os.path.expanduser()``.
108120

109121
- you can also generate tokens via Oauth2 in the browser using ``token='browser'``,
110122
which gcsfs then caches in a special file, ~/.gcs_tokens, and can subsequently be accessed with ``token='cache'``.
111123

112124
- anonymous only access can be selected using ``token='anon'``, e.g. to access
113125
public resources such as 'anaconda-public-data'.
114126

127+
.. _google.auth.credentials.Credentials: https://google-auth.readthedocs.io/en/master/reference/google.auth.credentials.html#google.auth.credentials.Credentials
128+
115129
The acquired session tokens are *not* preserved when serializing the instances, so
116130
it is safe to pass them to worker processes on other machines if using in a
117131
distributed computation context. If credentials are given by a file path, however,

0 commit comments

Comments
 (0)