@webex/internal-plugin-encryption 3.0.0-bnr.5 → 3.0.0-next.1

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.
Files changed (47) hide show
  1. package/.eslintrc.js +6 -0
  2. package/babel.config.js +3 -0
  3. package/dist/config.js +1 -2
  4. package/dist/config.js.map +1 -1
  5. package/dist/constants.js +11 -0
  6. package/dist/constants.js.map +1 -0
  7. package/dist/encryption.js +23 -20
  8. package/dist/encryption.js.map +1 -1
  9. package/dist/ensure-buffer.browser.js.map +1 -1
  10. package/dist/ensure-buffer.js.map +1 -1
  11. package/dist/index.js +5 -7
  12. package/dist/index.js.map +1 -1
  13. package/dist/kms-batcher.js +3 -4
  14. package/dist/kms-batcher.js.map +1 -1
  15. package/dist/kms-certificate-validation.js +8 -10
  16. package/dist/kms-certificate-validation.js.map +1 -1
  17. package/dist/kms-dry-error-interceptor.js +4 -3
  18. package/dist/kms-dry-error-interceptor.js.map +1 -1
  19. package/dist/kms-errors.js +23 -8
  20. package/dist/kms-errors.js.map +1 -1
  21. package/dist/kms.js +25 -14
  22. package/dist/kms.js.map +1 -1
  23. package/jest.config.js +3 -0
  24. package/package.json +32 -16
  25. package/process +1 -0
  26. package/src/constants.js +3 -0
  27. package/src/encryption.js +30 -23
  28. package/src/kms-batcher.js +3 -1
  29. package/src/kms-certificate-validation.js +3 -3
  30. package/src/kms-errors.js +28 -0
  31. package/src/kms.js +9 -6
  32. package/test/integration/spec/encryption.js +2 -1
  33. package/test/integration/spec/kms.js +0 -1
  34. package/test/unit/spec/encryption.js +10 -10
  35. package/test/unit/spec/kms-certificate-validation.js +34 -1
  36. package/test/unit/spec/kms-errors.js +70 -0
  37. package/test/unit/spec/kms.js +103 -0
  38. package/dist/types/config.d.ts +0 -16
  39. package/dist/types/encryption.d.ts +0 -2
  40. package/dist/types/ensure-buffer.browser.d.ts +0 -10
  41. package/dist/types/ensure-buffer.d.ts +0 -7
  42. package/dist/types/index.d.ts +0 -3
  43. package/dist/types/kms-batcher.d.ts +0 -6
  44. package/dist/types/kms-certificate-validation.d.ts +0 -24
  45. package/dist/types/kms-dry-error-interceptor.d.ts +0 -25
  46. package/dist/types/kms-errors.d.ts +0 -33
  47. 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
- }
@@ -1,5 +0,0 @@
1
- export default KMS;
2
- /**
3
- * @class
4
- */
5
- declare const KMS: any;