asherah 1.0.26 → 1.0.29
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ export declare type AsherahConfig = {
|
|
|
28
28
|
sessionCache: boolean;
|
|
29
29
|
debugOutput: boolean;
|
|
30
30
|
};
|
|
31
|
-
export declare function
|
|
31
|
+
export declare function setupJson(config: AsherahConfig): void;
|
|
32
32
|
export declare function decrypt(partitionId: string, dataRowRecord: DataRowRecord): Buffer;
|
|
33
33
|
export declare function encrypt(partitionId: string, data: Buffer): DataRowRecord;
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encrypt = exports.decrypt = exports.
|
|
3
|
+
exports.encrypt = exports.decrypt = exports.setupJson = void 0;
|
|
4
4
|
const cobhan_1 = require("cobhan");
|
|
5
5
|
const libasherah = (0, cobhan_1.load_platform_library)('node_modules/asherah/binaries', 'libasherah', {
|
|
6
6
|
'Encrypt': ['int32', ['pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer']],
|
|
7
7
|
'Decrypt': ['int32', ['pointer', 'pointer', 'pointer', 'int64', 'pointer', 'int64', 'pointer']],
|
|
8
|
-
'
|
|
8
|
+
'SetupJson': ['int32', ['pointer']]
|
|
9
9
|
});
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const rdbmsConnectionStringBuffer = (0, cobhan_1.string_to_cbuffer)(config.rdbmsConnectionString);
|
|
14
|
-
const dynamoDbEndpointBuffer = (0, cobhan_1.string_to_cbuffer)(config.dynamoDbEndpoint);
|
|
15
|
-
const dynamoDbRegionBuffer = (0, cobhan_1.string_to_cbuffer)(config.dynamoDbRegion);
|
|
16
|
-
const dynamoDbTableNameBuffer = (0, cobhan_1.string_to_cbuffer)(config.dynamoDbTableName);
|
|
17
|
-
const enableRegionSuffixInt = config.enableRegionSuffix ? 1 : 0;
|
|
18
|
-
const serviceNameBuffer = (0, cobhan_1.string_to_cbuffer)(config.serviceName);
|
|
19
|
-
const productIdBuffer = (0, cobhan_1.string_to_cbuffer)(config.productId);
|
|
20
|
-
const preferredRegionBuffer = (0, cobhan_1.string_to_cbuffer)(config.preferredRegion);
|
|
21
|
-
const regionMapBuffer = (0, cobhan_1.string_to_cbuffer)(config.regionMap);
|
|
22
|
-
const verboseInt = config.verbose ? 1 : 0;
|
|
23
|
-
const sessionCacheInt = config.sessionCache ? 1 : 0;
|
|
24
|
-
const debugOutputInt = config.debugOutput ? 1 : 0;
|
|
25
|
-
const result = libasherah.Setup(kmsTypeBuffer, metastoreBuffer, rdbmsConnectionStringBuffer, dynamoDbEndpointBuffer, dynamoDbRegionBuffer, dynamoDbTableNameBuffer, enableRegionSuffixInt, serviceNameBuffer, productIdBuffer, preferredRegionBuffer, regionMapBuffer, verboseInt, sessionCacheInt, debugOutputInt);
|
|
10
|
+
function setupJson(config) {
|
|
11
|
+
const configJsonBuffer = (0, cobhan_1.string_to_cbuffer)(JSON.stringify(config));
|
|
12
|
+
const result = libasherah.SetupJson(configJsonBuffer);
|
|
26
13
|
if (result < 0) {
|
|
27
|
-
throw new Error('
|
|
14
|
+
throw new Error('setupJson failed: ' + result);
|
|
28
15
|
}
|
|
29
16
|
}
|
|
30
|
-
exports.
|
|
17
|
+
exports.setupJson = setupJson;
|
|
31
18
|
function decrypt(partitionId, dataRowRecord) {
|
|
32
19
|
const partitionIdBuffer = (0, cobhan_1.string_to_cbuffer)(partitionId);
|
|
33
20
|
const encryptedDataBuffer = (0, cobhan_1.buffer_to_cbuffer)(dataRowRecord.Data);
|