@webex/plugin-authorization-node 2.59.3-next.1 → 2.59.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -6
- package/README.md +53 -53
- package/babel.config.js +3 -3
- package/dist/authorization.js +44 -44
- package/dist/authorization.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +15 -16
- package/process +1 -1
- package/src/authorization.js +184 -184
- package/src/config.js +7 -7
- package/src/index.js +19 -19
- package/test/integration/spec/authorization.js +166 -166
- package/test/unit/spec/authorization.js +69 -69
package/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
module.exports = config;
|
|
1
|
+
const config = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# @webex/plugin-authorization-node
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Authorization plugin loaded when the Cisco Webex JS SDK is used in a non-browser environment.
|
|
6
|
-
|
|
7
|
-
- [Install](#install)
|
|
8
|
-
- [Usage](#usage)
|
|
9
|
-
- [Contribute](#contribute)
|
|
10
|
-
- [Maintainers](#maintainers)
|
|
11
|
-
- [License](#license)
|
|
12
|
-
|
|
13
|
-
## Install
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install --save @webex/plugin-authorization-node
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
22
|
-
|
|
23
|
-
## Install
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install --save @webex/plugin-authorization-node
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
|
|
33
|
-
const Webex = require('webex');
|
|
34
|
-
|
|
35
|
-
const webex = Webex.init();
|
|
36
|
-
webex.authorization-node.get(id)
|
|
37
|
-
.then((authorization-node) => {
|
|
38
|
-
console.log(authorization-node);
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Maintainers
|
|
44
|
-
|
|
45
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
46
|
-
|
|
47
|
-
## Contribute
|
|
48
|
-
|
|
49
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
50
|
-
|
|
51
|
-
## License
|
|
52
|
-
|
|
53
|
-
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/plugin-authorization-node
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Authorization plugin loaded when the Cisco Webex JS SDK is used in a non-browser environment.
|
|
6
|
+
|
|
7
|
+
- [Install](#install)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [Contribute](#contribute)
|
|
10
|
+
- [Maintainers](#maintainers)
|
|
11
|
+
- [License](#license)
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save @webex/plugin-authorization-node
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install --save @webex/plugin-authorization-node
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
|
|
33
|
+
const Webex = require('webex');
|
|
34
|
+
|
|
35
|
+
const webex = Webex.init();
|
|
36
|
+
webex.authorization-node.get(id)
|
|
37
|
+
.then((authorization-node) => {
|
|
38
|
+
console.log(authorization-node);
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Maintainers
|
|
44
|
+
|
|
45
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
46
|
+
|
|
47
|
+
## Contribute
|
|
48
|
+
|
|
49
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = babelConfigLegacy;
|
|
1
|
+
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = babelConfigLegacy;
|
package/dist/authorization.js
CHANGED
|
@@ -14,18 +14,18 @@ var _webexCore = require("@webex/webex-core");
|
|
|
14
14
|
var _jsonwebtoken = _interopRequireDefault(require("jsonwebtoken"));
|
|
15
15
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
16
16
|
var _dec, _obj;
|
|
17
|
-
/**
|
|
18
|
-
* NodeJS support for OAuth2
|
|
19
|
-
* @class
|
|
20
|
-
* @name AuthorizationNode
|
|
17
|
+
/**
|
|
18
|
+
* NodeJS support for OAuth2
|
|
19
|
+
* @class
|
|
20
|
+
* @name AuthorizationNode
|
|
21
21
|
*/
|
|
22
22
|
var Authorization = _webexCore.WebexPlugin.extend((_dec = (0, _common.whileInFlight)('isAuthorizing'), (_obj = {
|
|
23
23
|
derived: {
|
|
24
|
-
/**
|
|
25
|
-
* Alias of {@link AuthorizationNode#isAuthorizing}
|
|
26
|
-
* @instance
|
|
27
|
-
* @memberof AuthorizationNode
|
|
28
|
-
* @type {boolean}
|
|
24
|
+
/**
|
|
25
|
+
* Alias of {@link AuthorizationNode#isAuthorizing}
|
|
26
|
+
* @instance
|
|
27
|
+
* @memberof AuthorizationNode
|
|
28
|
+
* @type {boolean}
|
|
29
29
|
*/
|
|
30
30
|
isAuthenticating: {
|
|
31
31
|
deps: ['isAuthorizing'],
|
|
@@ -35,11 +35,11 @@ var Authorization = _webexCore.WebexPlugin.extend((_dec = (0, _common.whileInFli
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
session: {
|
|
38
|
-
/**
|
|
39
|
-
* Indicates if an Authorization Code exchange is inflight
|
|
40
|
-
* @instance
|
|
41
|
-
* @memberof AuthorizationNode
|
|
42
|
-
* @type {boolean}
|
|
38
|
+
/**
|
|
39
|
+
* Indicates if an Authorization Code exchange is inflight
|
|
40
|
+
* @instance
|
|
41
|
+
* @memberof AuthorizationNode
|
|
42
|
+
* @type {boolean}
|
|
43
43
|
*/
|
|
44
44
|
isAuthorizing: {
|
|
45
45
|
default: false,
|
|
@@ -58,13 +58,13 @@ var Authorization = _webexCore.WebexPlugin.extend((_dec = (0, _common.whileInFli
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
|
-
/**
|
|
62
|
-
* Exchanges an authorization code for an access token
|
|
63
|
-
* @instance
|
|
64
|
-
* @memberof AuthorizationNode
|
|
65
|
-
* @param {Object} options
|
|
66
|
-
* @param {Object} options.code
|
|
67
|
-
* @returns {Promise}
|
|
61
|
+
/**
|
|
62
|
+
* Exchanges an authorization code for an access token
|
|
63
|
+
* @instance
|
|
64
|
+
* @memberof AuthorizationNode
|
|
65
|
+
* @param {Object} options
|
|
66
|
+
* @param {Object} options.code
|
|
67
|
+
* @returns {Promise}
|
|
68
68
|
*/
|
|
69
69
|
requestAuthorizationCodeGrant: function requestAuthorizationCodeGrant() {
|
|
70
70
|
var _this = this;
|
|
@@ -100,20 +100,20 @@ var Authorization = _webexCore.WebexPlugin.extend((_dec = (0, _common.whileInFli
|
|
|
100
100
|
return _promise.default.reject(new ErrorConstructor(res._res || res));
|
|
101
101
|
});
|
|
102
102
|
},
|
|
103
|
-
/**
|
|
104
|
-
* Requests a Webex access token for a user already authenticated into
|
|
105
|
-
* your product.
|
|
106
|
-
*
|
|
107
|
-
* Note: You'll need to supply a jwtRefreshCallback of the form
|
|
108
|
-
* `Promise<jwt> = jwtRefreshCallback(webex)` for automatic token refresh to
|
|
109
|
-
* work.
|
|
110
|
-
*
|
|
111
|
-
* @instance
|
|
112
|
-
* @memberof AuthorizationNode
|
|
113
|
-
* @param {Object} options
|
|
114
|
-
* @param {Object} options.jwt This is a jwt generated by your backend that
|
|
115
|
-
* identifies a user in your system
|
|
116
|
-
* @returns {Promise}
|
|
103
|
+
/**
|
|
104
|
+
* Requests a Webex access token for a user already authenticated into
|
|
105
|
+
* your product.
|
|
106
|
+
*
|
|
107
|
+
* Note: You'll need to supply a jwtRefreshCallback of the form
|
|
108
|
+
* `Promise<jwt> = jwtRefreshCallback(webex)` for automatic token refresh to
|
|
109
|
+
* work.
|
|
110
|
+
*
|
|
111
|
+
* @instance
|
|
112
|
+
* @memberof AuthorizationNode
|
|
113
|
+
* @param {Object} options
|
|
114
|
+
* @param {Object} options.jwt This is a jwt generated by your backend that
|
|
115
|
+
* identifies a user in your system
|
|
116
|
+
* @returns {Promise}
|
|
117
117
|
*/
|
|
118
118
|
requestAccessTokenFromJwt: function requestAccessTokenFromJwt(_ref) {
|
|
119
119
|
var _this2 = this;
|
|
@@ -146,14 +146,14 @@ var Authorization = _webexCore.WebexPlugin.extend((_dec = (0, _common.whileInFli
|
|
|
146
146
|
return _this2.webex.internal.services.initServiceCatalogs();
|
|
147
147
|
});
|
|
148
148
|
},
|
|
149
|
-
/**
|
|
150
|
-
* Creates a jwt user token
|
|
151
|
-
* @param {object} options
|
|
152
|
-
* @param {String} options.issuer Guest Issuer ID
|
|
153
|
-
* @param {String} options.secretId Guest Secret ID
|
|
154
|
-
* @param {String} options.displayName Guest Display Name | optional
|
|
155
|
-
* @param {String} options.expiresIn
|
|
156
|
-
* @returns {Promise<object>}
|
|
149
|
+
/**
|
|
150
|
+
* Creates a jwt user token
|
|
151
|
+
* @param {object} options
|
|
152
|
+
* @param {String} options.issuer Guest Issuer ID
|
|
153
|
+
* @param {String} options.secretId Guest Secret ID
|
|
154
|
+
* @param {String} options.displayName Guest Display Name | optional
|
|
155
|
+
* @param {String} options.expiresIn
|
|
156
|
+
* @returns {Promise<object>}
|
|
157
157
|
*/
|
|
158
158
|
createJwt: function createJwt(_ref3) {
|
|
159
159
|
var issuer = _ref3.issuer,
|
|
@@ -177,7 +177,7 @@ var Authorization = _webexCore.WebexPlugin.extend((_dec = (0, _common.whileInFli
|
|
|
177
177
|
return _promise.default.reject(e);
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
|
-
version: "2.59.
|
|
180
|
+
version: "2.59.4"
|
|
181
181
|
}, ((0, _applyDecoratedDescriptor2.default)(_obj, "requestAuthorizationCodeGrant", [_dec, _common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "requestAuthorizationCodeGrant"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "requestAccessTokenFromJwt", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "requestAccessTokenFromJwt"), _obj)), _obj)));
|
|
182
182
|
var _default = Authorization;
|
|
183
183
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","_webexCore","_jsonwebtoken","_interopRequireDefault","_uuid","_dec","_obj","Authorization","WebexPlugin","extend","whileInFlight","derived","isAuthenticating","deps","fn","isAuthorizing","session","default","type","namespace","logout","options","arguments","length","undefined","webex","request","method","uri","config","logoutUrl","body","token","cisService","service","requestAuthorizationCodeGrant","_this","logger","info","code","_promise","reject","Error","tokenUrl","form","grant_type","redirect_uri","self_contained_token","auth","user","client_id","pass","client_secret","sendImmediately","shouldRefreshAccessToken","then","res","credentials","set","supertoken","catch","statusCode","ErrorConstructor","grantErrors","select","error","_res","requestAccessTokenFromJwt","_ref","_this2","jwt","hydraUri","internal","services","get","slice","process","env","HYDRA_SERVICE_URL","concat","headers","authorization","_ref2","access_token","token_type","expires_in","expiresIn","initServiceCatalogs","createJwt","_ref3","issuer","secretId","displayName","secret","Buffer","from","payload","uuid","jwtToken","sign","resolve","e","version","_applyDecoratedDescriptor2","oneFlight","_getOwnPropertyDescriptor","_default","exports"],"sources":["authorization.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\n/* eslint camelcase: [0] */\r\n\r\nimport {oneFlight, whileInFlight} from '@webex/common';\r\nimport {grantErrors, WebexPlugin} from '@webex/webex-core';\r\n\r\nimport jwt from 'jsonwebtoken';\r\nimport uuid from 'uuid';\r\n\r\n/**\r\n * NodeJS support for OAuth2\r\n * @class\r\n * @name AuthorizationNode\r\n */\r\nconst Authorization = WebexPlugin.extend({\r\n derived: {\r\n /**\r\n * Alias of {@link AuthorizationNode#isAuthorizing}\r\n * @instance\r\n * @memberof AuthorizationNode\r\n * @type {boolean}\r\n */\r\n isAuthenticating: {\r\n deps: ['isAuthorizing'],\r\n fn() {\r\n return this.isAuthorizing;\r\n },\r\n },\r\n },\r\n\r\n session: {\r\n /**\r\n * Indicates if an Authorization Code exchange is inflight\r\n * @instance\r\n * @memberof AuthorizationNode\r\n * @type {boolean}\r\n */\r\n isAuthorizing: {\r\n default: false,\r\n type: 'boolean',\r\n },\r\n },\r\n\r\n namespace: 'Credentials',\r\n\r\n logout(options = {}) {\r\n this.webex.request({\r\n method: 'POST',\r\n uri: this.config.logoutUrl,\r\n body: {\r\n token: options.token,\r\n cisService: this.config.service,\r\n },\r\n });\r\n },\r\n\r\n @whileInFlight('isAuthorizing')\r\n @oneFlight\r\n /**\r\n * Exchanges an authorization code for an access token\r\n * @instance\r\n * @memberof AuthorizationNode\r\n * @param {Object} options\r\n * @param {Object} options.code\r\n * @returns {Promise}\r\n */\r\n requestAuthorizationCodeGrant(options = {}) {\r\n this.logger.info('credentials: requesting authorization code grant');\r\n\r\n if (!options.code) {\r\n return Promise.reject(new Error('`options.code` is required'));\r\n }\r\n\r\n return this.webex\r\n .request({\r\n method: 'POST',\r\n uri: this.config.tokenUrl,\r\n form: {\r\n grant_type: 'authorization_code',\r\n redirect_uri: this.config.redirect_uri,\r\n code: options.code,\r\n self_contained_token: true,\r\n },\r\n auth: {\r\n user: this.config.client_id,\r\n pass: this.config.client_secret,\r\n sendImmediately: true,\r\n },\r\n shouldRefreshAccessToken: false,\r\n })\r\n .then((res) => {\r\n this.webex.credentials.set({supertoken: res.body});\r\n })\r\n .catch((res) => {\r\n if (res.statusCode !== 400) {\r\n return Promise.reject(res);\r\n }\r\n\r\n const ErrorConstructor = grantErrors.select(res.body.error);\r\n\r\n return Promise.reject(new ErrorConstructor(res._res || res));\r\n });\r\n },\r\n\r\n @oneFlight\r\n /**\r\n * Requests a Webex access token for a user already authenticated into\r\n * your product.\r\n *\r\n * Note: You'll need to supply a jwtRefreshCallback of the form\r\n * `Promise<jwt> = jwtRefreshCallback(webex)` for automatic token refresh to\r\n * work.\r\n *\r\n * @instance\r\n * @memberof AuthorizationNode\r\n * @param {Object} options\r\n * @param {Object} options.jwt This is a jwt generated by your backend that\r\n * identifies a user in your system\r\n * @returns {Promise}\r\n */\r\n requestAccessTokenFromJwt({jwt}) {\r\n let hydraUri = this.webex.internal.services.get('hydra', true);\r\n\r\n if (hydraUri && hydraUri.slice(-1) !== '/') {\r\n // add a `/` to hydra's uri from the services catalog so that\r\n // it matches the current env service format.\r\n hydraUri += '/';\r\n }\r\n\r\n hydraUri = hydraUri || process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1/';\r\n\r\n return this.webex\r\n .request({\r\n method: 'POST',\r\n uri: `${hydraUri}jwt/login`,\r\n headers: {\r\n authorization: jwt,\r\n },\r\n })\r\n .then(({body}) => ({\r\n access_token: body.token,\r\n token_type: 'Bearer',\r\n expires_in: body.expiresIn,\r\n }))\r\n .then((token) => {\r\n this.webex.credentials.set({\r\n supertoken: token,\r\n });\r\n })\r\n .then(() => this.webex.internal.services.initServiceCatalogs());\r\n },\r\n\r\n /**\r\n * Creates a jwt user token\r\n * @param {object} options\r\n * @param {String} options.issuer Guest Issuer ID\r\n * @param {String} options.secretId Guest Secret ID\r\n * @param {String} options.displayName Guest Display Name | optional\r\n * @param {String} options.expiresIn\r\n * @returns {Promise<object>}\r\n */\r\n createJwt({issuer, secretId, displayName, expiresIn}) {\r\n const secret = Buffer.from(secretId, 'base64');\r\n const payload = {\r\n \"sub\": `guest-user-${uuid()}`,\r\n \"iss\": issuer,\r\n \"name\": displayName || `Guest User - ${uuid()}`\r\n };\r\n\r\n try {\r\n const jwtToken = jwt.sign(payload, secret,{ expiresIn });\r\n\r\n return Promise.resolve({jwt: jwtToken});\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n },\r\n\r\n});\r\n\r\nexport default Authorization;\r\n"],"mappings":";;;;;;;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAwB,IAAAK,IAAA,EAAAC,IAAA;AAExB;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,GAAGC,sBAAW,CAACC,MAAM,EAA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G,KAAA,CAATH,SAAS;IACjD,IAAMO,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACJ,QAAQ,EAAE,QAAQ,CAAC;IAC9C,IAAMK,OAAO,GAAG;MACd,KAAK,gBAAAjB,MAAA,CAAgB,IAAAkB,aAAI,GAAE,CAAE;MAC7B,KAAK,EAAEP,MAAM;MACb,MAAM,EAAEE,WAAW,oBAAAb,MAAA,CAAoB,IAAAkB,aAAI,GAAE;IAC/C,CAAC;IAED,IAAI;MACF,IAAMC,QAAQ,GAAG5B,qBAAG,CAAC6B,IAAI,CAACH,OAAO,EAAEH,MAAM,EAAC;QAAEP,SAAS,EAATA;MAAU,CAAC,CAAC;MAExD,OAAO9C,QAAA,CAAAvB,OAAA,CAAQmF,OAAO,CAAC;QAAC9B,GAAG,EAAE4B;MAAQ,CAAC,CAAC;IACzC,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,OAAO7D,QAAA,CAAAvB,OAAA,CAAQwB,MAAM,CAAC4D,CAAC,CAAC;IAC1B;EACF,CAAC;EAAAC,OAAA;AAEH,CAAC,OAAAC,0BAAA,CAAAtF,OAAA,EAAAX,IAAA,oCAAAD,IAAA,EAzHEmG,iBAAS,OAAAC,yBAAA,CAAAxF,OAAA,EAAAX,IAAA,oCAAAA,IAAA,OAAAiG,0BAAA,CAAAtF,OAAA,EAAAX,IAAA,gCA+CTkG,iBAAS,OAAAC,yBAAA,CAAAxF,OAAA,EAAAX,IAAA,gCAAAA,IAAA,IAAAA,IAAA,GA0EV;AAAC,IAAAoG,QAAA,GAEYnG,aAAa;AAAAoG,OAAA,CAAA1F,OAAA,GAAAyF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_common","require","_webexCore","_jsonwebtoken","_interopRequireDefault","_uuid","_dec","_obj","Authorization","WebexPlugin","extend","whileInFlight","derived","isAuthenticating","deps","fn","isAuthorizing","session","default","type","namespace","logout","options","arguments","length","undefined","webex","request","method","uri","config","logoutUrl","body","token","cisService","service","requestAuthorizationCodeGrant","_this","logger","info","code","_promise","reject","Error","tokenUrl","form","grant_type","redirect_uri","self_contained_token","auth","user","client_id","pass","client_secret","sendImmediately","shouldRefreshAccessToken","then","res","credentials","set","supertoken","catch","statusCode","ErrorConstructor","grantErrors","select","error","_res","requestAccessTokenFromJwt","_ref","_this2","jwt","hydraUri","internal","services","get","slice","process","env","HYDRA_SERVICE_URL","concat","headers","authorization","_ref2","access_token","token_type","expires_in","expiresIn","initServiceCatalogs","createJwt","_ref3","issuer","secretId","displayName","secret","Buffer","from","payload","uuid","jwtToken","sign","resolve","e","version","_applyDecoratedDescriptor2","oneFlight","_getOwnPropertyDescriptor","_default","exports"],"sources":["authorization.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint camelcase: [0] */\n\nimport {oneFlight, whileInFlight} from '@webex/common';\nimport {grantErrors, WebexPlugin} from '@webex/webex-core';\n\nimport jwt from 'jsonwebtoken';\nimport uuid from 'uuid';\n\n/**\n * NodeJS support for OAuth2\n * @class\n * @name AuthorizationNode\n */\nconst Authorization = WebexPlugin.extend({\n derived: {\n /**\n * Alias of {@link AuthorizationNode#isAuthorizing}\n * @instance\n * @memberof AuthorizationNode\n * @type {boolean}\n */\n isAuthenticating: {\n deps: ['isAuthorizing'],\n fn() {\n return this.isAuthorizing;\n },\n },\n },\n\n session: {\n /**\n * Indicates if an Authorization Code exchange is inflight\n * @instance\n * @memberof AuthorizationNode\n * @type {boolean}\n */\n isAuthorizing: {\n default: false,\n type: 'boolean',\n },\n },\n\n namespace: 'Credentials',\n\n logout(options = {}) {\n this.webex.request({\n method: 'POST',\n uri: this.config.logoutUrl,\n body: {\n token: options.token,\n cisService: this.config.service,\n },\n });\n },\n\n @whileInFlight('isAuthorizing')\n @oneFlight\n /**\n * Exchanges an authorization code for an access token\n * @instance\n * @memberof AuthorizationNode\n * @param {Object} options\n * @param {Object} options.code\n * @returns {Promise}\n */\n requestAuthorizationCodeGrant(options = {}) {\n this.logger.info('credentials: requesting authorization code grant');\n\n if (!options.code) {\n return Promise.reject(new Error('`options.code` is required'));\n }\n\n return this.webex\n .request({\n method: 'POST',\n uri: this.config.tokenUrl,\n form: {\n grant_type: 'authorization_code',\n redirect_uri: this.config.redirect_uri,\n code: options.code,\n self_contained_token: true,\n },\n auth: {\n user: this.config.client_id,\n pass: this.config.client_secret,\n sendImmediately: true,\n },\n shouldRefreshAccessToken: false,\n })\n .then((res) => {\n this.webex.credentials.set({supertoken: res.body});\n })\n .catch((res) => {\n if (res.statusCode !== 400) {\n return Promise.reject(res);\n }\n\n const ErrorConstructor = grantErrors.select(res.body.error);\n\n return Promise.reject(new ErrorConstructor(res._res || res));\n });\n },\n\n @oneFlight\n /**\n * Requests a Webex access token for a user already authenticated into\n * your product.\n *\n * Note: You'll need to supply a jwtRefreshCallback of the form\n * `Promise<jwt> = jwtRefreshCallback(webex)` for automatic token refresh to\n * work.\n *\n * @instance\n * @memberof AuthorizationNode\n * @param {Object} options\n * @param {Object} options.jwt This is a jwt generated by your backend that\n * identifies a user in your system\n * @returns {Promise}\n */\n requestAccessTokenFromJwt({jwt}) {\n let hydraUri = this.webex.internal.services.get('hydra', true);\n\n if (hydraUri && hydraUri.slice(-1) !== '/') {\n // add a `/` to hydra's uri from the services catalog so that\n // it matches the current env service format.\n hydraUri += '/';\n }\n\n hydraUri = hydraUri || process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1/';\n\n return this.webex\n .request({\n method: 'POST',\n uri: `${hydraUri}jwt/login`,\n headers: {\n authorization: jwt,\n },\n })\n .then(({body}) => ({\n access_token: body.token,\n token_type: 'Bearer',\n expires_in: body.expiresIn,\n }))\n .then((token) => {\n this.webex.credentials.set({\n supertoken: token,\n });\n })\n .then(() => this.webex.internal.services.initServiceCatalogs());\n },\n\n /**\n * Creates a jwt user token\n * @param {object} options\n * @param {String} options.issuer Guest Issuer ID\n * @param {String} options.secretId Guest Secret ID\n * @param {String} options.displayName Guest Display Name | optional\n * @param {String} options.expiresIn\n * @returns {Promise<object>}\n */\n createJwt({issuer, secretId, displayName, expiresIn}) {\n const secret = Buffer.from(secretId, 'base64');\n const payload = {\n \"sub\": `guest-user-${uuid()}`,\n \"iss\": issuer,\n \"name\": displayName || `Guest User - ${uuid()}`\n };\n\n try {\n const jwtToken = jwt.sign(payload, secret,{ expiresIn });\n\n return Promise.resolve({jwt: jwtToken});\n } catch (e) {\n return Promise.reject(e);\n }\n },\n\n});\n\nexport default Authorization;\n"],"mappings":";;;;;;;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAwB,IAAAK,IAAA,EAAAC,IAAA;AAExB;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,GAAGC,sBAAW,CAACC,MAAM,EAAAJ,IAAA,GA0CrC,IAAAK,qBAAa,EAAC,eAAe,CAAC,GAAAJ,IAAA,GA1CQ;EACvCK,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;AACA;IACIC,gBAAgB,EAAE;MAChBC,IAAI,EAAE,CAAC,eAAe,CAAC;MACvBC,EAAE,WAAAA,GAAA,EAAG;QACH,OAAO,IAAI,CAACC,aAAa;MAC3B;IACF;EACF,CAAC;EAEDC,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;AACA;IACID,aAAa,EAAE;MACbE,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE;IACR;EACF,CAAC;EAEDC,SAAS,EAAE,aAAa;EAExBC,MAAM,WAAAA,OAAA,EAAe;IAAA,IAAdC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACjB,IAAI,CAACG,KAAK,CAACC,OAAO,CAAC;MACjBC,MAAM,EAAE,MAAM;MACdC,GAAG,EAAE,IAAI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EAAAC,OAAA;AAEH,CAAC,OAAAC,0BAAA,CAAAtF,OAAA,EAAAX,IAAA,oCAAAD,IAAA,EAzHEmG,iBAAS,OAAAC,yBAAA,CAAAxF,OAAA,EAAAX,IAAA,oCAAAA,IAAA,OAAAiG,0BAAA,CAAAtF,OAAA,EAAAX,IAAA,gCA+CTkG,iBAAS,OAAAC,yBAAA,CAAAxF,OAAA,EAAAX,IAAA,gCAAAA,IAAA,IAAAA,IAAA,GA0EV;AAAC,IAAAoG,QAAA,GAEYnG,aAAa;AAAAoG,OAAA,CAAA1F,OAAA,GAAAyF,QAAA"}
|
package/dist/config.js
CHANGED
|
@@ -5,8 +5,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
10
10
|
*/
|
|
11
11
|
var _default = {
|
|
12
12
|
credentials: {}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_default","credentials","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["_default","credentials","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n credentials: {},\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAIe;EACbC,WAAW,EAAE,CAAC;AAChB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
|
package/dist/index.js
CHANGED
|
@@ -21,8 +21,8 @@ require("@webex/internal-plugin-device");
|
|
|
21
21
|
var _webexCore = require("@webex/webex-core");
|
|
22
22
|
var _authorization = _interopRequireDefault(require("./authorization"));
|
|
23
23
|
var _config = _interopRequireDefault(require("./config"));
|
|
24
|
-
/*!
|
|
25
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
24
|
+
/*!
|
|
25
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
var proxies = ['isAuthorizing', 'isAuthenticating'];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_webexCore","_authorization","_interopRequireDefault","_config","proxies","registerPlugin","Authorization","config"],"sources":["index.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["require","_webexCore","_authorization","_interopRequireDefault","_config","proxies","registerPlugin","Authorization","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-device';\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Authorization from './authorization';\nimport config from './config';\n\nconst proxies = ['isAuthorizing', 'isAuthenticating'];\n\nregisterPlugin('authorization', Authorization, {\n config,\n proxies,\n});\n\nexport {default} from './authorization';\nexport {default as config} from './config';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIAA,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AARA;AACA;AACA;;AAQA,IAAMK,OAAO,GAAG,CAAC,eAAe,EAAE,kBAAkB,CAAC;AAErD,IAAAC,yBAAc,EAAC,eAAe,EAAEC,sBAAa,EAAE;EAC7CC,MAAM,EAANA,eAAM;EACNH,OAAO,EAAPA;AACF,CAAC,CAAC"}
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const config = require('@webex/jest-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = config;
|
|
1
|
+
const config = require('@webex/jest-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-authorization-node",
|
|
3
|
+
"version": "2.59.4",
|
|
3
4
|
"description": "",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"main": "dist/index.js",
|
|
@@ -21,35 +22,33 @@
|
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@babel/core": "^7.17.10",
|
|
24
|
-
"@webex/babel-config-legacy": "
|
|
25
|
-
"@webex/eslint-config-legacy": "
|
|
26
|
-
"@webex/jest-config-legacy": "
|
|
27
|
-
"@webex/legacy-tools": "
|
|
28
|
-
"@webex/test-helper-appid": "
|
|
29
|
-
"@webex/test-helper-chai": "
|
|
30
|
-
"@webex/test-helper-mocha": "
|
|
31
|
-
"@webex/test-helper-mock-webex": "
|
|
32
|
-
"@webex/test-helper-test-users": "
|
|
25
|
+
"@webex/babel-config-legacy": "2.59.4",
|
|
26
|
+
"@webex/eslint-config-legacy": "2.59.4",
|
|
27
|
+
"@webex/jest-config-legacy": "2.59.4",
|
|
28
|
+
"@webex/legacy-tools": "2.59.4",
|
|
29
|
+
"@webex/test-helper-appid": "2.59.4",
|
|
30
|
+
"@webex/test-helper-chai": "2.59.4",
|
|
31
|
+
"@webex/test-helper-mocha": "2.59.4",
|
|
32
|
+
"@webex/test-helper-mock-webex": "2.59.4",
|
|
33
|
+
"@webex/test-helper-test-users": "2.59.4",
|
|
33
34
|
"eslint": "^8.24.0",
|
|
34
35
|
"prettier": "^2.7.1",
|
|
35
36
|
"sinon": "^9.2.4"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@webex/common": "
|
|
39
|
-
"@webex/internal-plugin-device": "
|
|
40
|
-
"@webex/webex-core": "
|
|
39
|
+
"@webex/common": "2.59.4",
|
|
40
|
+
"@webex/internal-plugin-device": "2.59.4",
|
|
41
|
+
"@webex/webex-core": "2.59.4",
|
|
41
42
|
"jsonwebtoken": "^9.0.0",
|
|
42
43
|
"uuid": "^3.3.2"
|
|
43
44
|
},
|
|
44
45
|
"scripts": {
|
|
45
46
|
"build": "yarn build:src",
|
|
46
47
|
"build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
|
|
47
|
-
"deploy:npm": "yarn npm publish",
|
|
48
48
|
"test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
|
|
49
49
|
"test:browser": "webex-legacy-tools test --integration --unit --runner karma",
|
|
50
50
|
"test:integration": "webex-legacy-tools test --integration --runner mocha",
|
|
51
51
|
"test:style": "eslint ./src/**/*.*",
|
|
52
52
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
}
|
|
53
|
+
}
|
|
54
|
+
}
|
package/process
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {browser: true};
|
|
1
|
+
module.exports = {browser: true};
|