From 990250345d6af31de1066c08c0b3b42692ae263c Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Mon, 27 Sep 2021 17:05:57 +0200 Subject: [PATCH] fix: Prevented gcloud from authenticating on the console when getting the gcloud project --- lib/googleauth/credentials_loader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/googleauth/credentials_loader.rb b/lib/googleauth/credentials_loader.rb index 5ecda5d2..9c92f4b9 100644 --- a/lib/googleauth/credentials_loader.rb +++ b/lib/googleauth/credentials_loader.rb @@ -175,7 +175,7 @@ def warn_if_cloud_sdk_credentials client_id def load_gcloud_project_id gcloud = GCLOUD_WINDOWS_COMMAND if OS.windows? gcloud = GCLOUD_POSIX_COMMAND unless OS.windows? - gcloud_json = IO.popen("#{gcloud} #{GCLOUD_CONFIG_COMMAND}", &:read) + gcloud_json = IO.popen("#{gcloud} #{GCLOUD_CONFIG_COMMAND}", in: :close, err: :close, &:read) config = MultiJson.load gcloud_json config["configuration"]["properties"]["core"]["project"] rescue StandardError