-
Notifications
You must be signed in to change notification settings - Fork 233
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
Simplify request wrapper #218
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a80b178
to
5b2783a
Compare
panva
reviewed
Feb 17, 2021
0c8b0ed
to
6460545
Compare
adamjmcgrath
requested changes
Feb 23, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - couple of suggestions
6460545
to
bb1d17c
Compare
Migrate from callbacks to async/await
adamjmcgrath
approved these changes
Feb 24, 2021
panva
approved these changes
Feb 24, 2021
Merged
This was referenced Mar 12, 2021
This was referenced Mar 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The goal of this PR is to expand the support for users of this library to fully customize the underlying request, while simplifying the default request options.
Adds
options.fetcher
- this is a promise returning function that fetches the jwks data. We want to make sure that users can fully customize how data is fetched, this option will allow for a user to replace the underlying request logic and supply their own data fetching logic.options.requestAgent
- previously we gated the options that could be passed into a requestAgent, which required we have some type of frankenstein solution for supporting proxies. This will allow the user supply their own agent in the request and thus allowing them to support the proxy at this level.Removes
options.requestAgentOptions
- now withrequestAgent
this will no longer be neededoptions.proxy
- now withrequestAgent
a user can control their proxy flow, and with thefetcher
option a user can completely control the request flowaxios
- we have had a lot of issues pop up after moving from the EOLrequest
library toaxios
. With thefetcher
option, a user can now use their own request library, and this PR introduces using the node internals to make the requests.