googleauth 1.16.0 → 1.16.2
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 +13 -0
- data/lib/googleauth/external_account.rb +7 -0
- data/lib/googleauth/service_account.rb +17 -10
- data/lib/googleauth/signet.rb +6 -4
- data/lib/googleauth/user_refresh.rb +10 -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: 68a9a896f10ad5681d196a55d510216535bbe80709f7d28e4ff2acbd3a6ed33d
|
|
4
|
+
data.tar.gz: 7000d55fa0183165332069eaadf3a7e01019e5886c0bb7f49e542d34063552a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1168e7be27c6a261b1794c4fcc88bf8b7eb019eefab0cbc2007ffee416a954c74d44005d08621d7fac6f545235645d20f1604655797c7639dfaf94800a86cf32
|
|
7
|
+
data.tar.gz: 29eb9a732eae0b6146790c41c62e77548ce60048e0f53ad1cf9760333d99a69c5e8297ee178151da6825d4fa8d8365d5c84bdb8d422b6489d1ea179cd0fe254d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### 1.16.2 (2026-02-26)
|
|
4
|
+
|
|
5
|
+
#### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* initialize the JWT credentials without JSON roundtrip ([#564](https://github.com/googleapis/google-auth-library-ruby/issues/564))
|
|
8
|
+
* return response body from revoke! for logging pipeline ([#562](https://github.com/googleapis/google-auth-library-ruby/issues/562))
|
|
9
|
+
|
|
10
|
+
### 1.16.1 (2026-01-15)
|
|
11
|
+
|
|
12
|
+
#### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* restore support for JSON keys missing 'type' field ([#558](https://github.com/googleapis/google-auth-library-ruby/issues/558))
|
|
15
|
+
|
|
3
16
|
### 1.16.0 (2025-11-21)
|
|
4
17
|
|
|
5
18
|
#### Features
|
|
@@ -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
|
|
@@ -181,15 +188,15 @@ module Google
|
|
|
181
188
|
|
|
182
189
|
def apply_self_signed_jwt! a_hash
|
|
183
190
|
# Use the ServiceAccountJwtHeaderCredentials using the same cred values
|
|
184
|
-
|
|
185
|
-
private_key:
|
|
186
|
-
|
|
187
|
-
project_id:
|
|
188
|
-
quota_project_id: @quota_project_id
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
alt = ServiceAccountJwtHeaderCredentials.new(
|
|
192
|
+
private_key: @signing_key.to_s,
|
|
193
|
+
issuer: @issuer,
|
|
194
|
+
project_id: @project_id,
|
|
195
|
+
quota_project_id: @quota_project_id,
|
|
196
|
+
universe_domain: universe_domain,
|
|
197
|
+
scope: scope,
|
|
198
|
+
logger: logger
|
|
199
|
+
)
|
|
193
200
|
alt.apply! a_hash
|
|
194
201
|
end
|
|
195
202
|
|
data/lib/googleauth/signet.rb
CHANGED
|
@@ -210,10 +210,12 @@ module Signet
|
|
|
210
210
|
digest = Digest::SHA256.hexdigest response_hash["id_token"]
|
|
211
211
|
response_hash["id_token"] = "(sha256:#{digest})"
|
|
212
212
|
end
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
logger&.debug do
|
|
214
|
+
Google::Logging::Message.from(
|
|
215
|
+
message: "Received auth token response: #{response_hash}",
|
|
216
|
+
"credentialsId" => object_id
|
|
217
|
+
)
|
|
218
|
+
end
|
|
217
219
|
end
|
|
218
220
|
|
|
219
221
|
def log_auth_error err
|
|
@@ -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
|
|
@@ -139,6 +146,8 @@ module Google
|
|
|
139
146
|
principal: principal
|
|
140
147
|
)
|
|
141
148
|
end
|
|
149
|
+
|
|
150
|
+
resp.body
|
|
142
151
|
end
|
|
143
152
|
end
|
|
144
153
|
|
data/lib/googleauth/version.rb
CHANGED