@@ -99,19 +99,33 @@ Several modes of authentication are supported:
99
99
or container engine) and fetch the credentials automatically from the
100
100
metadata service.
101
101
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() ``.
108
120
109
121
- you can also generate tokens via Oauth2 in the browser using ``token='browser' ``,
110
122
which gcsfs then caches in a special file, ~/.gcs_tokens, and can subsequently be accessed with ``token='cache' ``.
111
123
112
124
- anonymous only access can be selected using ``token='anon' ``, e.g. to access
113
125
public resources such as 'anaconda-public-data'.
114
126
127
+ .. _google.auth.credentials.Credentials : https://google-auth.readthedocs.io/en/master/reference/google.auth.credentials.html#google.auth.credentials.Credentials
128
+
115
129
The acquired session tokens are *not * preserved when serializing the instances, so
116
130
it is safe to pass them to worker processes on other machines if using in a
117
131
distributed computation context. If credentials are given by a file path, however,
0 commit comments