From 4c31ed48a83542c0ab7b28e058a5023cab3e79d0 Mon Sep 17 00:00:00 2001 From: Samuel Melrose Date: Tue, 10 Dec 2024 10:29:53 +0000 Subject: [PATCH] GCEDWDCredentials fix --- composer.json | 1 + .../Integration/Google/Credentials/GCEDWDCredentials.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 008d52c..833b0a4 100755 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "affordablemobiles/open-telemetry-operations-php": "~1", "guzzlehttp/guzzle": "^7.8.1", "google/cloud": ">=0.239.0 <1.0.0", + "google/auth": ">=1.44.0", "kelvinmo/simplejwt": "^0.8.2", "laravel/framework": "~11" }, diff --git a/src/AffordableMobiles/GServerlessSupportLaravel/Integration/Google/Credentials/GCEDWDCredentials.php b/src/AffordableMobiles/GServerlessSupportLaravel/Integration/Google/Credentials/GCEDWDCredentials.php index 547fcf9..f385297 100644 --- a/src/AffordableMobiles/GServerlessSupportLaravel/Integration/Google/Credentials/GCEDWDCredentials.php +++ b/src/AffordableMobiles/GServerlessSupportLaravel/Integration/Google/Credentials/GCEDWDCredentials.php @@ -119,6 +119,7 @@ public function signOAuth2(string $alg, string $msg): string * If $httpHandler is not specified a the default HttpHandler is used. * * @param callable $httpHandler callback which delivers psr7 request + * @param array $headers [optional] Metrics headers to be inserted into the token endpoint request present. * * @return array { * A set of auth related metadata, based on the token type @@ -131,12 +132,12 @@ public function signOAuth2(string $alg, string $msg): string * * @throws \Exception */ - public function fetchAuthToken(?callable $httpHandler = null) + public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) { if (empty($this->subject)) { - return parent::fetchAuthToken($httpHandler); + return parent::fetchAuthToken($httpHandler, $headers); } - return $this->auth->fetchAuthToken($httpHandler); + return $this->auth->fetchAuthToken($httpHandler, $headers); } }