@webex/test-helper-appid 2.42.0 → 2.43.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","makeLocalUrl","module","exports","createUser","options","fetch","method","headers","Headers","body","then","res","json","jwt"],"sources":["create-user.browser.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nrequire('whatwg-fetch');\nconst makeLocalUrl = require('@webex/test-helper-make-local-url');\n\n/* eslint-env browser */\n\nmodule.exports = function createUser(options) {\n return fetch(makeLocalUrl('/jwt'), {\n method: 'POST',\n headers: new Headers({\n 'content-type': 'application/json',\n }),\n body: JSON.stringify(options),\n })\n .then((res) => res.json())\n .then((body) => body.jwt);\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEAA,OAAO,CAAC,cAAc,CAAC;AACvB,IAAMC,YAAY,GAAGD,OAAO,CAAC,mCAAmC,CAAC;;AAEjE;;AAEAE,MAAM,CAACC,OAAO,GAAG,SAASC,
|
|
1
|
+
{"version":3,"names":["require","makeLocalUrl","module","exports","createUser","options","fetch","method","headers","Headers","body","_stringify","default","then","res","json","jwt"],"sources":["create-user.browser.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nrequire('whatwg-fetch');\nconst makeLocalUrl = require('@webex/test-helper-make-local-url');\n\n/* eslint-env browser */\n\nmodule.exports = function createUser(options) {\n return fetch(makeLocalUrl('/jwt'), {\n method: 'POST',\n headers: new Headers({\n 'content-type': 'application/json',\n }),\n body: JSON.stringify(options),\n })\n .then((res) => res.json())\n .then((body) => body.jwt);\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEAA,OAAO,CAAC,cAAc,CAAC;AACvB,IAAMC,YAAY,GAAGD,OAAO,CAAC,mCAAmC,CAAC;;AAEjE;;AAEAE,MAAM,CAACC,OAAO,GAAG,SAASC,UAAUA,CAACC,OAAO,EAAE;EAC5C,OAAOC,KAAK,CAACL,YAAY,CAAC,MAAM,CAAC,EAAE;IACjCM,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE,IAAIC,OAAO,CAAC;MACnB,cAAc,EAAE;IAClB,CAAC,CAAC;IACFC,IAAI,EAAE,IAAAC,UAAA,CAAAC,OAAA,EAAeP,OAAO;EAC9B,CAAC,CAAC,CACCQ,IAAI,CAAC,UAACC,GAAG;IAAA,OAAKA,GAAG,CAACC,IAAI,EAAE;EAAA,EAAC,CACzBF,IAAI,CAAC,UAACH,IAAI;IAAA,OAAKA,IAAI,CAACM,GAAG;EAAA,EAAC;AAC7B,CAAC"}
|
package/dist/create-user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jwt","require","uuid","Buffer","module","exports","createUser","displayName","expiresInSeconds","issuer","userId","payload","name","options","expiresIn","process","env","WEBEX_APPID_ORGID","subject","v4","secret","from","WEBEX_APPID_SECRET","jwtToken","sign","resolve","e","reject"],"sources":["create-user.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst jwt = require('jsonwebtoken');\nconst uuid = require('uuid');\nconst {Buffer} = require('safe-buffer');\n\n/**\n * Creates a jwt user token\n * @param {object} options\n * @param {String} options.displayName *required*\n * @param {Number} options.expiresInSeconds\n * @param {String} options.issuer Guest Issuer ID\n * @param {String} options.userId *no spaces*\n * @returns {Promise<object>}\n */\nmodule.exports = function createUser({displayName, expiresInSeconds, issuer, userId}) {\n const payload = {\n name: displayName,\n };\n const options = {\n expiresIn: expiresInSeconds || 90 * 60,\n issuer: issuer || process.env.WEBEX_APPID_ORGID,\n subject: userId || uuid.v4(),\n };\n const secret = Buffer.from(process.env.WEBEX_APPID_SECRET, 'base64');\n\n try {\n const jwtToken = jwt.sign(payload, secret, options);\n\n return Promise.resolve({\n jwt: jwtToken,\n secret: process.env.WEBEX_APPID_SECRET,\n });\n } catch (e) {\n return Promise.reject(e);\n }\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA,IAAMA,GAAG,GAAGC,OAAO,CAAC,cAAc,CAAC;AACnC,IAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAC5B,
|
|
1
|
+
{"version":3,"names":["jwt","require","uuid","_require","Buffer","module","exports","createUser","_ref","displayName","expiresInSeconds","issuer","userId","payload","name","options","expiresIn","process","env","WEBEX_APPID_ORGID","subject","v4","secret","from","WEBEX_APPID_SECRET","jwtToken","sign","_promise","default","resolve","e","reject"],"sources":["create-user.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst jwt = require('jsonwebtoken');\nconst uuid = require('uuid');\nconst {Buffer} = require('safe-buffer');\n\n/**\n * Creates a jwt user token\n * @param {object} options\n * @param {String} options.displayName *required*\n * @param {Number} options.expiresInSeconds\n * @param {String} options.issuer Guest Issuer ID\n * @param {String} options.userId *no spaces*\n * @returns {Promise<object>}\n */\nmodule.exports = function createUser({displayName, expiresInSeconds, issuer, userId}) {\n const payload = {\n name: displayName,\n };\n const options = {\n expiresIn: expiresInSeconds || 90 * 60,\n issuer: issuer || process.env.WEBEX_APPID_ORGID,\n subject: userId || uuid.v4(),\n };\n const secret = Buffer.from(process.env.WEBEX_APPID_SECRET, 'base64');\n\n try {\n const jwtToken = jwt.sign(payload, secret, options);\n\n return Promise.resolve({\n jwt: jwtToken,\n secret: process.env.WEBEX_APPID_SECRET,\n });\n } catch (e) {\n return Promise.reject(e);\n }\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA,IAAMA,GAAG,GAAGC,OAAO,CAAC,cAAc,CAAC;AACnC,IAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAC5B,IAAAE,QAAA,GAAiBF,OAAO,CAAC,aAAa,CAAC;EAAhCG,MAAM,GAAAD,QAAA,CAANC,MAAM;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,MAAM,CAACC,OAAO,GAAG,SAASC,UAAUA,CAAAC,IAAA,EAAkD;EAAA,IAAhDC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,gBAAgB,GAAAF,IAAA,CAAhBE,gBAAgB;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM;IAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;EACjF,IAAMC,OAAO,GAAG;IACdC,IAAI,EAAEL;EACR,CAAC;EACD,IAAMM,OAAO,GAAG;IACdC,SAAS,EAAEN,gBAAgB,IAAI,EAAE,GAAG,EAAE;IACtCC,MAAM,EAAEA,MAAM,IAAIM,OAAO,CAACC,GAAG,CAACC,iBAAiB;IAC/CC,OAAO,EAAER,MAAM,IAAIV,IAAI,CAACmB,EAAE;EAC5B,CAAC;EACD,IAAMC,MAAM,GAAGlB,MAAM,CAACmB,IAAI,CAACN,OAAO,CAACC,GAAG,CAACM,kBAAkB,EAAE,QAAQ,CAAC;EAEpE,IAAI;IACF,IAAMC,QAAQ,GAAGzB,GAAG,CAAC0B,IAAI,CAACb,OAAO,EAAES,MAAM,EAAEP,OAAO,CAAC;IAEnD,OAAOY,QAAA,CAAAC,OAAA,CAAQC,OAAO,CAAC;MACrB7B,GAAG,EAAEyB,QAAQ;MACbH,MAAM,EAAEL,OAAO,CAACC,GAAG,CAACM;IACtB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOM,CAAC,EAAE;IACV,OAAOH,QAAA,CAAAC,OAAA,CAAQG,MAAM,CAACD,CAAC,CAAC;EAC1B;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/test-helper-appid",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./src/router.js": false
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@webex/test-helper-make-local-url": "2.
|
|
23
|
+
"@webex/test-helper-make-local-url": "2.43.0",
|
|
24
24
|
"body-parser": "^1.19.0",
|
|
25
25
|
"express": "^4.17.1",
|
|
26
26
|
"jsonwebtoken": "^8.5.1",
|