Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

feat: allow customizing the http client#426

Merged
danielbankhead merged 1 commit intogoogleapis:mainfrom
forty:forty/transporter
Jun 28, 2022
Merged

feat: allow customizing the http client#426
danielbankhead merged 1 commit intogoogleapis:mainfrom
forty:forty/transporter

Conversation

@forty
Copy link
Copy Markdown
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
Copy Markdown

bcoe commented Jun 7, 2022

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

@danielbankhead
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants