@webex/internal-plugin-encryption 3.0.0-bnr.5 → 3.0.0-next.10
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 -0
- package/babel.config.js +3 -0
- package/dist/config.js +1 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +11 -0
- package/dist/constants.js.map +1 -0
- package/dist/encryption.js +23 -20
- package/dist/encryption.js.map +1 -1
- package/dist/ensure-buffer.browser.js.map +1 -1
- package/dist/ensure-buffer.js.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/kms-batcher.js +3 -4
- package/dist/kms-batcher.js.map +1 -1
- package/dist/kms-certificate-validation.js +8 -10
- package/dist/kms-certificate-validation.js.map +1 -1
- package/dist/kms-dry-error-interceptor.js +4 -3
- package/dist/kms-dry-error-interceptor.js.map +1 -1
- package/dist/kms-errors.js +23 -8
- package/dist/kms-errors.js.map +1 -1
- package/dist/kms.js +25 -14
- package/dist/kms.js.map +1 -1
- package/jest.config.js +3 -0
- package/package.json +32 -16
- package/process +1 -0
- package/src/constants.js +3 -0
- package/src/encryption.js +30 -23
- package/src/kms-batcher.js +3 -1
- package/src/kms-certificate-validation.js +3 -3
- package/src/kms-errors.js +28 -0
- package/src/kms.js +9 -6
- package/test/integration/spec/encryption.js +2 -1
- package/test/integration/spec/kms.js +0 -1
- package/test/unit/spec/encryption.js +10 -10
- package/test/unit/spec/kms-certificate-validation.js +34 -1
- package/test/unit/spec/kms-errors.js +70 -0
- package/test/unit/spec/kms.js +103 -0
- package/dist/types/config.d.ts +0 -16
- package/dist/types/encryption.d.ts +0 -2
- package/dist/types/ensure-buffer.browser.d.ts +0 -10
- package/dist/types/ensure-buffer.d.ts +0 -7
- package/dist/types/index.d.ts +0 -3
- package/dist/types/kms-batcher.d.ts +0 -6
- package/dist/types/kms-certificate-validation.d.ts +0 -24
- package/dist/types/kms-dry-error-interceptor.d.ts +0 -25
- package/dist/types/kms-errors.d.ts +0 -33
- package/dist/types/kms.d.ts +0 -5
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Customize Error so the SDK knows to quit retrying and notify
|
|
3
|
-
* the user
|
|
4
|
-
*/
|
|
5
|
-
export class KMSError extends Error {
|
|
6
|
-
/**
|
|
7
|
-
* add kmsError field to notify
|
|
8
|
-
* @param {string} message
|
|
9
|
-
*/
|
|
10
|
-
constructor(message: string);
|
|
11
|
-
kmsError: boolean;
|
|
12
|
-
}
|
|
13
|
-
export default validateKMS;
|
|
14
|
-
/**
|
|
15
|
-
* Validates the information provided by the KMS. This is a curried function.
|
|
16
|
-
* The first function takes the caroots param and returns a second function.
|
|
17
|
-
* The second function takes the credentials of the KMS and validates it
|
|
18
|
-
* @param {string[]} caroots PEM encoded certificates that will be used
|
|
19
|
-
* as Certificate Authorities
|
|
20
|
-
* @param {Object} jwt Object containing the fields necessary to
|
|
21
|
-
* validate the KMS
|
|
22
|
-
* @returns {Promise} when resolved will return the jwt
|
|
23
|
-
*/
|
|
24
|
-
declare function validateKMS(caroots: string[]): Promise<any>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interceptor (only to be used in test mode) intended to replay requests that
|
|
3
|
-
* fail as a result of the test-user incompatibility in KMS.
|
|
4
|
-
* @class
|
|
5
|
-
*/
|
|
6
|
-
export default class KmsDryErrorInterceptor {
|
|
7
|
-
/**
|
|
8
|
-
* @returns {KmsDryErrorInterceptor}
|
|
9
|
-
*/
|
|
10
|
-
static create(): KmsDryErrorInterceptor;
|
|
11
|
-
/**
|
|
12
|
-
* @param {Object} options
|
|
13
|
-
* @param {Exception} reason
|
|
14
|
-
* @returns {Promise}
|
|
15
|
-
*/
|
|
16
|
-
onResponseError(options: any, reason: Exception): Promise<any>;
|
|
17
|
-
/**
|
|
18
|
-
* Replays the request
|
|
19
|
-
* @param {Object} options
|
|
20
|
-
* @param {DryError} reason
|
|
21
|
-
* @returns {Object}
|
|
22
|
-
*/
|
|
23
|
-
replay(options: any, reason: DryError): any;
|
|
24
|
-
}
|
|
25
|
-
import { DryError } from "./kms-errors";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error class for KMS errors
|
|
3
|
-
*/
|
|
4
|
-
export class KmsError {
|
|
5
|
-
static defaultMessage: string;
|
|
6
|
-
/**
|
|
7
|
-
* @param {HttpResponse} body
|
|
8
|
-
* @returns {string}
|
|
9
|
-
*/
|
|
10
|
-
parse(body: HttpResponse): string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Thrown when an expected KMSResponse is not received in a timely manner
|
|
14
|
-
*/
|
|
15
|
-
export class KmsTimeoutError extends KmsError {
|
|
16
|
-
/**
|
|
17
|
-
* @param {KmsRequest} options.request
|
|
18
|
-
* @param {KmsRequest} options.timeout
|
|
19
|
-
* @returns {string}
|
|
20
|
-
*/
|
|
21
|
-
parse({ request, timeout }?: KmsRequest): string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Emitted when a REST request includes an encrypter error
|
|
25
|
-
*/
|
|
26
|
-
export class DryError {
|
|
27
|
-
static defaultMessage: string;
|
|
28
|
-
/**
|
|
29
|
-
* @param {WebexHttpError} reason
|
|
30
|
-
* @returns {string}
|
|
31
|
-
*/
|
|
32
|
-
parse(reason: WebexHttpError): string;
|
|
33
|
-
}
|