openid-client
Advanced tools
Comparing version 1.18.2 to 1.19.0
@@ -8,2 +8,3 @@ # openid-client CHANGELOG | ||
<!-- TOC START min:2 max:2 link:true update:true --> | ||
- [Version 1.19.0](#version-1190) | ||
- [Version 1.18.x](#version-118x) | ||
@@ -33,2 +34,6 @@ - [Version 1.17.0](#version-1170) | ||
## Version 1.19.0 | ||
- [DIFF](https://github.com/panva/node-openid-client/compare/v1.18.2...v1.19.0) | ||
- added maintained request wrapper and a simple api to use request instead of `got` | ||
## Version 1.18.x | ||
@@ -35,0 +40,0 @@ ### Version 1.18.2 |
@@ -8,2 +8,3 @@ const got = require('got'); | ||
* options.body {String|Object} | ||
* options.form {Boolean} | ||
* options.query {Object} | ||
@@ -10,0 +11,0 @@ * options.timeout {Number} |
@@ -10,2 +10,3 @@ 'use strict'; | ||
const http = require('./http'); | ||
const httpRequest = require('./http_request'); | ||
@@ -198,2 +199,10 @@ const DEFAULT_HTTP_OPTIONS = require('./consts').DEFAULT_HTTP_OPTIONS; | ||
static useGot() { | ||
this.httpClient = http; | ||
} | ||
static useRequest() { | ||
this.httpClient = httpRequest(); | ||
} | ||
get httpClient() { | ||
@@ -247,4 +256,4 @@ return this.constructor.httpClient; | ||
Issuer.httpClient = http; | ||
Issuer.useGot(); | ||
module.exports = Issuer; |
{ | ||
"name": "openid-client", | ||
"version": "1.18.2", | ||
"version": "1.19.0", | ||
"description": "OpenID Connect Relying Party (RP, Client) implementation for Node.js servers, supports passportjs", | ||
@@ -59,2 +59,3 @@ "main": "lib/index.js", | ||
"readable-mock-req": "^0.2.2", | ||
"request": "^2.83.0", | ||
"sinon": "^4.0.0", | ||
@@ -61,0 +62,0 @@ "timekeeper": "^2.0.0" |
@@ -438,2 +438,41 @@ # openid-client | ||
### Proxy settings | ||
Because of the lightweight nature of [got][got-library] library the client will not use | ||
environment-defined http(s) proxies. In order to have them used you'll need to either provide your own http request | ||
implementation using the provided `httpClient` setter or use the bundled [request][request-library] | ||
one. | ||
Custom implementation: | ||
```js | ||
/* | ||
* url {String} | ||
* options {Object} | ||
* options.headers {Object} | ||
* options.body {String|Object} | ||
* options.form {Boolean} | ||
* options.query {Object} | ||
* options.timeout {Number} | ||
* options.retries {Number} | ||
* options.followRedirect {Boolean} | ||
*/ | ||
Issuer.httpClient = { | ||
get(url, options) {}, // return Promise | ||
post(url, options) {}, // return Promise | ||
HTTPError, // used error constructor | ||
}; | ||
``` | ||
Bundled (and maintained + tested) request implementation after you've added [request][request-library] | ||
to your package.json bundle: | ||
``` | ||
npm install request@^2.0.0 --save | ||
``` | ||
```js | ||
Issuer.useRequest(); | ||
``` | ||
[travis-image]: https://img.shields.io/travis/panva/node-openid-client/master.svg?style=flat-square&maxAge=7200 | ||
@@ -454,2 +493,3 @@ [travis-url]: https://travis-ci.org/panva/node-openid-client | ||
[got-library]: https://github.com/sindresorhus/got | ||
[request-library]: https://github.com/request/request | ||
[signed-userinfo]: http://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse | ||
@@ -456,0 +496,0 @@ [openid-certified-link]: http://openid.net/certification/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85204
19
1542
498
17
3