@@ -29,10 +29,10 @@ OAuth flow for installed applications.
2929
3030| name | type | required? | default | description |
3131| :-------------------------------------| :------------| :-----------| :-------------------------| :-----------------------|
32- | mode | string | optional | "append" | See [ Mode] ( #mode ) |
33- | auth_method | string | optional | "json \_ key " | ` json_key ` , ` compute_engine ` , or ` application_default `
34- | json_keyfile | string | required when auth_method is json_key | | Fullpath of json key |
35- | project | string | required if json_keyfile is not given | | project_id |
32+ | mode | string | optional | "append" | See [ Mode] ( #mode ) |
33+ | auth_method | string | optional | "application \_ default " | See [ Authentication ] ( #authentication ) |
34+ | json_keyfile | string | optional | | keyfile path or ` content ` |
35+ | project | string | required unless service \_ account's ` json_keyfile ` is given. | | project \_ id |
3636| dataset | string | required | | dataset |
3737| location | string | optional | nil | geographic location of dataset. See [ Location] ( #location ) |
3838| table | string | required | | table name, or table name with a partition decorator such as ` table_name$20160929 ` |
@@ -106,7 +106,7 @@ Following options are same as [bq command-line tools](https://cloud.google.com/b
106106out :
107107 type : bigquery
108108 mode : append
109- auth_method : json_key # default
109+ auth_method : service_account
110110 json_keyfile : /path/to/json_keyfile.json
111111 project : your-project-000
112112 dataset : your_dataset_name
@@ -115,15 +115,15 @@ out:
115115 source_format : NEWLINE_DELIMITED_JSON
116116` ` `
117117
118- ### location
118+ ### Location
119119
120120The geographic location of the dataset. Required except for US and EU.
121121
122122GCS bucket should be in same region when you use ` gcs_bucket`.
123123
124124See also [Dataset Locations | BigQuery | Google Cloud](https://cloud.google.com/bigquery/docs/dataset-locations)
125125
126- # ## mode
126+ # ## Mode
127127
1281285 modes are provided.
129129
@@ -162,40 +162,69 @@ NOTE: BigQuery does not support replacing (actually, copying into) a non-partiti
162162
163163# ## Authentication
164164
165- There are three methods supported to fetch access token for the service account.
165+ There are four authentication methods
166166
167- 1. JSON key of GCP(Google Cloud Platform)'s service account
168- 1. Pre-defined access token (Google Compute Engine only)
169- 1. [Application Default](https://cloud.google.com/docs/authentication/production)
167+ 1. `service_account` (or `json_key` for backward compatibility)
168+ 1. `authorized_user`
169+ 1. `compute_engine`
170+ 1. `application_default`
170171
171- # ### JSON key of GCP's service account
172+ # ### service\_account (or json\_key)
172173
173- You first need to create a service account (client ID),
174- download its json key and deploy the key with embulk.
174+ Use GCP service account credentials.
175+ You first need to create a service account, download its json key and deploy the key with embulk.
175176
176177` ` ` yaml
177178out:
178179 type: bigquery
179- auth_method: json_key
180+ auth_method: service_account
180181 json_keyfile: /path/to/json_keyfile.json
181182` ` `
182183
183- You can also embed contents of json_keyfile at config.yml.
184+ You can also embed contents of ` json_keyfile` at config.yml.
184185
185186` ` ` yaml
186187out:
187188 type: bigquery
188- auth_method: json_key
189+ auth_method: service_account
189190 json_keyfile:
190191 content: |
191192 {
192193 "private_key_id": "123456789",
193194 "private_key": "-----BEGIN PRIVATE KEY-----\n ABCDEF",
194195 "client_email": "..."
195- }
196+ }
196197` ` `
197198
198- # ### Pre-defined access token (GCE only)
199+ # ### authorized\_user
200+
201+ Use Google user credentials.
202+ You can get your credentials at `~/.config/gcloud/application_default_credentials.json` by running `gcloud auth login`.
203+
204+ ` ` ` yaml
205+ out:
206+ type: bigquery
207+ auth_method: authorized_user
208+ json_keyfile: /path/to/credentials.json
209+ ` ` `
210+
211+ You can also embed contents of `json_keyfile` at config.yml.
212+
213+ ` ` ` yaml
214+ out:
215+ type: bigquery
216+ auth_method: service_account
217+ json_keyfile:
218+ content: |
219+ {
220+ "client_id":"xxxxxxxxxxx.apps.googleusercontent.com",
221+ "client_secret":"xxxxxxxxxxx",
222+ "refresh_token":"xxxxxxxxxxx",
223+ "type":"authorized_user"
224+ }
225+ ` ` `
226+
227+ # ### compute\_engine
199228
200229On the other hand, you don't need to explicitly create a service account for embulk when you
201230run embulk in Google Compute Engine. In this third authentication method, you need to
@@ -208,9 +237,10 @@ out:
208237 auth_method: compute_engine
209238` ` `
210239
211- # ### Application Default
240+ # ### application\_default
212241
213- See https://cloud.google.com/docs/authentication/production
242+ Use Application Default Credentials (ADC).
243+ See https://cloud.google.com/docs/authentication/production for details.
214244
215245` ` ` yaml
216246out:
0 commit comments