asherah 1.0.28 → 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
|
@@ -29,6 +29,5 @@ export declare type AsherahConfig = {
|
|
|
29
29
|
debugOutput: boolean;
|
|
30
30
|
};
|
|
31
31
|
export declare function setupJson(config: AsherahConfig): void;
|
|
32
|
-
export declare function setup(config: AsherahConfig): void;
|
|
33
32
|
export declare function decrypt(partitionId: string, dataRowRecord: DataRowRecord): Buffer;
|
|
34
33
|
export declare function encrypt(partitionId: string, data: Buffer): DataRowRecord;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
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
|
-
'Setup': ['int32', ['pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'int32', 'pointer', 'pointer', 'pointer', 'pointer', 'int32', 'int32', 'int32']],
|
|
9
8
|
'SetupJson': ['int32', ['pointer']]
|
|
10
9
|
});
|
|
11
10
|
function setupJson(config) {
|
|
@@ -16,27 +15,6 @@ function setupJson(config) {
|
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
exports.setupJson = setupJson;
|
|
19
|
-
function setup(config) {
|
|
20
|
-
const kmsTypeBuffer = (0, cobhan_1.string_to_cbuffer)(config.kmsType);
|
|
21
|
-
const metastoreBuffer = (0, cobhan_1.string_to_cbuffer)(config.metastore);
|
|
22
|
-
const rdbmsConnectionStringBuffer = (0, cobhan_1.string_to_cbuffer)(config.rdbmsConnectionString);
|
|
23
|
-
const dynamoDbEndpointBuffer = (0, cobhan_1.string_to_cbuffer)(config.dynamoDbEndpoint);
|
|
24
|
-
const dynamoDbRegionBuffer = (0, cobhan_1.string_to_cbuffer)(config.dynamoDbRegion);
|
|
25
|
-
const dynamoDbTableNameBuffer = (0, cobhan_1.string_to_cbuffer)(config.dynamoDbTableName);
|
|
26
|
-
const enableRegionSuffixInt = config.enableRegionSuffix ? 1 : 0;
|
|
27
|
-
const serviceNameBuffer = (0, cobhan_1.string_to_cbuffer)(config.serviceName);
|
|
28
|
-
const productIdBuffer = (0, cobhan_1.string_to_cbuffer)(config.productId);
|
|
29
|
-
const preferredRegionBuffer = (0, cobhan_1.string_to_cbuffer)(config.preferredRegion);
|
|
30
|
-
const regionMapBuffer = (0, cobhan_1.string_to_cbuffer)(config.regionMap);
|
|
31
|
-
const verboseInt = config.verbose ? 1 : 0;
|
|
32
|
-
const sessionCacheInt = config.sessionCache ? 1 : 0;
|
|
33
|
-
const debugOutputInt = config.debugOutput ? 1 : 0;
|
|
34
|
-
const result = libasherah.Setup(kmsTypeBuffer, metastoreBuffer, rdbmsConnectionStringBuffer, dynamoDbEndpointBuffer, dynamoDbRegionBuffer, dynamoDbTableNameBuffer, enableRegionSuffixInt, serviceNameBuffer, productIdBuffer, preferredRegionBuffer, regionMapBuffer, verboseInt, sessionCacheInt, debugOutputInt);
|
|
35
|
-
if (result < 0) {
|
|
36
|
-
throw new Error('setup failed: ' + result);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.setup = setup;
|
|
40
18
|
function decrypt(partitionId, dataRowRecord) {
|
|
41
19
|
const partitionIdBuffer = (0, cobhan_1.string_to_cbuffer)(partitionId);
|
|
42
20
|
const encryptedDataBuffer = (0, cobhan_1.buffer_to_cbuffer)(dataRowRecord.Data);
|