embulk-output-bigquery 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14f823d8b06be1f8537c52ae244c4c94bbeb8833
4
- data.tar.gz: b419e43610303eea86f1a963bde2bb4db472b26e
3
+ metadata.gz: 2784d92df0a5542880259e6d0cbdbdf4112576cf
4
+ data.tar.gz: 8d1a6bd77e56a49f3e303571b48c6b4b5f4f9ec5
5
5
  SHA512:
6
- metadata.gz: 009d542bbcbe0e73b40ccb76a1197c8dcd4185fcc0bc8b1819d799d74d9fc59428935250ffd67df560da14228a6d9526d9b41503eb7b88b23b1da505712a9157
7
- data.tar.gz: 6215755f4975f62a949ba52e5766d61449b74ff0e63ca731caca0ceef17a69ff88a2adfe2636f1fe592f6feb51c10d7fa1624976224ff509d9a5c0bf54f8bb2e
6
+ metadata.gz: a5c632416596681d347dcf26da31c0b930930c7cdb60080a1e1e77c590fc8743da5006f3e8b6edc1bccce50c5744872e83f33cb86c66b6b1c0d260747c9b8a09
7
+ data.tar.gz: 8d5ee5c5f4a63163c7955325aa82d71b9fb497182ce5eb264aa1ff84bf95c156936b860714da2ba1b69e07ffd5cd8b7375f153172f854bb00a1f153b9f0c2bd6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.3 - 2016-05-24
2
+
3
+ * [maintenance] Fix `private_key` auth is not working
4
+
1
5
  ## 0.3.2 - 2016-05-03
2
6
 
3
7
  * [new feature] Add `abort_on_error` option
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # embulk-output-bigquery
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/embulk/embulk-output-bigquery.png?branch=master)](http://travis-ci.org/embulk/embulk-output-bigquery)
4
+
3
5
  [Embulk](https://github.com/embulk/embulk/) output plugin to load/insert data into [Google BigQuery](https://cloud.google.com/bigquery/) using [direct insert](https://cloud.google.com/bigquery/loading-data-into-bigquery#loaddatapostrequest)
4
6
 
5
7
  ## Overview
data/Rakefile CHANGED
@@ -6,6 +6,6 @@ Rake::TestTask.new(:test) do |t|
6
6
  t.libs << "test"
7
7
  t.test_files = Dir["test/**/test_*.rb"].sort
8
8
  t.verbose = true
9
- #t.warning = true
9
+ t.warning = false
10
10
  end
11
11
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-bigquery"
3
- spec.version = "0.3.2"
3
+ spec.version = "0.3.3"
4
4
  spec.authors = ["Satoshi Akama", "Naotoshi Seo"]
5
5
  spec.summary = "Google BigQuery output plugin for Embulk"
6
6
  spec.description = "Embulk plugin that insert records to Google BigQuery."
@@ -16,11 +16,6 @@ module Embulk
16
16
  @task = task
17
17
  @schema = schema
18
18
 
19
- @auth_method = task['auth_method']
20
- @private_key_path = task['p12_keyfile']
21
- @private_key_passphrase = 'notasecret'
22
- @json_key = task['json_keyfile']
23
-
24
19
  @project = task['project']
25
20
  @dataset = task['dataset']
26
21
 
@@ -40,26 +35,28 @@ module Embulk
40
35
 
41
36
  scope = "https://www.googleapis.com/auth/bigquery"
42
37
 
43
- case @auth_method
38
+ case @task['auth_method']
44
39
  when 'private_key'
45
- key = Google::APIClient::KeyUtils.load_from_pkcs12(@private_key_path, @private_key_passphrase)
40
+ private_key_passphrase = 'notasecret'
41
+ key = Google::APIClient::KeyUtils.load_from_pkcs12(@task['p12_keyfile'], private_key_passphrase)
46
42
  auth = Signet::OAuth2::Client.new(
47
43
  token_credential_uri: "https://accounts.google.com/o/oauth2/token",
48
44
  audience: "https://accounts.google.com/o/oauth2/token",
49
45
  scope: scope,
50
- issuer: @email,
46
+ issuer: @task['service_account_email'],
51
47
  signing_key: key)
52
48
 
53
49
  when 'compute_engine'
54
50
  auth = Google::Auth::GCECredentials.new
55
51
 
56
52
  when 'json_key'
57
- if File.exist?(@json_key)
58
- auth = File.open(@json_key) do |f|
53
+ json_key = @task['json_keyfile']
54
+ if File.exist?(json_key)
55
+ auth = File.open(json_key) do |f|
59
56
  Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: f, scope: scope)
60
57
  end
61
58
  else
62
- key = StringIO.new(@json_key)
59
+ key = StringIO.new(json_key)
63
60
  auth = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: key, scope: scope)
64
61
  end
65
62
 
@@ -67,7 +64,7 @@ module Embulk
67
64
  auth = Google::Auth.get_application_default([scope])
68
65
 
69
66
  else
70
- raise ConfigError, "Unknown auth method: #{@auth_method}"
67
+ raise ConfigError, "Unknown auth method: #{@task['auth_method']}"
71
68
  end
72
69
 
73
70
  client.authorization = auth
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-03 00:00:00.000000000 Z
12
+ date: 2016-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-api-client