File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,13 @@ public function __construct()
4141 {
4242 }
4343
44- public function getAuthorizationHeaderCallback ($ audience = null ): callable
44+ /**
45+ * @param string $audience
46+ * @return callable|null Returns null so the gRPC can accept it as an insecure channel.
47+ */
48+ public function getAuthorizationHeaderCallback ($ audience = null ): ?callable
4549 {
46- return fn () => [] ;
50+ return null ;
4751 }
4852
4953 public function checkUniverseDomain (): void
Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ private static function buildCommonHeaders(array $options)
109109 // Prevent unexpected behavior, as the authorization header callback
110110 // uses lowercase "authorization"
111111 unset($ headers ['authorization ' ]);
112- $ authHeaders = $ callback ();
112+ // Mitigate scenario where InsecureCredentialsWrapper returns null.
113+ $ authHeaders = empty ($ callback ) ? [] : $ callback ();
113114 if (!is_array ($ authHeaders )) {
114115 throw new \UnexpectedValueException (
115116 'Expected array response from authorization header callback '
You can’t perform that action at this time.
0 commit comments