@webex/internal-plugin-encryption 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 +42 -42
- package/babel.config.js +3 -3
- package/dist/config.js +21 -21
- package/dist/config.js.map +1 -1
- package/dist/encryption.js +57 -57
- package/dist/encryption.js.map +1 -1
- package/dist/ensure-buffer.browser.js +7 -7
- package/dist/ensure-buffer.browser.js.map +1 -1
- package/dist/ensure-buffer.js +7 -7
- package/dist/ensure-buffer.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/kms-batcher.js +38 -38
- package/dist/kms-batcher.js.map +1 -1
- package/dist/kms-certificate-validation.js +50 -50
- package/dist/kms-certificate-validation.js.map +1 -1
- package/dist/kms-dry-error-interceptor.js +15 -15
- package/dist/kms-dry-error-interceptor.js.map +1 -1
- package/dist/kms-errors.js +16 -16
- package/dist/kms-errors.js.map +1 -1
- package/dist/kms.js +171 -171
- package/dist/kms.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +19 -20
- package/process +1 -1
- package/src/config.js +50 -50
- package/src/encryption.js +257 -257
- package/src/ensure-buffer.browser.js +37 -37
- package/src/ensure-buffer.js +20 -20
- package/src/index.js +159 -159
- package/src/kms-batcher.js +158 -158
- package/src/kms-certificate-validation.js +232 -232
- package/src/kms-dry-error-interceptor.js +65 -65
- package/src/kms-errors.js +147 -147
- package/src/kms.js +848 -848
- package/test/integration/spec/encryption.js +448 -448
- package/test/integration/spec/kms.js +800 -800
- package/test/integration/spec/payload-transfom.js +97 -97
- package/test/unit/spec/encryption.js +82 -82
- package/test/unit/spec/kms-certificate-validation.js +165 -165
- package/test/unit/spec/kms.js +103 -103
package/dist/kms-errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","_webexCore","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","KmsError","_Exception","_inherits2","_super","_classCallCheck2","_createClass2","key","value","parse","body","_defineProperties","enumerable","reason","requestId","status","message","defaultMessage","concat","statusCode","errorCode","Exception","exports","_defineProperty2","KmsTimeoutError","_KmsError","_super2","_ref","length","undefined","_ref$request","request","timeout","method","uri","DryError","_WebexHttpError","_super3","_apply","WebexHttpError","_res","options","url","service","toUpperCase","resource","headers","trackingid"],"sources":["kms-errors.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["_common","require","_webexCore","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","KmsError","_Exception","_inherits2","_super","_classCallCheck2","_createClass2","key","value","parse","body","_defineProperties","enumerable","reason","requestId","status","message","defaultMessage","concat","statusCode","errorCode","Exception","exports","_defineProperty2","KmsTimeoutError","_KmsError","_super2","_ref","length","undefined","_ref$request","request","timeout","method","uri","DryError","_WebexHttpError","_super3","_apply","WebexHttpError","_res","options","url","service","toUpperCase","resource","headers","trackingid"],"sources":["kms-errors.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Exception} from '@webex/common';\nimport {WebexHttpError} from '@webex/webex-core';\n\n/**\n * Error class for KMS errors\n */\nexport class KmsError extends Exception {\n static defaultMessage =\n 'An unknown error occurred while communicating with the kms. This implies we received an error response without a body.';\n\n /**\n * @param {HttpResponse} body\n * @returns {string}\n */\n parse(body) {\n body = body.body || body;\n\n Object.defineProperties(this, {\n body: {\n enumerable: false,\n value: body,\n },\n reason: {\n enumerable: false,\n value: body.reason,\n },\n requestId: {\n enumerable: false,\n value: body.requestId,\n },\n status: {\n enumerable: false,\n value: body.status,\n },\n });\n\n let message = typeof body === 'string' ? body : body.reason;\n\n if (!message) {\n message = this.constructor.defaultMessage;\n }\n if (body.status) {\n message += `\\nKMS_RESPONSE_STATUS: ${body.status}`;\n }\n if (body.requestId) {\n message += `\\nKMS_REQUEST_ID: ${body.requestId}`;\n }\n\n if (body.statusCode) {\n message += `\\nKMS_STATUS_CODE: ${body.statusCode}`;\n }\n\n if (body.errorCode) {\n message += `\\nKMS_ErrorCode: ${body.errorCode}`;\n }\n\n return message;\n }\n}\n\n/**\n * Thrown when an expected KMSResponse is not received in a timely manner\n */\nexport class KmsTimeoutError extends KmsError {\n /**\n * @param {KmsRequest} options.request\n * @param {KmsRequest} options.timeout\n * @returns {string}\n */\n parse({request = {}, timeout} = {}) {\n let message = `The KMS did not respond within ${\n timeout ? `${timeout} milliseconds` : 'a timely fashion'\n }`;\n\n if (request) {\n if (request.method && request.uri) {\n message += `\\nKMS_REQUEST: ${request.method} ${request.uri}`;\n }\n\n if (request.requestId) {\n message += `\\nKMS_REQUEST_ID: ${request.requestId}`;\n }\n }\n\n return message;\n }\n}\n\n/**\n * Emitted when a REST request includes an encrypter error\n */\nexport class DryError extends WebexHttpError {\n static defaultMessage = 'An unknown error was received from a service that proxies to the KMS';\n\n /**\n * @param {WebexHttpError} reason\n * @returns {string}\n */\n parse(reason) {\n Reflect.apply(WebexHttpError.prototype.parse, this, [reason._res]);\n const body = reason._res.body.message;\n\n let message = body.reason || body;\n\n if (!message) {\n message = this.constructor.defaultMessage;\n }\n if (this.options.url) {\n message += `\\n${this.options.method} ${this.options.url}`;\n } else if (this.options.uri) {\n message += `\\n${this.options.method} ${this.options.uri}`;\n } else {\n message += `\\n${this.options.method} ${this.options.service.toUpperCase()}/${\n this.options.resource\n }`;\n }\n message += `\\nWEBEX_TRACKING_ID: ${this.options.headers.trackingid}`;\n\n if (body.status) {\n message += `\\nKMS_RESPONSE_STATUS: ${body.status}`;\n }\n if (body.requestId) {\n message += `\\nKMS_REQUEST_ID: ${body.requestId}`;\n }\n\n Object.defineProperties(this, {\n reason: {\n enumerable: false,\n value: body.reason,\n },\n requestId: {\n enumerable: false,\n value: body.requestId,\n },\n status: {\n enumerable: false,\n value: body.status,\n },\n });\n\n return message;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAiD,SAAAE,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA;AAEjD;AACA;AACA;AAFA,IAGaC,QAAQ,0BAAAC,UAAA;EAAA,IAAAC,UAAA,CAAAlB,OAAA,EAAAgB,QAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAA1B,YAAA,CAAAuB,QAAA;EAAA,SAAAA,SAAA;IAAA,IAAAI,gBAAA,CAAApB,OAAA,QAAAgB,QAAA;IAAA,OAAAG,MAAA,CAAAb,KAAA,OAAAD,SAAA;EAAA;EAAA,IAAAgB,aAAA,CAAArB,OAAA,EAAAgB,QAAA;IAAAM,GAAA;IAAAC,KAAA;IAInB;AACF;AACA;AACA;IACE,SAAAC,MAAMC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AAE,OAAA1B,MAAA,CACvE,IAAI,CAACuB,OAAO,CAACI,QAAQ,CACrB;MACJ;MACA7B,OAAO,4BAAAE,MAAA,CAA4B,IAAI,CAACuB,OAAO,CAACK,OAAO,CAACC,UAAU,CAAE;MAEpE,IAAIrC,IAAI,CAACK,MAAM,EAAE;QACfC,OAAO,8BAAAE,MAAA,CAA8BR,IAAI,CAACK,MAAM,CAAE;MACpD;MACA,IAAIL,IAAI,CAACI,SAAS,EAAE;QAClBE,OAAO,yBAAAE,MAAA,CAAyBR,IAAI,CAACI,SAAS,CAAE;MAClD;MAEA,IAAAH,iBAAA,CAAA1B,OAAA,EAAwB,IAAI,EAAE;QAC5B4B,MAAM,EAAE;UACND,UAAU,EAAE,KAAK;UACjBJ,KAAK,EAAEE,IAAI,CAACG;QACd,CAAC;QACDC,SAAS,EAAE;UACTF,UAAU,EAAE,KAAK;UACjBJ,KAAK,EAAEE,IAAI,CAACI;QACd,CAAC;QACDC,MAAM,EAAE;UACNH,UAAU,EAAE,KAAK;UACjBJ,KAAK,EAAEE,IAAI,CAACK;QACd;MACF,CAAC,CAAC;MAEF,OAAOC,OAAO;IAChB;EAAC;EAAA,OAAAmB,QAAA;AAAA,EAlD2BI,yBAAc;AAAAjB,OAAA,CAAAa,QAAA,GAAAA,QAAA;AAAA,IAAAZ,gBAAA,CAAAtC,OAAA,EAA/BkD,QAAQ,oBACK,sEAAsE"}
|
package/dist/kms.js
CHANGED
|
@@ -35,8 +35,8 @@ var kmsDetails = new _weakMap.default();
|
|
|
35
35
|
var partialContexts = new _weakMap.default();
|
|
36
36
|
var consoleDebug = require('debug')('kms');
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* @class
|
|
38
|
+
/**
|
|
39
|
+
* @class
|
|
40
40
|
*/
|
|
41
41
|
var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
42
42
|
keyFactory: function keyFactory(_ref) {
|
|
@@ -49,14 +49,14 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
49
49
|
children: {
|
|
50
50
|
batcher: _kmsBatcher.default
|
|
51
51
|
},
|
|
52
|
-
/**
|
|
53
|
-
* Binds a key to a resource
|
|
54
|
-
* @param {Object} options
|
|
55
|
-
* @param {KMSResourceObject} options.kro
|
|
56
|
-
* @param {string} options.kroUri
|
|
57
|
-
* @param {Key} options.key
|
|
58
|
-
* @param {string} options.keyUri
|
|
59
|
-
* @returns {Promise<Key>}
|
|
52
|
+
/**
|
|
53
|
+
* Binds a key to a resource
|
|
54
|
+
* @param {Object} options
|
|
55
|
+
* @param {KMSResourceObject} options.kro
|
|
56
|
+
* @param {string} options.kroUri
|
|
57
|
+
* @param {Key} options.key
|
|
58
|
+
* @param {string} options.keyUri
|
|
59
|
+
* @returns {Promise<Key>}
|
|
60
60
|
*/
|
|
61
61
|
bindKey: function bindKey(_ref2) {
|
|
62
62
|
var _this = this;
|
|
@@ -86,14 +86,14 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
86
86
|
return res.key;
|
|
87
87
|
});
|
|
88
88
|
},
|
|
89
|
-
/**
|
|
90
|
-
* Creates a new KMS Resource
|
|
91
|
-
* @param {Object} options
|
|
92
|
-
* @param {Array<string>} options.userIds
|
|
93
|
-
* @param {Array<string>} options.keyUris
|
|
94
|
-
* @param {Key} options.key
|
|
95
|
-
* @param {Array<Keys>} options.keys
|
|
96
|
-
* @returns {Promise<KMSResourceObject>}
|
|
89
|
+
/**
|
|
90
|
+
* Creates a new KMS Resource
|
|
91
|
+
* @param {Object} options
|
|
92
|
+
* @param {Array<string>} options.userIds
|
|
93
|
+
* @param {Array<string>} options.keyUris
|
|
94
|
+
* @param {Key} options.key
|
|
95
|
+
* @param {Array<Keys>} options.keys
|
|
96
|
+
* @returns {Promise<KMSResourceObject>}
|
|
97
97
|
*/
|
|
98
98
|
createResource: function createResource(_ref3) {
|
|
99
99
|
var _this2 = this;
|
|
@@ -130,14 +130,14 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
130
130
|
return res.resource;
|
|
131
131
|
});
|
|
132
132
|
},
|
|
133
|
-
/**
|
|
134
|
-
* Authorizes a user or KRO to a KRO
|
|
135
|
-
* @param {Object} options
|
|
136
|
-
* @param {Array<string>} options.userIds
|
|
137
|
-
* @param {Array<string>} options.authIds interchangable with userIds
|
|
138
|
-
* @param {KMSResourceObject} options.kro the target kro
|
|
139
|
-
* @param {string} options.kroUri
|
|
140
|
-
* @returns {Promise<KMSAuthorizationObject>}
|
|
133
|
+
/**
|
|
134
|
+
* Authorizes a user or KRO to a KRO
|
|
135
|
+
* @param {Object} options
|
|
136
|
+
* @param {Array<string>} options.userIds
|
|
137
|
+
* @param {Array<string>} options.authIds interchangable with userIds
|
|
138
|
+
* @param {KMSResourceObject} options.kro the target kro
|
|
139
|
+
* @param {string} options.kroUri
|
|
140
|
+
* @returns {Promise<KMSAuthorizationObject>}
|
|
141
141
|
*/
|
|
142
142
|
addAuthorization: function addAuthorization(_ref4) {
|
|
143
143
|
var _this3 = this;
|
|
@@ -171,12 +171,12 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
171
171
|
return res.authorizations;
|
|
172
172
|
});
|
|
173
173
|
},
|
|
174
|
-
/**
|
|
175
|
-
* Retrieve a list of users that have been authorized to the KRO
|
|
176
|
-
* @param {Object} options
|
|
177
|
-
* @param {KMSResourceObject} options.kro the target kro
|
|
178
|
-
* @param {string} options.kroUri
|
|
179
|
-
* @returns {Array<authId>}
|
|
174
|
+
/**
|
|
175
|
+
* Retrieve a list of users that have been authorized to the KRO
|
|
176
|
+
* @param {Object} options
|
|
177
|
+
* @param {KMSResourceObject} options.kro the target kro
|
|
178
|
+
* @param {string} options.kroUri
|
|
179
|
+
* @returns {Array<authId>}
|
|
180
180
|
*/
|
|
181
181
|
listAuthorizations: function listAuthorizations(_ref5) {
|
|
182
182
|
var _this4 = this;
|
|
@@ -195,14 +195,14 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
195
195
|
return res.authorizations;
|
|
196
196
|
});
|
|
197
197
|
},
|
|
198
|
-
/**
|
|
199
|
-
* Deauthorizes a user or KRO from a KRO
|
|
200
|
-
* @param {Object} options
|
|
201
|
-
* @param {string} options.userId
|
|
202
|
-
* @param {string} options.authId interchangable with userIds
|
|
203
|
-
* @param {KMSResourceObject} options.kro the target kro
|
|
204
|
-
* @param {string} options.kroUri
|
|
205
|
-
* @returns {Promise<KMSAuthorizationObject>}
|
|
198
|
+
/**
|
|
199
|
+
* Deauthorizes a user or KRO from a KRO
|
|
200
|
+
* @param {Object} options
|
|
201
|
+
* @param {string} options.userId
|
|
202
|
+
* @param {string} options.authId interchangable with userIds
|
|
203
|
+
* @param {KMSResourceObject} options.kro the target kro
|
|
204
|
+
* @param {string} options.kroUri
|
|
205
|
+
* @returns {Promise<KMSAuthorizationObject>}
|
|
206
206
|
*/
|
|
207
207
|
removeAuthorization: function removeAuthorization(_ref6) {
|
|
208
208
|
var _this5 = this;
|
|
@@ -233,11 +233,11 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
233
233
|
return res.authorizations;
|
|
234
234
|
});
|
|
235
235
|
},
|
|
236
|
-
/**
|
|
237
|
-
* Requests `count` unbound keys from the kms
|
|
238
|
-
* @param {Object} options
|
|
239
|
-
* @param {Number} options.count
|
|
240
|
-
* @returns {Array<Key>}
|
|
236
|
+
/**
|
|
237
|
+
* Requests `count` unbound keys from the kms
|
|
238
|
+
* @param {Object} options
|
|
239
|
+
* @param {Number} options.count
|
|
240
|
+
* @returns {Array<Key>}
|
|
241
241
|
*/
|
|
242
242
|
createUnboundKeys: function createUnboundKeys(_ref7) {
|
|
243
243
|
var _this6 = this;
|
|
@@ -257,17 +257,17 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
257
257
|
return _promise.default.all(res.keys.map(_this6.asKey));
|
|
258
258
|
});
|
|
259
259
|
},
|
|
260
|
-
/**
|
|
261
|
-
* @typedef {Object} FetchPublicKeyResponse
|
|
262
|
-
* @property {number} status 200,400(Bad Request: Request payload missing info),404(Not Found: HSM Public Key not found),501(Not Implemented: This KMS does not support BYOK),502(Bad Gateway: KMS could not communicate with HSM)
|
|
263
|
-
* @property {UUID} requestId this is should be unique, used for debug.
|
|
264
|
-
* @property {string} publicKey
|
|
260
|
+
/**
|
|
261
|
+
* @typedef {Object} FetchPublicKeyResponse
|
|
262
|
+
* @property {number} status 200,400(Bad Request: Request payload missing info),404(Not Found: HSM Public Key not found),501(Not Implemented: This KMS does not support BYOK),502(Bad Gateway: KMS could not communicate with HSM)
|
|
263
|
+
* @property {UUID} requestId this is should be unique, used for debug.
|
|
264
|
+
* @property {string} publicKey
|
|
265
265
|
*/
|
|
266
|
-
/**
|
|
267
|
-
* get public key from kms
|
|
268
|
-
* @param {Object} options
|
|
269
|
-
* @param {UUID} options.assignedOrgId the orgId
|
|
270
|
-
* @returns {Promise.<FetchPublicKeyResponse>} response of get public key api
|
|
266
|
+
/**
|
|
267
|
+
* get public key from kms
|
|
268
|
+
* @param {Object} options
|
|
269
|
+
* @param {UUID} options.assignedOrgId the orgId
|
|
270
|
+
* @returns {Promise.<FetchPublicKeyResponse>} response of get public key api
|
|
271
271
|
*/
|
|
272
272
|
fetchPublicKey: function fetchPublicKey(_ref8) {
|
|
273
273
|
var _this7 = this;
|
|
@@ -282,20 +282,20 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
282
282
|
return res.publicKey;
|
|
283
283
|
});
|
|
284
284
|
},
|
|
285
|
-
/**
|
|
286
|
-
* @typedef {Object} UploadCmkResponse
|
|
287
|
-
* @property {number} status
|
|
288
|
-
* @property {UUID} requestId
|
|
289
|
-
* @property {string} uri
|
|
290
|
-
* @property {string} keysState
|
|
285
|
+
/**
|
|
286
|
+
* @typedef {Object} UploadCmkResponse
|
|
287
|
+
* @property {number} status
|
|
288
|
+
* @property {UUID} requestId
|
|
289
|
+
* @property {string} uri
|
|
290
|
+
* @property {string} keysState
|
|
291
291
|
*/
|
|
292
|
-
/**
|
|
293
|
-
* upload master key for one org.
|
|
294
|
-
* @param {Object} options
|
|
295
|
-
* @param {UUID} options.assignedOrgId the orgId
|
|
296
|
-
* @param {string} options.customerMasterKey the master key
|
|
297
|
-
* @param {boolean} options.awsKms enable amazon aws keys
|
|
298
|
-
* @returns {Promise.<UploadCmkResponse>} response of upload CMK api
|
|
292
|
+
/**
|
|
293
|
+
* upload master key for one org.
|
|
294
|
+
* @param {Object} options
|
|
295
|
+
* @param {UUID} options.assignedOrgId the orgId
|
|
296
|
+
* @param {string} options.customerMasterKey the master key
|
|
297
|
+
* @param {boolean} options.awsKms enable amazon aws keys
|
|
298
|
+
* @returns {Promise.<UploadCmkResponse>} response of upload CMK api
|
|
299
299
|
*/
|
|
300
300
|
uploadCustomerMasterKey: function uploadCustomerMasterKey(_ref9) {
|
|
301
301
|
var _this8 = this;
|
|
@@ -315,12 +315,12 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
315
315
|
return res;
|
|
316
316
|
});
|
|
317
317
|
},
|
|
318
|
-
/**
|
|
319
|
-
* get all customer master keys for one org.
|
|
320
|
-
* @param {Object} options
|
|
321
|
-
* @param {UUID} options.assignedOrgId the orgId
|
|
322
|
-
* @param {boolean} options.awsKms enable amazon aws keys
|
|
323
|
-
* @returns {Promise.<ActivateCmkResponse>} response of list CMKs api
|
|
318
|
+
/**
|
|
319
|
+
* get all customer master keys for one org.
|
|
320
|
+
* @param {Object} options
|
|
321
|
+
* @param {UUID} options.assignedOrgId the orgId
|
|
322
|
+
* @param {boolean} options.awsKms enable amazon aws keys
|
|
323
|
+
* @returns {Promise.<ActivateCmkResponse>} response of list CMKs api
|
|
324
324
|
*/
|
|
325
325
|
listAllCustomerMasterKey: function listAllCustomerMasterKey(_ref10) {
|
|
326
326
|
var _this9 = this;
|
|
@@ -338,32 +338,32 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
338
338
|
return res;
|
|
339
339
|
});
|
|
340
340
|
},
|
|
341
|
-
/**
|
|
342
|
-
* @typedef {Object} ActivateCmkResponse
|
|
343
|
-
* @property {number} status
|
|
344
|
-
* @property {UUID} requestId
|
|
345
|
-
* @property {Array<CMK>} customerMasterKeys
|
|
341
|
+
/**
|
|
342
|
+
* @typedef {Object} ActivateCmkResponse
|
|
343
|
+
* @property {number} status
|
|
344
|
+
* @property {UUID} requestId
|
|
345
|
+
* @property {Array<CMK>} customerMasterKeys
|
|
346
346
|
*/
|
|
347
|
-
/**
|
|
348
|
-
*
|
|
349
|
-
* @typedef {Object} CMK
|
|
350
|
-
* @property {string} usageState
|
|
351
|
-
* @property {UUID} assignedOrgId
|
|
352
|
-
* @property {string} uri
|
|
353
|
-
* @property {string} source
|
|
354
|
-
* @property {Date | undefined} stateUpdatedOn
|
|
355
|
-
* @property {Date | undefined} rotation
|
|
347
|
+
/**
|
|
348
|
+
*
|
|
349
|
+
* @typedef {Object} CMK
|
|
350
|
+
* @property {string} usageState
|
|
351
|
+
* @property {UUID} assignedOrgId
|
|
352
|
+
* @property {string} uri
|
|
353
|
+
* @property {string} source
|
|
354
|
+
* @property {Date | undefined} stateUpdatedOn
|
|
355
|
+
* @property {Date | undefined} rotation
|
|
356
356
|
*/
|
|
357
|
-
/**
|
|
358
|
-
* change one customer master key state for one org.
|
|
359
|
-
* delete pending key, then the keyState should be 'removedclean';
|
|
360
|
-
* active pending key, then the keyState should be 'active';
|
|
361
|
-
*
|
|
362
|
-
* @param {Object} options
|
|
363
|
-
* @param {string} options.keyId the id of one customer master key, it should be a url
|
|
364
|
-
* @param {string} options.keyState one of the following: PENDING, RECOVERING,ACTIVE,REVOKED,DEACTIVATED,REENCRYPTING,RETIRED,DELETED,DISABLED,REMOVEDCLEAN,REMOVEDDIRTY;
|
|
365
|
-
* @param {UUID} options.assignedOrgId the orgId
|
|
366
|
-
* @returns {Promise.<ActivateCmkResponse>} response of list CMKs api
|
|
357
|
+
/**
|
|
358
|
+
* change one customer master key state for one org.
|
|
359
|
+
* delete pending key, then the keyState should be 'removedclean';
|
|
360
|
+
* active pending key, then the keyState should be 'active';
|
|
361
|
+
*
|
|
362
|
+
* @param {Object} options
|
|
363
|
+
* @param {string} options.keyId the id of one customer master key, it should be a url
|
|
364
|
+
* @param {string} options.keyState one of the following: PENDING, RECOVERING,ACTIVE,REVOKED,DEACTIVATED,REENCRYPTING,RETIRED,DELETED,DISABLED,REMOVEDCLEAN,REMOVEDDIRTY;
|
|
365
|
+
* @param {UUID} options.assignedOrgId the orgId
|
|
366
|
+
* @returns {Promise.<ActivateCmkResponse>} response of list CMKs api
|
|
367
367
|
*/
|
|
368
368
|
changeCustomerMasterKeyState: function changeCustomerMasterKeyState(_ref11) {
|
|
369
369
|
var _this10 = this;
|
|
@@ -382,12 +382,12 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
382
382
|
return res;
|
|
383
383
|
});
|
|
384
384
|
},
|
|
385
|
-
/**
|
|
386
|
-
* this is for test case. it will delete all CMKs, no matter what their status is. This is mainly for test purpose
|
|
387
|
-
* @param {Object} options
|
|
388
|
-
* @param {UUID} options.assignedOrgId the orgId
|
|
389
|
-
* @param {boolean} options.awsKms enable amazon aws keys
|
|
390
|
-
* @returns {Promise.<{status, requestId}>}
|
|
385
|
+
/**
|
|
386
|
+
* this is for test case. it will delete all CMKs, no matter what their status is. This is mainly for test purpose
|
|
387
|
+
* @param {Object} options
|
|
388
|
+
* @param {UUID} options.assignedOrgId the orgId
|
|
389
|
+
* @param {boolean} options.awsKms enable amazon aws keys
|
|
390
|
+
* @returns {Promise.<{status, requestId}>}
|
|
391
391
|
*/
|
|
392
392
|
deleteAllCustomerMasterKeys: function deleteAllCustomerMasterKeys(_ref12) {
|
|
393
393
|
var _this11 = this;
|
|
@@ -405,11 +405,11 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
405
405
|
return res;
|
|
406
406
|
});
|
|
407
407
|
},
|
|
408
|
-
/**
|
|
409
|
-
* return to use global master key for one org.
|
|
410
|
-
* @param {Object} options
|
|
411
|
-
* @param {UUID} options.assignedOrgId the orgId
|
|
412
|
-
* @returns {Promise.<ActivateCmkResponse>} response of activate CMK api
|
|
408
|
+
/**
|
|
409
|
+
* return to use global master key for one org.
|
|
410
|
+
* @param {Object} options
|
|
411
|
+
* @param {UUID} options.assignedOrgId the orgId
|
|
412
|
+
* @returns {Promise.<ActivateCmkResponse>} response of activate CMK api
|
|
413
413
|
*/
|
|
414
414
|
useGlobalMasterKey: function useGlobalMasterKey(_ref13) {
|
|
415
415
|
var _this12 = this;
|
|
@@ -445,9 +445,9 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
445
445
|
return _this13.asKey(res.key);
|
|
446
446
|
});
|
|
447
447
|
},
|
|
448
|
-
/**
|
|
449
|
-
* Pings the kms. Mostly for testing
|
|
450
|
-
* @returns {Promise}
|
|
448
|
+
/**
|
|
449
|
+
* Pings the kms. Mostly for testing
|
|
450
|
+
* @returns {Promise}
|
|
451
451
|
*/
|
|
452
452
|
ping: function ping() {
|
|
453
453
|
return this.request({
|
|
@@ -455,10 +455,10 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
455
455
|
uri: '/ping'
|
|
456
456
|
});
|
|
457
457
|
},
|
|
458
|
-
/**
|
|
459
|
-
* Ensures a key obect is Key instance
|
|
460
|
-
* @param {Object} key
|
|
461
|
-
* @returns {Promise<Key>}
|
|
458
|
+
/**
|
|
459
|
+
* Ensures a key obect is Key instance
|
|
460
|
+
* @param {Object} key
|
|
461
|
+
* @returns {Promise<Key>}
|
|
462
462
|
*/
|
|
463
463
|
asKey: function asKey(key) {
|
|
464
464
|
return _nodeJose.default.JWK.asKey(key.jwk).then(function (jwk) {
|
|
@@ -466,11 +466,11 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
466
466
|
return key;
|
|
467
467
|
});
|
|
468
468
|
},
|
|
469
|
-
/**
|
|
470
|
-
* Adds appropriate metadata to the KMS request
|
|
471
|
-
* @param {Object} payload
|
|
472
|
-
* @param {Object} onBehalfOf Optional parameter to prepare the request on behalf of another user
|
|
473
|
-
* @returns {Promise<KMS.Request>}
|
|
469
|
+
/**
|
|
470
|
+
* Adds appropriate metadata to the KMS request
|
|
471
|
+
* @param {Object} payload
|
|
472
|
+
* @param {Object} onBehalfOf Optional parameter to prepare the request on behalf of another user
|
|
473
|
+
* @returns {Promise<KMS.Request>}
|
|
474
474
|
*/
|
|
475
475
|
prepareRequest: function prepareRequest(payload, onBehalfOf) {
|
|
476
476
|
var _this14 = this;
|
|
@@ -495,10 +495,10 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
495
495
|
});
|
|
496
496
|
});
|
|
497
497
|
},
|
|
498
|
-
/**
|
|
499
|
-
* Accepts a kms message event, decrypts it, and passes it to the batcher
|
|
500
|
-
* @param {Object} event
|
|
501
|
-
* @returns {Promise<Object>}
|
|
498
|
+
/**
|
|
499
|
+
* Accepts a kms message event, decrypts it, and passes it to the batcher
|
|
500
|
+
* @param {Object} event
|
|
501
|
+
* @returns {Promise<Object>}
|
|
502
502
|
*/
|
|
503
503
|
processKmsMessageEvent: function processKmsMessageEvent(event) {
|
|
504
504
|
var _this15 = this;
|
|
@@ -538,10 +538,10 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
538
538
|
return event;
|
|
539
539
|
});
|
|
540
540
|
},
|
|
541
|
-
/**
|
|
542
|
-
* Decrypts a kms message
|
|
543
|
-
* @param {Object} kmsMessage
|
|
544
|
-
* @returns {Promise<Object>}
|
|
541
|
+
/**
|
|
542
|
+
* Decrypts a kms message
|
|
543
|
+
* @param {Object} kmsMessage
|
|
544
|
+
* @returns {Promise<Object>}
|
|
545
545
|
*/
|
|
546
546
|
decryptKmsMessage: function decryptKmsMessage(kmsMessage) {
|
|
547
547
|
var res = new _nodeKms.Response(kmsMessage);
|
|
@@ -551,10 +551,10 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
551
551
|
return res.body;
|
|
552
552
|
});
|
|
553
553
|
},
|
|
554
|
-
/**
|
|
555
|
-
* Determines if the kms message is an ecdhe message or a normal message
|
|
556
|
-
* @param {Object} kmsMessage
|
|
557
|
-
* @returns {Promise<boolean>}
|
|
554
|
+
/**
|
|
555
|
+
* Determines if the kms message is an ecdhe message or a normal message
|
|
556
|
+
* @param {Object} kmsMessage
|
|
557
|
+
* @returns {Promise<boolean>}
|
|
558
558
|
*/
|
|
559
559
|
_isECDHEMessage: function _isECDHEMessage(kmsMessage) {
|
|
560
560
|
return this._getKMSStaticPubKey().then(function (kmsStaticPubKey) {
|
|
@@ -566,13 +566,13 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
566
566
|
return header.kid === kmsStaticPubKey.kid;
|
|
567
567
|
});
|
|
568
568
|
},
|
|
569
|
-
/**
|
|
570
|
-
* Sends a request to the kms
|
|
571
|
-
* @param {Object} payload
|
|
572
|
-
* @param {Object} options
|
|
573
|
-
* @param {Number} options.timeout (internal)
|
|
574
|
-
* @param {string} options.onBehalfOf Run the request on behalf of another user (UUID), used in compliance scenarios
|
|
575
|
-
* @returns {Promise<Object>}
|
|
569
|
+
/**
|
|
570
|
+
* Sends a request to the kms
|
|
571
|
+
* @param {Object} payload
|
|
572
|
+
* @param {Object} options
|
|
573
|
+
* @param {Number} options.timeout (internal)
|
|
574
|
+
* @param {string} options.onBehalfOf Run the request on behalf of another user (UUID), used in compliance scenarios
|
|
575
|
+
* @returns {Promise<Object>}
|
|
576
576
|
*/
|
|
577
577
|
request: function request(payload) {
|
|
578
578
|
var _this16 = this;
|
|
@@ -642,19 +642,19 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
642
642
|
return _promise.default.reject(reason);
|
|
643
643
|
});
|
|
644
644
|
},
|
|
645
|
-
/**
|
|
646
|
-
* @private
|
|
647
|
-
* @returns {Promise<string>}
|
|
645
|
+
/**
|
|
646
|
+
* @private
|
|
647
|
+
* @returns {Promise<string>}
|
|
648
648
|
*/
|
|
649
649
|
_getAuthorization: function _getAuthorization() {
|
|
650
650
|
return this.webex.credentials.getUserToken('spark:kms').then(function (token) {
|
|
651
651
|
return token.access_token;
|
|
652
652
|
});
|
|
653
653
|
},
|
|
654
|
-
/**
|
|
655
|
-
* @private
|
|
656
|
-
* @param {String} onBehalfOf create context on behalf of another user, undefined when this is not necessary
|
|
657
|
-
* @returns {Promise<Object>}
|
|
654
|
+
/**
|
|
655
|
+
* @private
|
|
656
|
+
* @param {String} onBehalfOf create context on behalf of another user, undefined when this is not necessary
|
|
657
|
+
* @returns {Promise<Object>}
|
|
658
658
|
*/
|
|
659
659
|
_getContext: function _getContext() {
|
|
660
660
|
var _this17 = this;
|
|
@@ -677,9 +677,9 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
677
677
|
return context;
|
|
678
678
|
});
|
|
679
679
|
},
|
|
680
|
-
/**
|
|
681
|
-
* @private
|
|
682
|
-
* @returns {Promise<Object>}
|
|
680
|
+
/**
|
|
681
|
+
* @private
|
|
682
|
+
* @returns {Promise<Object>}
|
|
683
683
|
*/
|
|
684
684
|
_getKMSCluster: function _getKMSCluster() {
|
|
685
685
|
this.logger.info('kms: retrieving KMS cluster');
|
|
@@ -688,9 +688,9 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
688
688
|
return kmsCluster;
|
|
689
689
|
});
|
|
690
690
|
},
|
|
691
|
-
/**
|
|
692
|
-
* @private
|
|
693
|
-
* @returns {Promise<Object>}
|
|
691
|
+
/**
|
|
692
|
+
* @private
|
|
693
|
+
* @returns {Promise<Object>}
|
|
694
694
|
*/
|
|
695
695
|
_getKMSDetails: function _getKMSDetails() {
|
|
696
696
|
var _this18 = this;
|
|
@@ -713,9 +713,9 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
713
713
|
}
|
|
714
714
|
return details;
|
|
715
715
|
},
|
|
716
|
-
/**
|
|
717
|
-
* @private
|
|
718
|
-
* @returns {Promise<Object>}
|
|
716
|
+
/**
|
|
717
|
+
* @private
|
|
718
|
+
* @returns {Promise<Object>}
|
|
719
719
|
*/
|
|
720
720
|
_getKMSStaticPubKey: function _getKMSStaticPubKey() {
|
|
721
721
|
this.logger.info('kms: retrieving KMS static public key');
|
|
@@ -724,9 +724,9 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
724
724
|
return rsaPublicKey;
|
|
725
725
|
});
|
|
726
726
|
},
|
|
727
|
-
/**
|
|
728
|
-
* @private
|
|
729
|
-
* @returns {Promise<Object>}
|
|
727
|
+
/**
|
|
728
|
+
* @private
|
|
729
|
+
* @returns {Promise<Object>}
|
|
730
730
|
*/
|
|
731
731
|
_prepareContext: function _prepareContext() {
|
|
732
732
|
var _this19 = this;
|
|
@@ -775,17 +775,17 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
775
775
|
return _promise.default.reject(reason);
|
|
776
776
|
});
|
|
777
777
|
},
|
|
778
|
-
/**
|
|
779
|
-
* KMS 'retrieve' requests can be made on behalf of another user. This is useful
|
|
780
|
-
* for scenarios such as eDiscovery. i.e. Where an authorized compliance officer is
|
|
781
|
-
* entitled to retrieve content generated by any organisational user.
|
|
782
|
-
* As the KMSContext is cached, updating it will affect separate requests. Hence when
|
|
783
|
-
* making a request onBehalfOf another user create a new context for just this request.
|
|
784
|
-
* However this context will be 'light' as it only needs to change one field.
|
|
785
|
-
* @param {Object} originalContext - The base context to 'copy'
|
|
786
|
-
* @param {String} onBehalfOf - The user specified in the new context
|
|
787
|
-
* @returns {Context} A 'copy' of the existing context with a new user specified
|
|
788
|
-
* @private
|
|
778
|
+
/**
|
|
779
|
+
* KMS 'retrieve' requests can be made on behalf of another user. This is useful
|
|
780
|
+
* for scenarios such as eDiscovery. i.e. Where an authorized compliance officer is
|
|
781
|
+
* entitled to retrieve content generated by any organisational user.
|
|
782
|
+
* As the KMSContext is cached, updating it will affect separate requests. Hence when
|
|
783
|
+
* making a request onBehalfOf another user create a new context for just this request.
|
|
784
|
+
* However this context will be 'light' as it only needs to change one field.
|
|
785
|
+
* @param {Object} originalContext - The base context to 'copy'
|
|
786
|
+
* @param {String} onBehalfOf - The user specified in the new context
|
|
787
|
+
* @returns {Context} A 'copy' of the existing context with a new user specified
|
|
788
|
+
* @private
|
|
789
789
|
*/
|
|
790
790
|
_contextOnBehalfOf: function _contextOnBehalfOf(originalContext, onBehalfOf) {
|
|
791
791
|
var context = new _nodeKms.Context();
|
|
@@ -802,7 +802,7 @@ var KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
802
802
|
context.ephemeralKey = originalContext.ephemeralKey;
|
|
803
803
|
return context;
|
|
804
804
|
},
|
|
805
|
-
version: "2.59.
|
|
805
|
+
version: "2.59.4"
|
|
806
806
|
}, ((0, _applyDecoratedDescriptor2.default)(_obj, "fetchKey", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "fetchKey"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "_getContext", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "_getContext"), _obj)), _obj)));
|
|
807
807
|
var _default = KMS;
|
|
808
808
|
exports.default = _default;
|