asherah 4.0.23 → 4.0.25
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/npm/index.js +16 -1
- package/package.json +10 -9
package/npm/index.js
CHANGED
|
@@ -215,12 +215,27 @@ function set_log_hook(callback) {
|
|
|
215
215
|
return native.setLogHook(callback);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
// Wrap decrypt/decryptAsync to accept both String and Buffer inputs.
|
|
219
|
+
// The native functions take Buffer to avoid V8 UTF-16→UTF-8 string conversion
|
|
220
|
+
// overhead that scales with payload size.
|
|
221
|
+
function toBuffer(input) {
|
|
222
|
+
return typeof input === 'string' ? Buffer.from(input) : input;
|
|
223
|
+
}
|
|
224
|
+
function decrypt(partitionId, dataRowRecord) {
|
|
225
|
+
return native.decrypt(partitionId, toBuffer(dataRowRecord));
|
|
226
|
+
}
|
|
227
|
+
function decryptAsync(partitionId, dataRowRecord) {
|
|
228
|
+
return native.decryptAsync(partitionId, toBuffer(dataRowRecord));
|
|
229
|
+
}
|
|
230
|
+
|
|
218
231
|
// Export everything from native addon
|
|
219
232
|
Object.assign(module.exports, native);
|
|
220
233
|
|
|
221
234
|
// Override setup/setupAsync with normalizing versions
|
|
222
235
|
module.exports.setup = setup;
|
|
223
236
|
module.exports.setupAsync = setupAsync;
|
|
237
|
+
module.exports.decrypt = decrypt;
|
|
238
|
+
module.exports.decryptAsync = decryptAsync;
|
|
224
239
|
|
|
225
240
|
// snake_case aliases for canonical API compatibility
|
|
226
241
|
module.exports.setup_async = setupAsync;
|
|
@@ -228,7 +243,7 @@ module.exports.shutdown_async = native.shutdownAsync;
|
|
|
228
243
|
module.exports.encrypt_async = native.encryptAsync;
|
|
229
244
|
module.exports.encrypt_string = native.encryptString;
|
|
230
245
|
module.exports.encrypt_string_async = native.encryptStringAsync;
|
|
231
|
-
module.exports.decrypt_async =
|
|
246
|
+
module.exports.decrypt_async = decryptAsync;
|
|
232
247
|
module.exports.decrypt_string = native.decryptString;
|
|
233
248
|
module.exports.decrypt_string_async = native.decryptStringAsync;
|
|
234
249
|
module.exports.set_max_stack_alloc_item_size = native.setMaxStackAllocItemSize;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asherah",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Asherah envelope encryption and key rotation library",
|
|
6
6
|
"main": "npm/index.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"test": "node test/roundtrip.js && node test/e2e-consumer.js",
|
|
31
31
|
"test:unit": "node test/roundtrip.js",
|
|
32
32
|
"test:e2e": "node test/e2e-consumer.js",
|
|
33
|
+
"test:e2e-aws": "node test/e2e-aws.js",
|
|
33
34
|
"test:bun": "bun test/roundtrip.js"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
@@ -39,13 +40,13 @@
|
|
|
39
40
|
"node": ">= 18"
|
|
40
41
|
},
|
|
41
42
|
"optionalDependencies": {
|
|
42
|
-
"asherah-darwin-arm64": "4.0.
|
|
43
|
-
"asherah-darwin-x64": "4.0.
|
|
44
|
-
"asherah-linux-x64-gnu": "4.0.
|
|
45
|
-
"asherah-linux-arm64-gnu": "4.0.
|
|
46
|
-
"asherah-linux-x64-musl": "4.0.
|
|
47
|
-
"asherah-linux-arm64-musl": "4.0.
|
|
48
|
-
"asherah-windows-x64": "4.0.
|
|
49
|
-
"asherah-windows-arm64": "4.0.
|
|
43
|
+
"asherah-darwin-arm64": "4.0.25",
|
|
44
|
+
"asherah-darwin-x64": "4.0.25",
|
|
45
|
+
"asherah-linux-x64-gnu": "4.0.25",
|
|
46
|
+
"asherah-linux-arm64-gnu": "4.0.25",
|
|
47
|
+
"asherah-linux-x64-musl": "4.0.25",
|
|
48
|
+
"asherah-linux-arm64-musl": "4.0.25",
|
|
49
|
+
"asherah-windows-x64": "4.0.25",
|
|
50
|
+
"asherah-windows-arm64": "4.0.25"
|
|
50
51
|
}
|
|
51
52
|
}
|