google-wrapper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/client_builder.rb +3 -6
- data/lib/google/wrapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b29a88b79d2d10d3c88d6107d286774ea3c7d6a0
|
4
|
+
data.tar.gz: e5ae2197369571067cadf2aea41047003ebef9ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08c21a23649790fb4b59ca962df205d3b4e2e83d0f878d65c7f1546cae9b83e02171f577687b32ba476f367095be6a9a5c8c07877a5bb65624fd3c9a594eef79
|
7
|
+
data.tar.gz: 6dac2e5fcdbf7be896c278957a4ab562dc1fad3dcf594c9006d219390cdcb50f29910afbc8ae25723c2220d63336995badb5d872ba7035934b5c898a624b95ff
|
@@ -5,14 +5,11 @@ module Google
|
|
5
5
|
class ClientBuilder
|
6
6
|
extend ConstructionHelper
|
7
7
|
|
8
|
-
PRIVATE_KEY = ENV.fetch("GOOGLE_API_PRIVATE_KEY").gsub("\\n", "\n")
|
9
|
-
PRIVATE_KEY_SECRET = "notasecret" # static default for Google P12 auth
|
10
|
-
SERVICE_ACCOUNT_EMAIL = ENV.fetch("GOOGLE_API_SERVICE_ACCOUNT")
|
11
|
-
|
12
8
|
attr_accessor :user_email, :scopes, :authorize
|
13
9
|
|
14
10
|
def self.key
|
15
|
-
OpenSSL::PKey::RSA.new(
|
11
|
+
OpenSSL::PKey::RSA.new(ENV.fetch("GOOGLE_API_PRIVATE_KEY").gsub("\\n", "\n"),
|
12
|
+
"notasecret") # static default for Google P12 auth
|
16
13
|
end
|
17
14
|
|
18
15
|
def initialize
|
@@ -32,7 +29,7 @@ module Google
|
|
32
29
|
private
|
33
30
|
|
34
31
|
def asserter
|
35
|
-
Google::APIClient::JWTAsserter.new(
|
32
|
+
Google::APIClient::JWTAsserter.new(ENV.fetch("GOOGLE_API_SERVICE_ACCOUNT"), scopes, self.class.key)
|
36
33
|
end
|
37
34
|
|
38
35
|
def authorize?
|