Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow customizing the http client #426

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

forty
Copy link
Contributor

@forty forty commented May 5, 2022

Hi!

Sorry, I did not really follow the process before opening this MR 😬 but it was quick and I promise I won't complain if you just throw it away :)

So the idea is just to create a similar concept of "transporter" like https://github.com/googleapis/google-auth-library-nodejs/ has, which can be used to customize gaxios (or could even allow to plug a different library I guess, with some effort though).

google-auth-library use the tranporter everywhere, but when using gtoken https://github.com/googleapis/google-auth-library-nodejs/blob/main/src/auth/jwtclient.ts#L188 which is annoying, because I would like my custom transporter to be used everywhere (I set a custom node http agent).

What do you think ?

@forty forty requested a review from a team as a code owner May 5, 2022 17:02
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label May 5, 2022
@forty forty force-pushed the forty/transporter branch 2 times, most recently from e930fa3 to f025ee6 Compare May 11, 2022 15:21
@bcoe
Copy link
Contributor

bcoe commented Jun 7, 2022

@forty this seems like a fairly reasonable addition to the library to me.

@danielbankhead
Copy link
Contributor

Thanks @forty!

This looks great - would you mind adding a small test in test/index.ts to ensure #transporter is used rather than request directly?

@bcoe
Copy link
Contributor

bcoe commented Jun 10, 2022

@forty this looks ready to go, to me, with the addition of a test as @danielbankhead requests.

@forty
Copy link
Contributor Author

forty commented Jun 10, 2022

Great, thanks for the reviews, I'll try to look into adding the test sometimes next week 👍

@forty forty force-pushed the forty/transporter branch from af7698f to 0ff973f Compare June 27, 2022 07:57
@forty
Copy link
Contributor Author

forty commented Jun 27, 2022

@danielbankhead @bcoe I added a small test that makes sure the custom transporter is used (if any), let me know if it's not enough

@danielbankhead danielbankhead added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 28, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 28, 2022
@danielbankhead danielbankhead added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 28, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 28, 2022
@danielbankhead
Copy link
Contributor

Great! Thanks for your contribution

@danielbankhead danielbankhead merged commit 408ad04 into googleapis:main Jun 28, 2022
gcf-merge-on-green bot pushed a commit that referenced this pull request Jun 30, 2022
🤖 I have created a release *beep* *boop*
---


## [6.1.0](v6.0.1...v6.1.0) (2022-06-28)


### Features

* allow customizing the http client ([#426](#426)) ([408ad04](408ad04))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants