-
Notifications
You must be signed in to change notification settings - Fork 608
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: add parameter to ProxyAgent options, which is type of authentication #1705
Conversation
Codecov ReportBase: 94.11% // Head: 94.19% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1705 +/- ##
==========================================
+ Coverage 94.11% 94.19% +0.08%
==========================================
Files 53 53
Lines 4943 4961 +18
==========================================
+ Hits 4652 4673 +21
+ Misses 291 288 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
cc @RafaelGSS
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.
Could you please include docs for this new property? Would be great to mention the deprecation of auth
in the docs too.
lib/proxy-agent.js
Outdated
} | ||
|
||
if (opts.token) { |
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.
} | |
if (opts.token) { | |
} else if (opts.token) { |
lib/proxy-agent.js
Outdated
@@ -55,10 +55,15 @@ class ProxyAgent extends DispatcherBase { | |||
this[kProxyTls] = opts.proxyTls | |||
this[kProxyHeaders] = {} | |||
|
|||
// deprecated |
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.
// deprecated | |
// @deprecated in favour of opts.token |
@@ -15,6 +15,7 @@ declare namespace ProxyAgent { | |||
export interface Options extends Agent.Options { | |||
uri: string; | |||
auth?: string; |
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.
auth?: string; | |
/** | |
* @deprecated use opts.token | |
*/ | |
auth?: string; |
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.
Fix the lint too
@RafaelGSS |
docs/api/ProxyAgent.md
Outdated
|
||
const proxyAgent = new ProxyAgent({ | ||
uri: 'my.proxy.server', | ||
token 'Bearer xxxx' |
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.
token 'Bearer xxxx' | |
token: 'Bearer xxxx' |
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.
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.
Can you add a test for the types?
596b887
to
0ba193c
Compare
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.
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
…ation (nodejs#1705) * feat: add parameter to ProxyAgent options, whitch is type of authentication. * fix: docs and comments * fix: docs * add: throw error when using auth in combination with token * add: test for the types Co-authored-by: oshimaharuna <ooooooshim115@gmail.com>
…ation (nodejs#1705) * feat: add parameter to ProxyAgent options, whitch is type of authentication. * fix: docs and comments * fix: docs * add: throw error when using auth in combination with token * add: test for the types Co-authored-by: oshimaharuna <ooooooshim115@gmail.com>
Implements: add parameter to ProxyAgent options
Benefits: ProxyAgent can use a variety of authentication types.
Also see: About this issue #1704