From 008b47c40f4cb3d112d03ff3542601990cb9a240 Mon Sep 17 00:00:00 2001 From: Viacheslav Rostovtsev Date: Mon, 23 Feb 2026 16:09:26 -0800 Subject: [PATCH] fix: initialize the JWT credentials without JSON roundtrip --- lib/googleauth/service_account.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/googleauth/service_account.rb b/lib/googleauth/service_account.rb index f7be414..84a4bfe 100644 --- a/lib/googleauth/service_account.rb +++ b/lib/googleauth/service_account.rb @@ -188,15 +188,15 @@ def principal def apply_self_signed_jwt! a_hash # Use the ServiceAccountJwtHeaderCredentials using the same cred values - cred_json = { - private_key: @signing_key.to_s, - client_email: @issuer, - project_id: @project_id, - quota_project_id: @quota_project_id - } - key_io = StringIO.new MultiJson.dump(cred_json) - alt = ServiceAccountJwtHeaderCredentials.make_creds json_key_io: key_io, scope: scope - alt.logger = logger + alt = ServiceAccountJwtHeaderCredentials.new( + private_key: @signing_key.to_s, + issuer: @issuer, + project_id: @project_id, + quota_project_id: @quota_project_id, + universe_domain: universe_domain, + scope: scope, + logger: logger + ) alt.apply! a_hash end