@sudoplatform/sudo-common 6.2.0 → 6.3.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 (168) hide show
  1. package/.yarn/releases/yarn-1.22.18.cjs +147520 -0
  2. package/.yarnrc +5 -0
  3. package/dependencies-report.json +1 -1
  4. package/docs/assets/main.js +2 -2
  5. package/docs/assets/search.js +1 -1
  6. package/docs/assets/style.css +3 -2
  7. package/docs/classes/AccountLockedError.html +1 -1
  8. package/docs/classes/AuthenticationError.html +1 -1
  9. package/docs/classes/Base64.html +1 -1
  10. package/docs/classes/Buffer.html +1 -1
  11. package/docs/classes/ConfigurationNotSetError.html +1 -1
  12. package/docs/classes/ConfigurationSetNotFoundError.html +1 -1
  13. package/docs/classes/DecodeError.html +1 -1
  14. package/docs/classes/DefaultConfigurationManager.html +1 -1
  15. package/docs/classes/DefaultLogger.html +1 -1
  16. package/docs/classes/DefaultSudoKeyArchive.html +1 -1
  17. package/docs/classes/DefaultSudoKeyManager.html +12 -12
  18. package/docs/classes/FatalError.html +1 -1
  19. package/docs/classes/IllegalArgumentError.html +1 -1
  20. package/docs/classes/IllegalStateError.html +1 -1
  21. package/docs/classes/InsufficientEntitlementsError.html +1 -1
  22. package/docs/classes/InvalidOwnershipProofError.html +1 -1
  23. package/docs/classes/InvalidTokenError.html +1 -1
  24. package/docs/classes/KeyArchiveDecodingError.html +1 -1
  25. package/docs/classes/KeyArchiveIncorrectPasswordError.html +1 -1
  26. package/docs/classes/KeyArchiveMissingError.html +1 -1
  27. package/docs/classes/KeyArchiveNoPasswordRequiredError.html +1 -1
  28. package/docs/classes/KeyArchivePasswordRequiredError.html +1 -1
  29. package/docs/classes/KeyArchiveTypeError.html +1 -1
  30. package/docs/classes/KeyArchiveUnknownKeyTypeError.html +1 -1
  31. package/docs/classes/KeyArchiveVersionError.html +1 -1
  32. package/docs/classes/KeyNotFoundError.html +1 -1
  33. package/docs/classes/KeyStoreNotExportableError.html +1 -1
  34. package/docs/classes/LimitExceededError.html +1 -1
  35. package/docs/classes/NoEntitlementsError.html +1 -1
  36. package/docs/classes/NotAuthorizedError.html +1 -1
  37. package/docs/classes/NotRegisteredError.html +1 -1
  38. package/docs/classes/NotSignedInError.html +1 -1
  39. package/docs/classes/OperationNotImplementedError.html +1 -1
  40. package/docs/classes/RegisterError.html +1 -1
  41. package/docs/classes/RequestFailedError.html +1 -1
  42. package/docs/classes/ServiceError.html +1 -1
  43. package/docs/classes/SignOutError.html +1 -1
  44. package/docs/classes/SudoCryptoProviderDefaults.html +1 -1
  45. package/docs/classes/UnknownGraphQLError.html +1 -1
  46. package/docs/classes/UnrecognizedAlgorithmError.html +1 -1
  47. package/docs/classes/UserNotConfirmedError.html +1 -1
  48. package/docs/classes/VersionMismatchError.html +1 -1
  49. package/docs/enums/CachePolicy.html +1 -1
  50. package/docs/enums/EncryptionAlgorithm.html +2 -2
  51. package/docs/enums/KeyArchiveKeyType.html +1 -1
  52. package/docs/enums/KeyDataKeyFormat.html +1 -1
  53. package/docs/enums/KeyDataKeyType.html +1 -1
  54. package/docs/enums/ListOperationResultStatus.html +4 -4
  55. package/docs/enums/PublicKeyFormat.html +1 -1
  56. package/docs/index.html +1 -1
  57. package/docs/interfaces/AsymmetricEncryptionOptions.html +1 -1
  58. package/docs/interfaces/BooleanFilter.html +1 -1
  59. package/docs/interfaces/ConfigurationManager.html +1 -1
  60. package/docs/interfaces/KeyData.html +1 -1
  61. package/docs/interfaces/ListOperationFailureResult.html +2 -2
  62. package/docs/interfaces/ListOperationPartialResult.html +4 -4
  63. package/docs/interfaces/ListOperationSuccessResult.html +3 -3
  64. package/docs/interfaces/ListOutput.html +1 -1
  65. package/docs/interfaces/Logger.html +1 -1
  66. package/docs/interfaces/Owner.html +1 -1
  67. package/docs/interfaces/PublicKey.html +1 -1
  68. package/docs/interfaces/ServiceCompatibilityInfo.html +1 -1
  69. package/docs/interfaces/StringFilter.html +1 -1
  70. package/docs/interfaces/SudoCryptoProvider.html +1 -1
  71. package/docs/interfaces/SudoKeyArchive.html +1 -1
  72. package/docs/interfaces/SudoKeyManager.html +1 -1
  73. package/docs/interfaces/SymmetricEncryptionOptions.html +1 -1
  74. package/docs/interfaces/ValidationResult.html +1 -1
  75. package/docs/modules.html +5 -5
  76. package/github/.yarn/releases/yarn-1.22.18.cjs +147520 -0
  77. package/github/.yarnrc +5 -0
  78. package/github/docs/assets/main.js +2 -2
  79. package/github/docs/assets/search.js +1 -1
  80. package/github/docs/assets/style.css +3 -2
  81. package/github/docs/classes/AccountLockedError.html +1 -1
  82. package/github/docs/classes/AuthenticationError.html +1 -1
  83. package/github/docs/classes/Base64.html +1 -1
  84. package/github/docs/classes/Buffer.html +1 -1
  85. package/github/docs/classes/ConfigurationNotSetError.html +1 -1
  86. package/github/docs/classes/ConfigurationSetNotFoundError.html +1 -1
  87. package/github/docs/classes/DecodeError.html +1 -1
  88. package/github/docs/classes/DefaultConfigurationManager.html +1 -1
  89. package/github/docs/classes/DefaultLogger.html +1 -1
  90. package/github/docs/classes/DefaultSudoKeyArchive.html +1 -1
  91. package/github/docs/classes/DefaultSudoKeyManager.html +12 -12
  92. package/github/docs/classes/FatalError.html +1 -1
  93. package/github/docs/classes/IllegalArgumentError.html +1 -1
  94. package/github/docs/classes/IllegalStateError.html +1 -1
  95. package/github/docs/classes/InsufficientEntitlementsError.html +1 -1
  96. package/github/docs/classes/InvalidOwnershipProofError.html +1 -1
  97. package/github/docs/classes/InvalidTokenError.html +1 -1
  98. package/github/docs/classes/KeyArchiveDecodingError.html +1 -1
  99. package/github/docs/classes/KeyArchiveIncorrectPasswordError.html +1 -1
  100. package/github/docs/classes/KeyArchiveMissingError.html +1 -1
  101. package/github/docs/classes/KeyArchiveNoPasswordRequiredError.html +1 -1
  102. package/github/docs/classes/KeyArchivePasswordRequiredError.html +1 -1
  103. package/github/docs/classes/KeyArchiveTypeError.html +1 -1
  104. package/github/docs/classes/KeyArchiveUnknownKeyTypeError.html +1 -1
  105. package/github/docs/classes/KeyArchiveVersionError.html +1 -1
  106. package/github/docs/classes/KeyNotFoundError.html +1 -1
  107. package/github/docs/classes/KeyStoreNotExportableError.html +1 -1
  108. package/github/docs/classes/LimitExceededError.html +1 -1
  109. package/github/docs/classes/NoEntitlementsError.html +1 -1
  110. package/github/docs/classes/NotAuthorizedError.html +1 -1
  111. package/github/docs/classes/NotRegisteredError.html +1 -1
  112. package/github/docs/classes/NotSignedInError.html +1 -1
  113. package/github/docs/classes/OperationNotImplementedError.html +1 -1
  114. package/github/docs/classes/RegisterError.html +1 -1
  115. package/github/docs/classes/RequestFailedError.html +1 -1
  116. package/github/docs/classes/ServiceError.html +1 -1
  117. package/github/docs/classes/SignOutError.html +1 -1
  118. package/github/docs/classes/SudoCryptoProviderDefaults.html +1 -1
  119. package/github/docs/classes/UnknownGraphQLError.html +1 -1
  120. package/github/docs/classes/UnrecognizedAlgorithmError.html +1 -1
  121. package/github/docs/classes/UserNotConfirmedError.html +1 -1
  122. package/github/docs/classes/VersionMismatchError.html +1 -1
  123. package/github/docs/enums/CachePolicy.html +1 -1
  124. package/github/docs/enums/EncryptionAlgorithm.html +2 -2
  125. package/github/docs/enums/KeyArchiveKeyType.html +1 -1
  126. package/github/docs/enums/KeyDataKeyFormat.html +1 -1
  127. package/github/docs/enums/KeyDataKeyType.html +1 -1
  128. package/github/docs/enums/ListOperationResultStatus.html +4 -4
  129. package/github/docs/enums/PublicKeyFormat.html +1 -1
  130. package/github/docs/index.html +1 -1
  131. package/github/docs/interfaces/AsymmetricEncryptionOptions.html +1 -1
  132. package/github/docs/interfaces/BooleanFilter.html +1 -1
  133. package/github/docs/interfaces/ConfigurationManager.html +1 -1
  134. package/github/docs/interfaces/KeyData.html +1 -1
  135. package/github/docs/interfaces/ListOperationFailureResult.html +2 -2
  136. package/github/docs/interfaces/ListOperationPartialResult.html +4 -4
  137. package/github/docs/interfaces/ListOperationSuccessResult.html +3 -3
  138. package/github/docs/interfaces/ListOutput.html +1 -1
  139. package/github/docs/interfaces/Logger.html +1 -1
  140. package/github/docs/interfaces/Owner.html +1 -1
  141. package/github/docs/interfaces/PublicKey.html +1 -1
  142. package/github/docs/interfaces/ServiceCompatibilityInfo.html +1 -1
  143. package/github/docs/interfaces/StringFilter.html +1 -1
  144. package/github/docs/interfaces/SudoCryptoProvider.html +1 -1
  145. package/github/docs/interfaces/SudoKeyArchive.html +1 -1
  146. package/github/docs/interfaces/SudoKeyManager.html +1 -1
  147. package/github/docs/interfaces/SymmetricEncryptionOptions.html +1 -1
  148. package/github/docs/interfaces/ValidationResult.html +1 -1
  149. package/github/docs/modules.html +5 -5
  150. package/github/package.json +17 -16
  151. package/github/src/errors/error.ts +5 -1
  152. package/github/src/sudoKeyManager/sudoKeyManager.ts +12 -20
  153. package/github/src/types/types.ts +1 -0
  154. package/github/test/unit/errors/error.spec.ts +3 -18
  155. package/github/test/unit/sudoKeyManager.spec.ts +18 -18
  156. package/github/yarn.lock +410 -229
  157. package/lib/errors/error.d.ts +1 -1
  158. package/lib/errors/error.js +3 -0
  159. package/lib/sudoKeyManager/sudoKeyManager.js +12 -4
  160. package/lib/types/types.d.ts +1 -0
  161. package/lib/types/types.js +1 -0
  162. package/package.json +18 -17
  163. package/src/errors/error.ts +5 -1
  164. package/src/sudoKeyManager/sudoKeyManager.ts +12 -20
  165. package/src/types/types.ts +1 -0
  166. package/test/unit/errors/error.spec.ts +3 -18
  167. package/test/unit/sudoKeyManager.spec.ts +18 -18
  168. package/yarn.lock +410 -229
@@ -39,44 +39,45 @@
39
39
  "**/apollo-cache-inmemory": "^1.6.6",
40
40
  "**/apollo-client": "^2.6.10",
41
41
  "ansi-regex": "^5.0.1",
42
- "tmpl": "^1.0.5"
42
+ "tmpl": "^1.0.5",
43
+ "minimist": "^1.2.6"
43
44
  },
44
45
  "dependencies": {
45
46
  "apollo-client": "^2.6.10",
46
47
  "aws-sdk": "^2.973.0",
47
48
  "browser-bunyan": "^1.8.0",
48
49
  "fflate": "^0.7.3",
49
- "graphql": "^15.6.1"
50
+ "graphql": "^15.8.0"
50
51
  },
51
52
  "peerDependencies": {
52
53
  "io-ts": "^2.2.10"
53
54
  },
54
55
  "devDependencies": {
55
- "@babel/cli": "^7.16.6",
56
- "@babel/core": "^7.17.5",
56
+ "@babel/cli": "^7.17.10",
57
+ "@babel/core": "^7.17.10",
57
58
  "@babel/plugin-proposal-class-properties": "^7.16.7",
58
59
  "@babel/plugin-proposal-private-methods": "^7.16.11",
59
- "@babel/preset-env": "^7.16.11",
60
+ "@babel/preset-env": "^7.17.10",
60
61
  "@babel/preset-typescript": "^7.16.7",
61
- "@types/jest": "^27.4.0",
62
- "@typescript-eslint/eslint-plugin": "^5.12.1",
63
- "@typescript-eslint/parser": "^5.12.1",
64
- "aws-sdk-mock": "^5.6.2",
65
- "eslint": "^8.9.0",
66
- "eslint-config-prettier": "^8.4.0",
67
- "eslint-plugin-import": "^2.25.4",
62
+ "@types/jest": "^27.5.0",
63
+ "@typescript-eslint/eslint-plugin": "^5.22.0",
64
+ "@typescript-eslint/parser": "^5.22.0",
65
+ "aws-sdk-mock": "^5.7.0",
66
+ "eslint": "^8.14.0",
67
+ "eslint-config-prettier": "^8.5.0",
68
+ "eslint-plugin-import": "^2.26.0",
68
69
  "eslint-plugin-prettier": "^4.0.0",
69
70
  "fp-ts": "^2.11.8",
70
71
  "io-ts": "^2.2.16",
71
72
  "io-ts-types": "^0.5.16",
72
73
  "isomorphic-webcrypto": "^2.3.8",
73
74
  "jest": "^27.5.1",
74
- "monocle-ts": "^2.3.12",
75
+ "monocle-ts": "^2.3.13",
75
76
  "newtype-ts": "^0.3.5",
76
- "prettier": "^2.5.1",
77
+ "prettier": "^2.6.2",
77
78
  "rimraf": "^3.0.2",
78
79
  "ts-mockito": "^2.6.1",
79
- "typedoc": "^0.22.12",
80
- "typescript": "^4.5.5"
80
+ "typedoc": "^0.22.15",
81
+ "typescript": "^4.6.4"
81
82
  }
82
83
  }
@@ -425,7 +425,9 @@ export class UnrecognizedAlgorithmError extends Error {
425
425
  * @param error The App Sync error to map
426
426
  * @returns The mapped error
427
427
  */
428
- export function mapGraphQLToClientError(error: AppSyncError): Error {
428
+ export function mapGraphQLToClientError(
429
+ error: Pick<AppSyncError, 'errorType' | 'message'>,
430
+ ): Error {
429
431
  switch (error.errorType) {
430
432
  case 'sudoplatform.AccountLockedError':
431
433
  return new AccountLockedError()
@@ -435,6 +437,8 @@ export function mapGraphQLToClientError(error: AppSyncError): Error {
435
437
  return new InvalidTokenError()
436
438
  case 'sudoplatform.InvalidArgumentError':
437
439
  return new IllegalArgumentError()
440
+ case 'sudoplatform.LimitExceededError':
441
+ return new LimitExceededError()
438
442
  case 'sudoplatform.NoEntitlementsError':
439
443
  return new NoEntitlementsError()
440
444
  case 'sudoplatform.ServiceError':
@@ -435,11 +435,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
435
435
  ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
436
436
  ): Promise<ArrayBuffer> {
437
437
  if (BufferUtil.isArrayBuffer(ivOrOptions)) {
438
- return this.sudoCryptoProvider.encryptWithSymmetricKey(
439
- key,
440
- data,
441
- ivOrOptions,
442
- )
438
+ return this.sudoCryptoProvider.encryptWithSymmetricKey(key, data, {
439
+ iv: ivOrOptions,
440
+ })
443
441
  } else {
444
442
  return this.sudoCryptoProvider.encryptWithSymmetricKey(
445
443
  key,
@@ -455,11 +453,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
455
453
  ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
456
454
  ): Promise<ArrayBuffer> {
457
455
  if (BufferUtil.isArrayBuffer(ivOrOptions)) {
458
- return this.sudoCryptoProvider.decryptWithSymmetricKey(
459
- key,
460
- data,
461
- ivOrOptions,
462
- )
456
+ return this.sudoCryptoProvider.decryptWithSymmetricKey(key, data, {
457
+ iv: ivOrOptions,
458
+ })
463
459
  } else {
464
460
  return this.sudoCryptoProvider.decryptWithSymmetricKey(
465
461
  key,
@@ -475,11 +471,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
475
471
  ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
476
472
  ): Promise<ArrayBuffer> {
477
473
  if (BufferUtil.isArrayBuffer(ivOrOptions)) {
478
- return this.sudoCryptoProvider.encryptWithSymmetricKeyName(
479
- name,
480
- data,
481
- ivOrOptions,
482
- )
474
+ return this.sudoCryptoProvider.encryptWithSymmetricKeyName(name, data, {
475
+ iv: ivOrOptions,
476
+ })
483
477
  } else {
484
478
  return this.sudoCryptoProvider.encryptWithSymmetricKeyName(
485
479
  name,
@@ -495,11 +489,9 @@ export class DefaultSudoKeyManager implements SudoKeyManager {
495
489
  ivOrOptions?: ArrayBuffer | SymmetricEncryptionOptions,
496
490
  ): Promise<ArrayBuffer> {
497
491
  if (BufferUtil.isArrayBuffer(ivOrOptions)) {
498
- return this.sudoCryptoProvider.decryptWithSymmetricKeyName(
499
- name,
500
- data,
501
- ivOrOptions,
502
- )
492
+ return this.sudoCryptoProvider.decryptWithSymmetricKeyName(name, data, {
493
+ iv: ivOrOptions,
494
+ })
503
495
  } else {
504
496
  return this.sudoCryptoProvider.decryptWithSymmetricKeyName(
505
497
  name,
@@ -46,6 +46,7 @@ export interface BooleanFilter {
46
46
  */
47
47
  export enum EncryptionAlgorithm {
48
48
  AesCbcPkcs7Padding = 'AES/CBC/PKCS7Padding',
49
+ AesGcmNoPadding = 'AES/GCM/NoPadding',
49
50
  RsaOaepSha1 = 'RSA/OAEPWithSHA-1',
50
51
  }
51
52
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  AccountLockedError,
3
- AppSyncError,
4
3
  AppSyncNetworkError,
5
4
  IllegalArgumentError,
6
5
  InsufficientEntitlementsError,
7
6
  InvalidTokenError,
8
7
  isAppSyncNetworkError,
8
+ LimitExceededError,
9
9
  mapGraphQLToClientError,
10
10
  mapNetworkErrorToClientError,
11
11
  NoEntitlementsError,
@@ -26,34 +26,19 @@ describe('error', () => {
26
26
  ${'sudoplatform.InvalidArgumentError'} | ${new IllegalArgumentError()}
27
27
  ${'sudoplatform.NoEntitlementsError'} | ${new NoEntitlementsError()}
28
28
  ${'sudoplatform.ServiceError'} | ${new ServiceError(message)}
29
+ ${'sudoplatform.LimitExceededError'} | ${new LimitExceededError()}
29
30
  `('should map common error $code properly', ({ code, error }) => {
30
31
  expect(
31
32
  mapGraphQLToClientError({
32
33
  message,
33
- path: [],
34
- locations: [],
35
- nodes: [],
36
- positions: [],
37
- source: undefined,
38
- originalError: undefined,
39
- extensions: [],
40
- name: code,
41
34
  errorType: code,
42
35
  }),
43
36
  ).toEqual(error)
44
37
  })
45
38
 
46
39
  it('should map an unrecognized error to UnknownGraphQLError', () => {
47
- const unrecognized: AppSyncError = {
40
+ const unrecognized = {
48
41
  message,
49
- path: [],
50
- locations: [],
51
- nodes: [],
52
- positions: [],
53
- source: undefined,
54
- originalError: undefined,
55
- extensions: [],
56
- name: 'unrecognized',
57
42
  errorType: 'unrecognized',
58
43
  }
59
44
  expect(mapGraphQLToClientError(unrecognized)).toEqual(
@@ -393,8 +393,8 @@ describe('DefaultSudoKeyManager', () => {
393
393
  expect(actualKeyName).toStrictEqual('VpnKey')
394
394
  expect(actualData).toStrictEqual(decrypted)
395
395
  expect(actualOptions).toBeDefined()
396
- expect(actualOptions.iv).toStrictEqual(iv)
397
- expect(actualOptions.algorithm).toBeUndefined()
396
+ expect(actualOptions!.iv).toStrictEqual(iv)
397
+ expect(actualOptions!.algorithm).toBeUndefined()
398
398
 
399
399
  verify(
400
400
  sudoCryptoProviderMock.encryptWithSymmetricKeyName(
@@ -430,8 +430,8 @@ describe('DefaultSudoKeyManager', () => {
430
430
  expect(actualKeyName).toStrictEqual('VpnKey')
431
431
  expect(actualData).toStrictEqual(decrypted)
432
432
  expect(actualOptions).toBeDefined()
433
- expect(actualOptions.iv).toStrictEqual(options.iv)
434
- expect(actualOptions.algorithm).toStrictEqual(options.algorithm)
433
+ expect(actualOptions!.iv).toStrictEqual(options.iv)
434
+ expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
435
435
 
436
436
  verify(
437
437
  sudoCryptoProviderMock.encryptWithSymmetricKeyName(
@@ -492,8 +492,8 @@ describe('DefaultSudoKeyManager', () => {
492
492
  expect(actualKey).toStrictEqual(symmetricKey)
493
493
  expect(actualData).toStrictEqual(encrypted)
494
494
  expect(actualOptions).toBeDefined()
495
- expect(actualOptions.iv).toStrictEqual(iv)
496
- expect(actualOptions.algorithm).toBeUndefined()
495
+ expect(actualOptions!.iv).toStrictEqual(iv)
496
+ expect(actualOptions!.algorithm).toBeUndefined()
497
497
 
498
498
  verify(
499
499
  sudoCryptoProviderMock.encryptWithSymmetricKey(
@@ -530,8 +530,8 @@ describe('DefaultSudoKeyManager', () => {
530
530
  expect(actualKey).toStrictEqual(symmetricKey)
531
531
  expect(actualData).toStrictEqual(encrypted)
532
532
  expect(actualOptions).toBeDefined()
533
- expect(actualOptions.iv).toBeUndefined()
534
- expect(actualOptions.algorithm).toStrictEqual(options.algorithm)
533
+ expect(actualOptions!.iv).toBeUndefined()
534
+ expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
535
535
 
536
536
  verify(
537
537
  sudoCryptoProviderMock.encryptWithSymmetricKey(
@@ -599,8 +599,8 @@ describe('DefaultSudoKeyManager', () => {
599
599
  expect(actualKeyName).toStrictEqual('VpnKey')
600
600
  expect(actualData).toStrictEqual(encrypted)
601
601
  expect(actualOptions).toBeDefined()
602
- expect(actualOptions.iv).toStrictEqual(options.iv)
603
- expect(actualOptions.algorithm).toBeUndefined()
602
+ expect(actualOptions!.iv).toStrictEqual(options.iv)
603
+ expect(actualOptions!.algorithm).toBeUndefined()
604
604
 
605
605
  verify(
606
606
  sudoCryptoProviderMock.decryptWithSymmetricKeyName(
@@ -638,8 +638,8 @@ describe('DefaultSudoKeyManager', () => {
638
638
  expect(actualKeyName).toStrictEqual('VpnKey')
639
639
  expect(actualData).toStrictEqual(encrypted)
640
640
  expect(actualOptions).toBeDefined()
641
- expect(actualOptions.iv).toStrictEqual(options.iv)
642
- expect(actualOptions.algorithm).toStrictEqual(options.algorithm)
641
+ expect(actualOptions!.iv).toStrictEqual(options.iv)
642
+ expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
643
643
 
644
644
  verify(
645
645
  sudoCryptoProviderMock.decryptWithSymmetricKeyName(
@@ -707,8 +707,8 @@ describe('DefaultSudoKeyManager', () => {
707
707
  expect(actualKey).toStrictEqual(symmetricKey)
708
708
  expect(actualData).toStrictEqual(encrypted)
709
709
  expect(actualOptions).toBeDefined()
710
- expect(actualOptions.iv).toStrictEqual(iv)
711
- expect(actualOptions.algorithm).toBeUndefined()
710
+ expect(actualOptions!.iv).toStrictEqual(iv)
711
+ expect(actualOptions!.algorithm).toBeUndefined()
712
712
 
713
713
  verify(
714
714
  sudoCryptoProviderMock.decryptWithSymmetricKey(
@@ -746,8 +746,8 @@ describe('DefaultSudoKeyManager', () => {
746
746
  expect(actualKey).toStrictEqual(symmetricKey)
747
747
  expect(actualData).toStrictEqual(encrypted)
748
748
  expect(actualOptions).toBeDefined()
749
- expect(actualOptions.iv).toStrictEqual(iv)
750
- expect(actualOptions.algorithm).toStrictEqual(options.algorithm)
749
+ expect(actualOptions!.iv).toStrictEqual(iv)
750
+ expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
751
751
 
752
752
  verify(
753
753
  sudoCryptoProviderMock.decryptWithSymmetricKey(
@@ -811,7 +811,7 @@ describe('DefaultSudoKeyManager', () => {
811
811
  expect(actualKeyName).toStrictEqual('VpnKey')
812
812
  expect(actualData).toStrictEqual(decrypted)
813
813
  expect(actualOptions).toBeDefined()
814
- expect(actualOptions.algorithm).toStrictEqual(options.algorithm)
814
+ expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
815
815
 
816
816
  verify(
817
817
  sudoCryptoProviderMock.encryptWithPublicKey(
@@ -875,7 +875,7 @@ describe('DefaultSudoKeyManager', () => {
875
875
  expect(actualKeyName).toStrictEqual('VpnKey')
876
876
  expect(actualData).toStrictEqual(encrypted)
877
877
  expect(actualOptions).toBeDefined()
878
- expect(actualOptions.algorithm).toStrictEqual(options.algorithm)
878
+ expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
879
879
 
880
880
  verify(
881
881
  sudoCryptoProviderMock.decryptWithPrivateKey(