@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.
- package/.yarn/releases/yarn-1.22.18.cjs +147520 -0
- package/.yarnrc +5 -0
- package/dependencies-report.json +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +3 -2
- package/docs/classes/AccountLockedError.html +1 -1
- package/docs/classes/AuthenticationError.html +1 -1
- package/docs/classes/Base64.html +1 -1
- package/docs/classes/Buffer.html +1 -1
- package/docs/classes/ConfigurationNotSetError.html +1 -1
- package/docs/classes/ConfigurationSetNotFoundError.html +1 -1
- package/docs/classes/DecodeError.html +1 -1
- package/docs/classes/DefaultConfigurationManager.html +1 -1
- package/docs/classes/DefaultLogger.html +1 -1
- package/docs/classes/DefaultSudoKeyArchive.html +1 -1
- package/docs/classes/DefaultSudoKeyManager.html +12 -12
- package/docs/classes/FatalError.html +1 -1
- package/docs/classes/IllegalArgumentError.html +1 -1
- package/docs/classes/IllegalStateError.html +1 -1
- package/docs/classes/InsufficientEntitlementsError.html +1 -1
- package/docs/classes/InvalidOwnershipProofError.html +1 -1
- package/docs/classes/InvalidTokenError.html +1 -1
- package/docs/classes/KeyArchiveDecodingError.html +1 -1
- package/docs/classes/KeyArchiveIncorrectPasswordError.html +1 -1
- package/docs/classes/KeyArchiveMissingError.html +1 -1
- package/docs/classes/KeyArchiveNoPasswordRequiredError.html +1 -1
- package/docs/classes/KeyArchivePasswordRequiredError.html +1 -1
- package/docs/classes/KeyArchiveTypeError.html +1 -1
- package/docs/classes/KeyArchiveUnknownKeyTypeError.html +1 -1
- package/docs/classes/KeyArchiveVersionError.html +1 -1
- package/docs/classes/KeyNotFoundError.html +1 -1
- package/docs/classes/KeyStoreNotExportableError.html +1 -1
- package/docs/classes/LimitExceededError.html +1 -1
- package/docs/classes/NoEntitlementsError.html +1 -1
- package/docs/classes/NotAuthorizedError.html +1 -1
- package/docs/classes/NotRegisteredError.html +1 -1
- package/docs/classes/NotSignedInError.html +1 -1
- package/docs/classes/OperationNotImplementedError.html +1 -1
- package/docs/classes/RegisterError.html +1 -1
- package/docs/classes/RequestFailedError.html +1 -1
- package/docs/classes/ServiceError.html +1 -1
- package/docs/classes/SignOutError.html +1 -1
- package/docs/classes/SudoCryptoProviderDefaults.html +1 -1
- package/docs/classes/UnknownGraphQLError.html +1 -1
- package/docs/classes/UnrecognizedAlgorithmError.html +1 -1
- package/docs/classes/UserNotConfirmedError.html +1 -1
- package/docs/classes/VersionMismatchError.html +1 -1
- package/docs/enums/CachePolicy.html +1 -1
- package/docs/enums/EncryptionAlgorithm.html +2 -2
- package/docs/enums/KeyArchiveKeyType.html +1 -1
- package/docs/enums/KeyDataKeyFormat.html +1 -1
- package/docs/enums/KeyDataKeyType.html +1 -1
- package/docs/enums/ListOperationResultStatus.html +4 -4
- package/docs/enums/PublicKeyFormat.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/AsymmetricEncryptionOptions.html +1 -1
- package/docs/interfaces/BooleanFilter.html +1 -1
- package/docs/interfaces/ConfigurationManager.html +1 -1
- package/docs/interfaces/KeyData.html +1 -1
- package/docs/interfaces/ListOperationFailureResult.html +2 -2
- package/docs/interfaces/ListOperationPartialResult.html +4 -4
- package/docs/interfaces/ListOperationSuccessResult.html +3 -3
- package/docs/interfaces/ListOutput.html +1 -1
- package/docs/interfaces/Logger.html +1 -1
- package/docs/interfaces/Owner.html +1 -1
- package/docs/interfaces/PublicKey.html +1 -1
- package/docs/interfaces/ServiceCompatibilityInfo.html +1 -1
- package/docs/interfaces/StringFilter.html +1 -1
- package/docs/interfaces/SudoCryptoProvider.html +1 -1
- package/docs/interfaces/SudoKeyArchive.html +1 -1
- package/docs/interfaces/SudoKeyManager.html +1 -1
- package/docs/interfaces/SymmetricEncryptionOptions.html +1 -1
- package/docs/interfaces/ValidationResult.html +1 -1
- package/docs/modules.html +5 -5
- package/github/.yarn/releases/yarn-1.22.18.cjs +147520 -0
- package/github/.yarnrc +5 -0
- package/github/docs/assets/main.js +2 -2
- package/github/docs/assets/search.js +1 -1
- package/github/docs/assets/style.css +3 -2
- package/github/docs/classes/AccountLockedError.html +1 -1
- package/github/docs/classes/AuthenticationError.html +1 -1
- package/github/docs/classes/Base64.html +1 -1
- package/github/docs/classes/Buffer.html +1 -1
- package/github/docs/classes/ConfigurationNotSetError.html +1 -1
- package/github/docs/classes/ConfigurationSetNotFoundError.html +1 -1
- package/github/docs/classes/DecodeError.html +1 -1
- package/github/docs/classes/DefaultConfigurationManager.html +1 -1
- package/github/docs/classes/DefaultLogger.html +1 -1
- package/github/docs/classes/DefaultSudoKeyArchive.html +1 -1
- package/github/docs/classes/DefaultSudoKeyManager.html +12 -12
- package/github/docs/classes/FatalError.html +1 -1
- package/github/docs/classes/IllegalArgumentError.html +1 -1
- package/github/docs/classes/IllegalStateError.html +1 -1
- package/github/docs/classes/InsufficientEntitlementsError.html +1 -1
- package/github/docs/classes/InvalidOwnershipProofError.html +1 -1
- package/github/docs/classes/InvalidTokenError.html +1 -1
- package/github/docs/classes/KeyArchiveDecodingError.html +1 -1
- package/github/docs/classes/KeyArchiveIncorrectPasswordError.html +1 -1
- package/github/docs/classes/KeyArchiveMissingError.html +1 -1
- package/github/docs/classes/KeyArchiveNoPasswordRequiredError.html +1 -1
- package/github/docs/classes/KeyArchivePasswordRequiredError.html +1 -1
- package/github/docs/classes/KeyArchiveTypeError.html +1 -1
- package/github/docs/classes/KeyArchiveUnknownKeyTypeError.html +1 -1
- package/github/docs/classes/KeyArchiveVersionError.html +1 -1
- package/github/docs/classes/KeyNotFoundError.html +1 -1
- package/github/docs/classes/KeyStoreNotExportableError.html +1 -1
- package/github/docs/classes/LimitExceededError.html +1 -1
- package/github/docs/classes/NoEntitlementsError.html +1 -1
- package/github/docs/classes/NotAuthorizedError.html +1 -1
- package/github/docs/classes/NotRegisteredError.html +1 -1
- package/github/docs/classes/NotSignedInError.html +1 -1
- package/github/docs/classes/OperationNotImplementedError.html +1 -1
- package/github/docs/classes/RegisterError.html +1 -1
- package/github/docs/classes/RequestFailedError.html +1 -1
- package/github/docs/classes/ServiceError.html +1 -1
- package/github/docs/classes/SignOutError.html +1 -1
- package/github/docs/classes/SudoCryptoProviderDefaults.html +1 -1
- package/github/docs/classes/UnknownGraphQLError.html +1 -1
- package/github/docs/classes/UnrecognizedAlgorithmError.html +1 -1
- package/github/docs/classes/UserNotConfirmedError.html +1 -1
- package/github/docs/classes/VersionMismatchError.html +1 -1
- package/github/docs/enums/CachePolicy.html +1 -1
- package/github/docs/enums/EncryptionAlgorithm.html +2 -2
- package/github/docs/enums/KeyArchiveKeyType.html +1 -1
- package/github/docs/enums/KeyDataKeyFormat.html +1 -1
- package/github/docs/enums/KeyDataKeyType.html +1 -1
- package/github/docs/enums/ListOperationResultStatus.html +4 -4
- package/github/docs/enums/PublicKeyFormat.html +1 -1
- package/github/docs/index.html +1 -1
- package/github/docs/interfaces/AsymmetricEncryptionOptions.html +1 -1
- package/github/docs/interfaces/BooleanFilter.html +1 -1
- package/github/docs/interfaces/ConfigurationManager.html +1 -1
- package/github/docs/interfaces/KeyData.html +1 -1
- package/github/docs/interfaces/ListOperationFailureResult.html +2 -2
- package/github/docs/interfaces/ListOperationPartialResult.html +4 -4
- package/github/docs/interfaces/ListOperationSuccessResult.html +3 -3
- package/github/docs/interfaces/ListOutput.html +1 -1
- package/github/docs/interfaces/Logger.html +1 -1
- package/github/docs/interfaces/Owner.html +1 -1
- package/github/docs/interfaces/PublicKey.html +1 -1
- package/github/docs/interfaces/ServiceCompatibilityInfo.html +1 -1
- package/github/docs/interfaces/StringFilter.html +1 -1
- package/github/docs/interfaces/SudoCryptoProvider.html +1 -1
- package/github/docs/interfaces/SudoKeyArchive.html +1 -1
- package/github/docs/interfaces/SudoKeyManager.html +1 -1
- package/github/docs/interfaces/SymmetricEncryptionOptions.html +1 -1
- package/github/docs/interfaces/ValidationResult.html +1 -1
- package/github/docs/modules.html +5 -5
- package/github/package.json +17 -16
- package/github/src/errors/error.ts +5 -1
- package/github/src/sudoKeyManager/sudoKeyManager.ts +12 -20
- package/github/src/types/types.ts +1 -0
- package/github/test/unit/errors/error.spec.ts +3 -18
- package/github/test/unit/sudoKeyManager.spec.ts +18 -18
- package/github/yarn.lock +410 -229
- package/lib/errors/error.d.ts +1 -1
- package/lib/errors/error.js +3 -0
- package/lib/sudoKeyManager/sudoKeyManager.js +12 -4
- package/lib/types/types.d.ts +1 -0
- package/lib/types/types.js +1 -0
- package/package.json +18 -17
- package/src/errors/error.ts +5 -1
- package/src/sudoKeyManager/sudoKeyManager.ts +12 -20
- package/src/types/types.ts +1 -0
- package/test/unit/errors/error.spec.ts +3 -18
- package/test/unit/sudoKeyManager.spec.ts +18 -18
- package/yarn.lock +410 -229
package/github/package.json
CHANGED
|
@@ -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.
|
|
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.
|
|
56
|
-
"@babel/core": "^7.17.
|
|
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.
|
|
60
|
+
"@babel/preset-env": "^7.17.10",
|
|
60
61
|
"@babel/preset-typescript": "^7.16.7",
|
|
61
|
-
"@types/jest": "^27.
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
63
|
-
"@typescript-eslint/parser": "^5.
|
|
64
|
-
"aws-sdk-mock": "^5.
|
|
65
|
-
"eslint": "^8.
|
|
66
|
-
"eslint-config-prettier": "^8.
|
|
67
|
-
"eslint-plugin-import": "^2.
|
|
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.
|
|
75
|
+
"monocle-ts": "^2.3.13",
|
|
75
76
|
"newtype-ts": "^0.3.5",
|
|
76
|
-
"prettier": "^2.
|
|
77
|
+
"prettier": "^2.6.2",
|
|
77
78
|
"rimraf": "^3.0.2",
|
|
78
79
|
"ts-mockito": "^2.6.1",
|
|
79
|
-
"typedoc": "^0.22.
|
|
80
|
-
"typescript": "^4.
|
|
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(
|
|
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
|
-
|
|
440
|
-
|
|
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
|
-
|
|
460
|
-
|
|
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
|
-
|
|
480
|
-
|
|
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
|
-
|
|
500
|
-
|
|
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,
|
|
@@ -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
|
|
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
|
|
397
|
-
expect(actualOptions
|
|
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
|
|
434
|
-
expect(actualOptions
|
|
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
|
|
496
|
-
expect(actualOptions
|
|
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
|
|
534
|
-
expect(actualOptions
|
|
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
|
|
603
|
-
expect(actualOptions
|
|
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
|
|
642
|
-
expect(actualOptions
|
|
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
|
|
711
|
-
expect(actualOptions
|
|
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
|
|
750
|
-
expect(actualOptions
|
|
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
|
|
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
|
|
878
|
+
expect(actualOptions!.algorithm).toStrictEqual(options.algorithm)
|
|
879
879
|
|
|
880
880
|
verify(
|
|
881
881
|
sudoCryptoProviderMock.decryptWithPrivateKey(
|