@nivinjoseph/n-sec 4.0.4 → 5.0.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/dist/api-security/alg-type.js +1 -0
- package/dist/api-security/alg-type.js.map +1 -1
- package/dist/api-security/claim.d.ts +0 -1
- package/dist/api-security/claim.js +2 -2
- package/dist/api-security/claim.js.map +1 -1
- package/dist/api-security/claims-identity.js +1 -0
- package/dist/api-security/claims-identity.js.map +1 -1
- package/dist/api-security/expired-token-exception.d.ts +0 -1
- package/dist/api-security/expired-token-exception.js +2 -2
- package/dist/api-security/expired-token-exception.js.map +1 -1
- package/dist/api-security/invalid-token-exception.d.ts +0 -1
- package/dist/api-security/invalid-token-exception.js +3 -3
- package/dist/api-security/invalid-token-exception.js.map +1 -1
- package/dist/api-security/json-web-token.d.ts +2 -3
- package/dist/api-security/json-web-token.js +58 -70
- package/dist/api-security/json-web-token.js.map +1 -1
- package/dist/api-security/security-token.js +1 -0
- package/dist/api-security/security-token.js.map +1 -1
- package/dist/crypto/crypto-exception.js +1 -0
- package/dist/crypto/crypto-exception.js.map +1 -1
- package/dist/crypto/hash.d.ts +2 -3
- package/dist/crypto/hash.js +5 -5
- package/dist/crypto/hash.js.map +1 -1
- package/dist/crypto/hmac.d.ts +1 -2
- package/dist/crypto/hmac.js +4 -4
- package/dist/crypto/hmac.js.map +1 -1
- package/dist/crypto/symmetric-encryption.d.ts +1 -2
- package/dist/crypto/symmetric-encryption.js +15 -20
- package/dist/crypto/symmetric-encryption.js.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/api-security/claim.ts +1 -2
- package/src/api-security/expired-token-exception.ts +1 -2
- package/src/api-security/invalid-token-exception.ts +2 -3
- package/src/api-security/json-web-token.ts +26 -27
- package/src/crypto/hash.ts +6 -7
- package/src/crypto/hmac.ts +4 -5
- package/src/crypto/symmetric-encryption.ts +17 -25
- package/test/hash.test.ts +22 -23
- package/test/hmac.test.ts +9 -9
- package/test/json-web-token.test.ts +35 -33
- package/test/symmetric-encryption.test.ts +2 -1
- package/tsconfig.json +1 -0
|
@@ -11,6 +11,7 @@ suite("SymmetricEncryption", () =>
|
|
|
11
11
|
test("must return string value that is not null, empty or whitespace", async () =>
|
|
12
12
|
{
|
|
13
13
|
let key = await SymmetricEncryption.generateKey();
|
|
14
|
+
console.log("key", key);
|
|
14
15
|
Assert.ok(key !== null && !key.isEmptyOrWhiteSpace());
|
|
15
16
|
});
|
|
16
17
|
|
|
@@ -173,7 +174,7 @@ suite("SymmetricEncryption", () =>
|
|
|
173
174
|
let key = await SymmetricEncryption.generateKey();
|
|
174
175
|
let value = "password";
|
|
175
176
|
let encrypted = await SymmetricEncryption.encrypt(key, value);
|
|
176
|
-
let decrypted =
|
|
177
|
+
let decrypted = SymmetricEncryption.decrypt(key, encrypted);
|
|
177
178
|
Assert.strictEqual(decrypted, value);
|
|
178
179
|
});
|
|
179
180
|
|