googleauth 1.16.0 → 1.16.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/googleauth/external_account.rb +7 -0
- data/lib/googleauth/service_account.rb +8 -1
- data/lib/googleauth/user_refresh.rb +8 -1
- data/lib/googleauth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 311cfe855cb7bcac5a60c62eb701be4bfeb2faf7b0c98109afce80ce349ae570
|
|
4
|
+
data.tar.gz: 452413ded2279ce73c4e7ed4cd17393f3fa2915d8a7a05515cc7ac3145f930b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea7f50f6938a83785e7fc90613c7b1b51a7b394f28924b4b6f44975b20b9f127dc785a718bf8129c0e5e7fbc19b3765c7d0e25234c5724fb298cdc2c0e70c649
|
|
7
|
+
data.tar.gz: a3d7a37736db58aca6284d0487772cb08a4b16768a57ceb33296c3cb566073fac8a40f97e502eb916fbd0336ad6e3ff5a20a3888003c84ced05a89250ff22cdd
|
data/CHANGELOG.md
CHANGED
|
@@ -62,6 +62,13 @@ module Google
|
|
|
62
62
|
json_key_io, scope = options.values_at :json_key_io, :scope
|
|
63
63
|
|
|
64
64
|
raise InitializationError, "A json file is required for external account credentials." unless json_key_io
|
|
65
|
+
json_key = MultiJson.load json_key_io.read, symbolize_keys: true
|
|
66
|
+
if json_key.key? :type
|
|
67
|
+
json_key_io.rewind
|
|
68
|
+
else # Defaults to class credential 'type' if missing.
|
|
69
|
+
json_key[:type] = CREDENTIAL_TYPE_NAME
|
|
70
|
+
json_key_io = StringIO.new MultiJson.dump(json_key)
|
|
71
|
+
end
|
|
65
72
|
CredentialsLoader.load_and_verify_json_key_type json_key_io, CREDENTIAL_TYPE_NAME
|
|
66
73
|
user_creds = read_json_key json_key_io
|
|
67
74
|
|
|
@@ -58,7 +58,7 @@ module Google
|
|
|
58
58
|
# @param json_key_io [IO] An IO object containing the JSON key
|
|
59
59
|
# @param scope [string|array|nil] the scope(s) to access
|
|
60
60
|
# @raise [ArgumentError] If both scope and target_audience are specified
|
|
61
|
-
def self.make_creds options = {}
|
|
61
|
+
def self.make_creds options = {} # rubocop:disable Metrics/MethodLength
|
|
62
62
|
json_key_io, scope, enable_self_signed_jwt, target_audience, audience, token_credential_uri =
|
|
63
63
|
options.values_at :json_key_io, :scope, :enable_self_signed_jwt, :target_audience,
|
|
64
64
|
:audience, :token_credential_uri
|
|
@@ -66,6 +66,13 @@ module Google
|
|
|
66
66
|
|
|
67
67
|
private_key, client_email, project_id, quota_project_id, universe_domain =
|
|
68
68
|
if json_key_io
|
|
69
|
+
json_key = MultiJson.load json_key_io.read
|
|
70
|
+
if json_key.key? "type"
|
|
71
|
+
json_key_io.rewind
|
|
72
|
+
else # Defaults to class credential 'type' if missing.
|
|
73
|
+
json_key["type"] = CREDENTIAL_TYPE_NAME
|
|
74
|
+
json_key_io = StringIO.new MultiJson.dump(json_key)
|
|
75
|
+
end
|
|
69
76
|
CredentialsLoader.load_and_verify_json_key_type json_key_io, CREDENTIAL_TYPE_NAME
|
|
70
77
|
read_json_key json_key_io
|
|
71
78
|
else
|
|
@@ -47,9 +47,16 @@ module Google
|
|
|
47
47
|
#
|
|
48
48
|
# @param json_key_io [IO] An IO object containing the JSON key
|
|
49
49
|
# @param scope [string|array|nil] the scope(s) to access
|
|
50
|
-
def self.make_creds options = {}
|
|
50
|
+
def self.make_creds options = {} # rubocop:disable Metrics/MethodLength
|
|
51
51
|
json_key_io, scope = options.values_at :json_key_io, :scope
|
|
52
52
|
user_creds = if json_key_io
|
|
53
|
+
json_key = MultiJson.load json_key_io.read
|
|
54
|
+
if json_key.key? "type"
|
|
55
|
+
json_key_io.rewind
|
|
56
|
+
else # Defaults to class credential 'type' if missing.
|
|
57
|
+
json_key["type"] = CREDENTIAL_TYPE_NAME
|
|
58
|
+
json_key_io = StringIO.new MultiJson.dump(json_key)
|
|
59
|
+
end
|
|
53
60
|
CredentialsLoader.load_and_verify_json_key_type json_key_io, CREDENTIAL_TYPE_NAME
|
|
54
61
|
read_json_key json_key_io
|
|
55
62
|
else
|
data/lib/googleauth/version.rb
CHANGED