Closed stefanzweifel closed 6 months ago
Hi @stefanzweifel, thanks for bringing this to our attention and for the excellent debugging work! Your proposed fix looks spot-on.
I didn't understand how
CredentialsWrapper
is generated (through protobuf or manually), so I didn't send in a pull request.
You're right to wonder about how CredentialsWrapper
is generated. It's created dynamically within the gax-php library (see here).
I noticed that
CredentialsWrapper
doesn't pass$this->authHttpHandler
to$this->credentialsFetcher->updateMetaData()
here.
It does appear that the authHttpHandler
argument is missing in the updateMetadata
call, reason being the other calls to auth (fetchAuthToken
) have the authHttpHandler
argument.
I would encourage you to submit a pull request with your fix! It's a valuable contribution.
hey @yash30201, since you already confirmed that the code is broken, and since @stefanzweifel moved to another solution before his code could get merged, maybe you could push that fix?
@yash30201 or anyone else maintaining this repository, would it be possible that one of you who already went through this CLA process to apply suggested by @stefanzweifel patch and fix bug described in this PR?
Also, @yash30201 to clarify things, this is a bug, not a feature request. Not being able to replace default implementation of HttpClient prevents anyone who is using this library to for example mock responses - this is a severe bug, not a nice to have feature.
is this repo even maintained?
Hi @norberttech ,
Sorry for the long delay in the reply. Folks have been out of office so it took time coming to this one.
Also, @yash30201 to clarify things, this is a bug, not a feature request.
Makes sense, I've updated the tag
Hi there!
I'm in a Laravel PHP project where I would like to replace the default HttpClient used by the google-ads SDK and gax-php to be the Laravel Http Client.
I noticed that
CredentialsWrapper
doesn't pass$this->authHttpHandler
to$this->credentialsFetcher->updateMetaData()
here.I didn't understand how
CredentialsWrapper
is generated (through protobuf or manually), so I didn't send in a pull request.Passing
$this->authHttpHandler
to theupdateMetadata
method did the trick for me.Environment details
Steps to reproduce
Guzzle7HttpHandler
instead of the custom HttpHandler.Code example
Here's a short code example using both the Google Ads SDK and gax-php. The
print_r
statement in the custom HttpHandler will only output the request URL tohttps://googleads.googleapis.com/*
but not tohttps://oauth2.googleapis.com/token
.This is my first time interacting with the suite of Google SDKs. Not sure if there is a better way to accomplish this. (I couldn't find documentation on how to replace the HttpClient and digging through the code I coudln't really make out the difference between "httpHandler" and "transport")