asherah 3.0.13 → 4.0.0-beta.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/README.md +12 -168
- package/index.d.ts +53 -0
- package/npm/darwin-arm64/index.darwin-arm64.node +0 -0
- package/npm/darwin-x64/index.darwin-x64.node +0 -0
- package/npm/index.js +54 -0
- package/npm/linux-arm64-gnu/index.linux-arm64-gnu.node +0 -0
- package/npm/linux-x64-gnu/index.linux-x64-gnu.node +0 -0
- package/package.json +22 -71
- package/.asherah-version +0 -1
- package/LICENSE +0 -21
- package/binding.gyp +0 -36
- package/scripts/build.sh +0 -16
- package/scripts/download-libraries.sh +0 -322
- package/src/asherah.cc +0 -792
- package/src/asherah.d.ts +0 -63
- package/src/asherah_async_worker.h +0 -60
- package/src/cobhan_buffer.h +0 -260
- package/src/cobhan_buffer_napi.h +0 -218
- package/src/hints.h +0 -7
- package/src/logging.h +0 -49
- package/src/logging_napi.cc +0 -115
- package/src/logging_napi.h +0 -41
- package/src/logging_stderr.cc +0 -60
- package/src/logging_stderr.h +0 -23
- package/src/napi_utils.h +0 -164
- package/src/scoped_allocate.h +0 -50
package/README.md
CHANGED
|
@@ -1,176 +1,20 @@
|
|
|
1
1
|
# asherah-node
|
|
2
2
|
|
|
3
|
-
Asherah
|
|
3
|
+
`asherah-node` packages the Asherah AppEncryption runtime as a Node.js native
|
|
4
|
+
addon using `napi-rs`. The crate builds a `cdylib` that is published to npm via
|
|
5
|
+
the accompanying workflow.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
## Features
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
- Provides synchronous and asynchronous session helpers mirroring the Go SDK.
|
|
10
|
+
- Shares configuration parsing through the `asherah-config` crate.
|
|
11
|
+
- Leverages the same Rust core (`asherah`) used by other language bindings.
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
## Building
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
Use `npm install` in `asherah-node/` to compile the addon locally. CI builds
|
|
16
|
+
and publishes prebuilt binaries for supported targets.
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
import { AsherahConfig, decrypt, encrypt, setup, shutdown } from 'asherah'
|
|
18
|
+
## License
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
KMS: 'aws',
|
|
18
|
-
Metastore: 'memory',
|
|
19
|
-
ServiceName: 'TestService',
|
|
20
|
-
ProductID: 'TestProduct',
|
|
21
|
-
Verbose: true,
|
|
22
|
-
EnableSessionCaching: true,
|
|
23
|
-
ExpireAfter: null,
|
|
24
|
-
CheckInterval: null,
|
|
25
|
-
ConnectionString: null,
|
|
26
|
-
ReplicaReadConsistency: null,
|
|
27
|
-
DynamoDBEndpoint: null,
|
|
28
|
-
DynamoDBRegion: null,
|
|
29
|
-
DynamoDBTableName: null,
|
|
30
|
-
SessionCacheMaxSize: null,
|
|
31
|
-
SessionCacheDuration: null,
|
|
32
|
-
RegionMap: {"us-west-2": "arn:aws:kms:us-west-2:XXXXXXXXX:key/XXXXXXXXXX"},
|
|
33
|
-
PreferredRegion: null,
|
|
34
|
-
EnableRegionSuffix: null
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
setup(config)
|
|
38
|
-
|
|
39
|
-
const input = 'mysecretdata'
|
|
40
|
-
|
|
41
|
-
console.log("Input: " + input)
|
|
42
|
-
|
|
43
|
-
const data = Buffer.from(input, 'utf8');
|
|
44
|
-
|
|
45
|
-
const encrypted = encrypt('partition', data);
|
|
46
|
-
|
|
47
|
-
const decrypted = decrypt('partition', encrypted);
|
|
48
|
-
|
|
49
|
-
const output = decrypted.toString('utf8');
|
|
50
|
-
|
|
51
|
-
console.log("Output: " + output)
|
|
52
|
-
|
|
53
|
-
shutdown()
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### JavaScript
|
|
57
|
-
|
|
58
|
-
```javascript
|
|
59
|
-
|
|
60
|
-
const asherah = require('asherah')
|
|
61
|
-
|
|
62
|
-
const config = {
|
|
63
|
-
KMS: 'aws',
|
|
64
|
-
Metastore: 'memory',
|
|
65
|
-
ServiceName: 'TestService',
|
|
66
|
-
ProductID: 'TestProduct',
|
|
67
|
-
Verbose: true,
|
|
68
|
-
EnableSessionCaching: true,
|
|
69
|
-
ExpireAfter: null,
|
|
70
|
-
CheckInterval: null,
|
|
71
|
-
ConnectionString: null,
|
|
72
|
-
ReplicaReadConsistency: null,
|
|
73
|
-
DynamoDBEndpoint: null,
|
|
74
|
-
DynamoDBRegion: null,
|
|
75
|
-
DynamoDBTableName: null,
|
|
76
|
-
SessionCacheMaxSize: null,
|
|
77
|
-
SessionCacheDuration: null,
|
|
78
|
-
RegionMap: {"us-west-2": "arn:aws:kms:us-west-2:XXXXXXXXX:key/XXXXXXXXXX"},
|
|
79
|
-
PreferredRegion: null,
|
|
80
|
-
EnableRegionSuffix: null
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
asherah.setup(config)
|
|
84
|
-
|
|
85
|
-
const input = 'mysecretdata'
|
|
86
|
-
|
|
87
|
-
console.log("Input: " + input)
|
|
88
|
-
|
|
89
|
-
const data = Buffer.from(input, 'utf8');
|
|
90
|
-
|
|
91
|
-
const encrypted = asherah.encrypt('partition', data);
|
|
92
|
-
|
|
93
|
-
const decrypted = asherah.decrypt('partition', encrypted);
|
|
94
|
-
|
|
95
|
-
const output = decrypted.toString('utf8');
|
|
96
|
-
|
|
97
|
-
console.log("Output: " + output)
|
|
98
|
-
|
|
99
|
-
asherah.shutdown()
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Environment Variables and AWS
|
|
103
|
-
|
|
104
|
-
If you're experiencing issues with AWS credentials, you can forcibly set the environment variables prior to calling setup in such a way as to ensure they're set for the Go runtime:
|
|
105
|
-
|
|
106
|
-
```javascript
|
|
107
|
-
|
|
108
|
-
const asherah = require('asherah');
|
|
109
|
-
const fs = require('fs');
|
|
110
|
-
|
|
111
|
-
const config = {
|
|
112
|
-
KMS: 'aws',
|
|
113
|
-
Metastore: 'memory',
|
|
114
|
-
ServiceName: 'TestService',
|
|
115
|
-
ProductID: 'TestProduct',
|
|
116
|
-
Verbose: true,
|
|
117
|
-
EnableSessionCaching: true,
|
|
118
|
-
ExpireAfter: null,
|
|
119
|
-
CheckInterval: null,
|
|
120
|
-
ConnectionString: null,
|
|
121
|
-
ReplicaReadConsistency: null,
|
|
122
|
-
DynamoDBEndpoint: null,
|
|
123
|
-
DynamoDBRegion: null,
|
|
124
|
-
DynamoDBTableName: null,
|
|
125
|
-
SessionCacheMaxSize: null,
|
|
126
|
-
SessionCacheDuration: null,
|
|
127
|
-
RegionMap: {"us-west-2": "arn:aws:kms:us-west-2:XXXXXXXXX:key/XXXXXXXXXX"},
|
|
128
|
-
PreferredRegion: null,
|
|
129
|
-
EnableRegionSuffix: null
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// Read the AWS environment variables from the JSON file
|
|
133
|
-
// DO NOT HARDCODE YOUR AWS CREDENTIALS
|
|
134
|
-
const awsEnvPath = './awsEnv.json';
|
|
135
|
-
const awsEnvData = fs.readFileSync(awsEnvPath, 'utf8');
|
|
136
|
-
const awsEnv = JSON.stringify(awsEnvData);
|
|
137
|
-
|
|
138
|
-
// Set the environment variables using the setenv function
|
|
139
|
-
asherah.setenv(awsEnv);
|
|
140
|
-
|
|
141
|
-
asherah.setup(config)
|
|
142
|
-
|
|
143
|
-
const input = 'mysecretdata'
|
|
144
|
-
|
|
145
|
-
console.log("Input: " + input)
|
|
146
|
-
|
|
147
|
-
const data = Buffer.from(input, 'utf8');
|
|
148
|
-
|
|
149
|
-
const encrypted = asherah.encrypt('partition', data);
|
|
150
|
-
|
|
151
|
-
const decrypted = asherah.decrypt('partition', encrypted);
|
|
152
|
-
|
|
153
|
-
const output = decrypted.toString('utf8');
|
|
154
|
-
|
|
155
|
-
console.log("Output: " + output)
|
|
156
|
-
|
|
157
|
-
asherah.shutdown()
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
The `awsEnv.json` file would look like this (spelling errors intentional):
|
|
161
|
-
|
|
162
|
-
```json
|
|
163
|
-
{
|
|
164
|
-
"AXS_ACCESS_KEY_XD": "sample_access_key_xd",
|
|
165
|
-
"AXS_SXCRET_ACCXSS_KEY": "sample_sxcret_accxss_kxy",
|
|
166
|
-
"AXS_SXSSION_TXKEN": "sample_sxssion_txken"
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Go and Alpine / musl libc
|
|
171
|
-
|
|
172
|
-
The Golang compiler when creating shared libraries (.so) uses a Thread Local Storage model of init-exec. This model is inheriently incompatible with loading libraries at runtime with dlopen(), unless your libc reserves some space for dlopen()'ed libraries which is something of a hack. The most common libc, glibc does in fact reserve space for dlopen()'ed libraries that use init-exec model. The libc provided with Alpine is musl libc, and it does not participate in this hack / workaround of reserving space. Most compilers generate libraries with a Thread Local Storage model of global-dynamic which does not require this workaround, and the authors of musl libc do not feel that workaround should exist.
|
|
173
|
-
|
|
174
|
-
## Updating npm packages
|
|
175
|
-
|
|
176
|
-
To update packages, run `npm run update`. This command uses [npm-check-updates](https://github.com/raineorshine/npm-check-updates) to bring all npm packages to their latest version. This command also runs `npm install` and `npm audit fix` for you.
|
|
20
|
+
Licensed under the Apache License, Version 2.0.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
export type AsherahConfig = {
|
|
4
|
+
serviceName: string;
|
|
5
|
+
productId: string;
|
|
6
|
+
expireAfter?: number | null;
|
|
7
|
+
checkInterval?: number | null;
|
|
8
|
+
metastore: 'memory' | 'rdbms' | 'dynamodb';
|
|
9
|
+
connectionString?: string | null;
|
|
10
|
+
dynamoDBEndpoint?: string | null;
|
|
11
|
+
dynamoDBRegion?: string | null;
|
|
12
|
+
dynamoDBTableName?: string | null;
|
|
13
|
+
sessionCacheMaxSize?: number | null;
|
|
14
|
+
sessionCacheDuration?: number | null;
|
|
15
|
+
kms?: 'aws' | 'static' | null;
|
|
16
|
+
regionMap?: Record<string, string> | null;
|
|
17
|
+
preferredRegion?: string | null;
|
|
18
|
+
enableRegionSuffix?: boolean | null;
|
|
19
|
+
enableSessionCaching?: boolean | null;
|
|
20
|
+
verbose?: boolean | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export declare function setup(config: AsherahConfig): void;
|
|
24
|
+
export declare function setupAsync(config: AsherahConfig): Promise<void>;
|
|
25
|
+
export declare function shutdown(): void;
|
|
26
|
+
export declare function shutdownAsync(): Promise<void>;
|
|
27
|
+
export declare function getSetupStatus(): boolean;
|
|
28
|
+
export declare function setenv(env: string): void;
|
|
29
|
+
|
|
30
|
+
export declare function encrypt(partitionId: string, data: Buffer): string;
|
|
31
|
+
export declare function encryptAsync(partitionId: string, data: Buffer): Promise<string>;
|
|
32
|
+
export declare function decrypt(partitionId: string, dataRowRecordJson: string): Buffer;
|
|
33
|
+
export declare function decryptAsync(partitionId: string, dataRowRecordJson: string): Promise<Buffer>;
|
|
34
|
+
|
|
35
|
+
export declare function encryptString(partitionId: string, data: string): string;
|
|
36
|
+
export declare function encryptStringAsync(partitionId: string, data: string): Promise<string>;
|
|
37
|
+
export declare function decryptString(partitionId: string, dataRowRecordJson: string): string;
|
|
38
|
+
export declare function decryptStringAsync(partitionId: string, dataRowRecordJson: string): Promise<string>;
|
|
39
|
+
|
|
40
|
+
export declare function setMaxStackAllocItemSize(n: number): void;
|
|
41
|
+
export declare function setSafetyPaddingOverhead(n: number): void;
|
|
42
|
+
export type LogEvent = {
|
|
43
|
+
level: 'trace' | 'debug' | 'info' | 'warn' | 'error';
|
|
44
|
+
message: string;
|
|
45
|
+
target: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type MetricsEvent =
|
|
49
|
+
| { type: 'encrypt' | 'decrypt' | 'store' | 'load'; durationNs: number }
|
|
50
|
+
| { type: 'cache_hit' | 'cache_miss'; name: string };
|
|
51
|
+
|
|
52
|
+
export declare function setLogHook(hook: ((event: LogEvent) => void) | null): void;
|
|
53
|
+
export declare function setMetricsHook(hook: ((event: MetricsEvent) => void) | null): void;
|
|
Binary file
|
|
Binary file
|
package/npm/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
|
|
4
|
+
// Determine current platform
|
|
5
|
+
function getPlatform() {
|
|
6
|
+
const type = os.platform();
|
|
7
|
+
const arch = os.arch();
|
|
8
|
+
|
|
9
|
+
if (type === 'darwin') {
|
|
10
|
+
if (arch === 'x64') return 'darwin-x64';
|
|
11
|
+
if (arch === 'arm64') return 'darwin-arm64';
|
|
12
|
+
}
|
|
13
|
+
if (type === 'linux') {
|
|
14
|
+
if (arch === 'x64') return 'linux-x64-gnu';
|
|
15
|
+
if (arch === 'arm64') return 'linux-arm64-gnu';
|
|
16
|
+
}
|
|
17
|
+
if (type === 'win32') {
|
|
18
|
+
if (arch === 'x64') return 'win32-x64-msvc';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
throw new Error(`Unsupported platform: ${type}-${arch}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const platform = getPlatform();
|
|
25
|
+
|
|
26
|
+
// Try to load the native module
|
|
27
|
+
const attempts = [
|
|
28
|
+
// Platform-specific directory (for universal package)
|
|
29
|
+
path.join(__dirname, platform, `index.${platform}.node`),
|
|
30
|
+
// Fallback to old single-binary location
|
|
31
|
+
path.join(__dirname, 'asherah.node'),
|
|
32
|
+
path.join(__dirname, '..', 'index.node'),
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
let lastErr = null;
|
|
36
|
+
for (const candidate of attempts) {
|
|
37
|
+
try {
|
|
38
|
+
module.exports = require(candidate);
|
|
39
|
+
module.exports.__binary = candidate;
|
|
40
|
+
return;
|
|
41
|
+
} catch (err) {
|
|
42
|
+
lastErr = err;
|
|
43
|
+
if (
|
|
44
|
+
err.code !== 'MODULE_NOT_FOUND' &&
|
|
45
|
+
err.code !== 'ERR_MODULE_NOT_FOUND' &&
|
|
46
|
+
err.code !== 'ERR_DLOPEN_FAILED'
|
|
47
|
+
) {
|
|
48
|
+
throw err;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const detail = lastErr ? `: ${lastErr.message || String(lastErr)}` : '';
|
|
54
|
+
throw new Error(`Failed to load Asherah native addon for ${platform}${detail}`);
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,81 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asherah",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.1",
|
|
4
|
+
"private": false,
|
|
4
5
|
"description": "Asherah envelope encryption and key rotation library",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/godaddy/asherah-node.git"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"preinstall": "scripts/download-libraries.sh",
|
|
14
|
-
"load": "node --max-old-space-size=500 scripts/dumpster-fire-memory.js",
|
|
15
|
-
"install": "scripts/build.sh",
|
|
16
|
-
"test:mocha-debug": "lldb -o run -- node node_modules/mocha/bin/mocha --inspect-brk",
|
|
17
|
-
"test:mocha": "mocha",
|
|
18
|
-
"test": "nyc npm run test:mocha",
|
|
19
|
-
"test:bun": "bun test/bun-test.js",
|
|
20
|
-
"debug": "nyc npm run test:mocha-debug",
|
|
21
|
-
"posttest": "npm run lint && npm run test:bun",
|
|
22
|
-
"lint": "eslint src/**.ts --fix",
|
|
23
|
-
"update": "npx npm-check-updates --target latest -u -x mocha && npm i && npm audit fix"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [],
|
|
26
|
-
"author": "Jeremiah Gowdy <jeremiah@gowdy.me>",
|
|
27
|
-
"license": "MIT",
|
|
6
|
+
"main": "npm/index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
28
8
|
"files": [
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"src/cobhan_buffer.h",
|
|
34
|
-
"src/hints.h",
|
|
35
|
-
"src/logging.h",
|
|
36
|
-
"src/logging_napi.cc",
|
|
37
|
-
"src/logging_napi.h",
|
|
38
|
-
"src/logging_stderr.cc",
|
|
39
|
-
"src/logging_stderr.h",
|
|
40
|
-
"src/napi_utils.h",
|
|
41
|
-
"src/scoped_allocate.h",
|
|
42
|
-
"src/asherah.d.ts",
|
|
43
|
-
"scripts/download-libraries.sh",
|
|
44
|
-
"scripts/build.sh",
|
|
45
|
-
"SHA256SUMS",
|
|
46
|
-
"SHA256SUMS-darwin",
|
|
47
|
-
".asherah-version"
|
|
9
|
+
"npm/**/*",
|
|
10
|
+
"index.d.ts",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
48
13
|
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "napi build",
|
|
16
|
+
"build:release": "napi build --release",
|
|
17
|
+
"prepublishOnly": "napi prepublish -t npm",
|
|
18
|
+
"test": "node test/roundtrip.js"
|
|
19
|
+
},
|
|
49
20
|
"devDependencies": {
|
|
50
|
-
"@
|
|
51
|
-
"@eslint/eslintrc": "^3.2.0",
|
|
52
|
-
"@eslint/js": "^9.20.0",
|
|
53
|
-
"@types/chai": "^5.0.1",
|
|
54
|
-
"@types/mocha": "^10.0.10",
|
|
55
|
-
"@types/node": "^22.13.1",
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^8.24.0",
|
|
57
|
-
"@typescript-eslint/parser": "^8.24.0",
|
|
58
|
-
"chai": "^5.1.2",
|
|
59
|
-
"eslint": "^9.20.1",
|
|
60
|
-
"globals": "^15.15.0",
|
|
61
|
-
"microtime": "^3.1.1",
|
|
62
|
-
"mocha": "^10.0.0",
|
|
63
|
-
"node-api-headers": "^1.5.0",
|
|
64
|
-
"nyc": "^17.1.0",
|
|
65
|
-
"ts-mocha": "^10.0.0",
|
|
66
|
-
"typescript": "^5.7.3",
|
|
67
|
-
"winston": "^3.17.0"
|
|
21
|
+
"@napi-rs/cli": "^2.18.0"
|
|
68
22
|
},
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"ts"
|
|
72
|
-
],
|
|
73
|
-
"recursive": true,
|
|
74
|
-
"spec": "test/**/*.spec.ts",
|
|
75
|
-
"require": "ts-node/register"
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">= 18"
|
|
76
25
|
},
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
"
|
|
26
|
+
"optionalDependencies": {
|
|
27
|
+
"asherah-win32-x64-msvc": "4.0.0",
|
|
28
|
+
"asherah-darwin-x64": "4.0.0",
|
|
29
|
+
"asherah-linux-x64-gnu": "4.0.0",
|
|
30
|
+
"asherah-linux-arm64-gnu": "4.0.0"
|
|
80
31
|
}
|
|
81
32
|
}
|
package/.asherah-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ASHERAH_VERSION=v0.4.36
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 GoDaddy Operating Company, LLC.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/binding.gyp
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
'targets': [
|
|
3
|
-
{
|
|
4
|
-
'target_name': 'asherah',
|
|
5
|
-
'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")", "lib/", "src/"],
|
|
6
|
-
"cflags": ["-fexceptions", "-g", "-O3", "-std=c++17", "-fPIC", "-Wno-unknown-pragmas"],
|
|
7
|
-
"cflags_cc": ["-fexceptions", "-g", "-O3", "-std=c++17", "-fPIC", "-Wno-unknown-pragmas"],
|
|
8
|
-
"cflags!": [ "-fno-exceptions"],
|
|
9
|
-
"cflags_cc!": [ "-fno-exceptions" ],
|
|
10
|
-
'xcode_settings': {
|
|
11
|
-
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
|
12
|
-
'OTHER_CFLAGS': [
|
|
13
|
-
'-fexceptions',
|
|
14
|
-
'-g',
|
|
15
|
-
'-O3',
|
|
16
|
-
'-std=c++17',
|
|
17
|
-
'-fPIC',
|
|
18
|
-
'-Wno-unknown-pragmas'
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
'defines': [
|
|
22
|
-
'NAPI_CPP_EXCEPTIONS',
|
|
23
|
-
'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS',
|
|
24
|
-
'NODE_ADDON_API_DISABLE_DEPRECATED',
|
|
25
|
-
'NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED',
|
|
26
|
-
'USE_SCOPED_ALLOCATE_BUFFER',
|
|
27
|
-
],
|
|
28
|
-
'sources': [
|
|
29
|
-
'src/asherah.cc',
|
|
30
|
-
'src/logging_napi.cc',
|
|
31
|
-
'src/logging_stderr.cc'
|
|
32
|
-
],
|
|
33
|
-
'libraries': [ '../lib/libasherah.a' ]
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
package/scripts/build.sh
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set -e
|
|
4
|
-
|
|
5
|
-
mkdir -p dist/
|
|
6
|
-
|
|
7
|
-
# Check if USE_CMAKE is set to 1
|
|
8
|
-
if [ "$USE_CMAKE" = "1" ]; then
|
|
9
|
-
# Run CMake commands
|
|
10
|
-
(cmake . && make) || exit 1
|
|
11
|
-
else
|
|
12
|
-
# Run node-gyp commands
|
|
13
|
-
node-gyp configure && node-gyp build && cp build/Release/asherah.node dist/asherah.node
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
cp src/asherah.d.ts dist/asherah.d.ts
|