ice-client
Advanced tools
Comparing version 0.7.0 to 0.7.1
{ | ||
"name": "ice-client", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Encrypt sensitive data at rest", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,3 @@ import { before, test } from 'ava'; | ||
await sts.assumeRole({ | ||
RoleArn: 'arn:aws:iam::178540880712:role/logs/a4e8d087-8f22-43d9-8424-70505e9e9368', | ||
RoleArn: 'arn:aws:iam::178540880712:role/logs/b2bd51cc-856a-4521-ba65-c49fa9c13449', | ||
RoleSessionName: 'test', | ||
@@ -28,3 +28,3 @@ }).promise() | ||
}) | ||
.catch(err => t.fail(err)); | ||
.catch(err => t.fail(err.message)); | ||
}); | ||
@@ -31,0 +31,0 @@ |
import test from 'ava'; | ||
import * as dotenv from 'dotenv'; | ||
import * as fs from 'fs'; | ||
import * as ICE from '../index'; | ||
@@ -19,4 +20,7 @@ | ||
t.true(ciphertext instanceof Buffer); | ||
// console.log(JSON.stringify(ciphertext)); | ||
// console.log(ciphertext.toString('base64')); | ||
if (process.env.WRITE_FIXTURES === 'true') { | ||
fs.writeFileSync('test/ciphertext.json', JSON.stringify(ciphertext)); | ||
fs.writeFileSync('test/ciphertext.b64', ciphertext.toString('base64')); | ||
} | ||
}); | ||
@@ -30,3 +34,3 @@ | ||
test('decrypt takes a base64 string returns a plaintext buffer', async (t) => { | ||
const ciphertext = 'AQECAHgGNDGCIqrXacvz2kvsHLIukEEJ/GO8o5QqThrjs0W/ugAAAGkwZwYJKoZIhvcNAQcGoFowWAIBADBTBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDDncttHN3uJflZxpwIBEIAmRbijyuQWeMcb7xzoEaA+PSVgtuMziR6qmwrVZVL4QxC+YqaeOR8='; | ||
const ciphertext = fs.readFileSync('test/ciphertext.b64').toString(); | ||
const plaintext = await ICE.decrypt(ciphertext); | ||
@@ -39,11 +43,4 @@ t.true(plaintext instanceof Buffer); | ||
test('decrypt takes a buffer and returns a plaintext buffer', async (t) => { | ||
const ciphertext = Buffer.from([ | ||
1, 1, 2, 0, 120, 6, 52, 49, 130, 34, 170, 215, 105, 203, 243, 218, 75, 236, 28, 178, 46, 144, | ||
65, 9, 252, 99, 188, 163, 148, 42, 78, 26, 227, 179, 69, 191, 186, 0, 0, 0, 105, 48, 103, 6, 9, | ||
42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 90, 48, 88, 2, 1, 0, 48, 83, 6, 9, 42, 134, 72, 134, | ||
247, 13, 1, 7, 1, 48, 30, 6, 9, 96, 134, 72, 1, 101, 3, 4, 1, 46, 48, 17, 4, 12, 227, 113, 167, | ||
101, 107, 126, 227, 36, 13, 13, 137, 119, 2, 1, 16, 128, 38, 133, 95, 168, 101, 15, 139, 92, | ||
195, 172, 191, 49, 152, 204, 253, 15, 19, 35, 236, 10, 51, 186, 217, 225, 184, 116, 82, 229, | ||
125, 225, 205, 44, 148, 44, 214, 238, 84, 222, 100, | ||
]); | ||
const obj = JSON.parse(fs.readFileSync('test/ciphertext.json')); | ||
const ciphertext = Buffer.from(obj.data); | ||
t.true(ciphertext instanceof Buffer); | ||
@@ -60,3 +57,6 @@ | ||
t.true(cipherdata.key instanceof Buffer); | ||
// console.log(JSON.stringify(cipherdata)); | ||
if (process.env.WRITE_FIXTURES === 'true') { | ||
fs.writeFileSync('test/cipherdata.json', JSON.stringify(cipherdata)); | ||
} | ||
}); | ||
@@ -73,13 +73,13 @@ | ||
ciphertext: Buffer.from([ | ||
171, 149, 138, 206, 138, 6, 223, 54, 241, 164, 82, 164, 212, 94, 242, 227, | ||
86, 154, 96, 105, 14, 240, 204, 157, 124, 206, 254, 233, 17, 39, 216, 237, | ||
]), | ||
key: Buffer.from([ | ||
1, 1, 3, 0, 120, 6, 52, 49, 130, 34, 170, 215, 105, 203, 243, 218, 75, 236, 28, 178, 46, 144, | ||
65, 9, 252, 99, 188, 163, 148, 42, 78, 26, 227, 179, 69, 191, 186, 0, 0, 0, 126, 48, 124, 6, | ||
9, 42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 111, 48, 109, 2, 1, 0, 48, 104, 6, 9, 42, 134, | ||
72, 134, 247, 13, 1, 7, 1, 48, 30, 6, 9, 96, 134, 72, 1, 101, 3, 4, 1, 46, 48, 17, 4, 12, 95, | ||
55, 50, 58, 21, 30, 32, 255, 201, 228, 113, 10, 2, 1, 16, 128, 59, 50, 201, 40, 70, 155, 159, | ||
75, 67, 130, 124, 92, 64, 182, 150, 175, 141, 5, 175, 8, 107, 143, 2, 61, 165, 117, 163, 15, | ||
210, 72, 165, 217, 223, 2, 72, 26, 200, 127, 126, 15, 50, 14, 249, 155, 38, 160, 149, 178, | ||
133, 119, 145, 180, 227, 125, 36, 191, 248, 218, 80, 177, | ||
1, 1, 3, 0, 120, 20, 239, 156, 49, 250, 67, 150, 147, 213, 78, 46, 163, 138, 228, 64, 136, | ||
197, 220, 15, 174, 131, 45, 213, 143, 135, 184, 211, 88, 107, 104, 169, 94, 0, 0, 0, 126, 48, | ||
124, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 111, 48, 109, 2, 1, 0, 48, 104, 6, 9, 42, | ||
134, 72, 134, 247, 13, 1, 7, 1, 48, 30, 6, 9, 96, 134, 72, 1, 101, 3, 4, 1, 46, 48, 17, 4, | ||
12, 126, 96, 22, 111, 127, 117, 159, 91, 186, 149, 228, 28, 2, 1, 16, 128, 59, 201, 6, 170, | ||
236, 201, 169, 114, 105, 211, 244, 142, 42, 50, 32, 114, 84, 182, 3, 50, 174, 50, 215, 89, | ||
28, 56, 254, 235, 86, 145, 250, 194, 43, 247, 34, 152, 178, 110, 65, 24, 12, 105, 194, 109, | ||
9, 8, 12, 200, 125, 21, 233, 156, 56, 194, 104, 243, 111, 172, 184, 178, | ||
]), | ||
@@ -86,0 +86,0 @@ }; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27005
24
0
554
17