asherah 4.0.0-beta.8 → 4.0.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 +32 -10
- package/index.d.ts +15 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
# asherah
|
|
1
|
+
# asherah
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Node.js bindings for the Asherah envelope encryption and key rotation library.
|
|
4
|
+
|
|
5
|
+
Prebuilt native binaries are published to npm for Linux (x64/arm64, glibc and
|
|
6
|
+
musl), macOS (x64/arm64), and Windows (x64/arm64). The correct binary is
|
|
7
|
+
selected automatically at install time.
|
|
6
8
|
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
11
|
+
- Synchronous and asynchronous encrypt/decrypt APIs
|
|
12
|
+
- Compatible with Go, Python, Ruby, Java, and .NET Asherah implementations
|
|
13
|
+
- SQLite, MySQL, PostgreSQL, and DynamoDB metastore support
|
|
14
|
+
- AWS KMS and static key management
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install asherah
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
const asherah = require('asherah');
|
|
26
|
+
|
|
27
|
+
asherah.setup({
|
|
28
|
+
kms: 'static',
|
|
29
|
+
metastore: 'memory',
|
|
30
|
+
serviceName: 'myservice',
|
|
31
|
+
productId: 'myproduct',
|
|
32
|
+
});
|
|
12
33
|
|
|
13
|
-
|
|
34
|
+
const encrypted = asherah.encrypt('partition', Buffer.from('hello world'));
|
|
35
|
+
const decrypted = asherah.decrypt('partition', encrypted);
|
|
14
36
|
|
|
15
|
-
|
|
16
|
-
|
|
37
|
+
asherah.shutdown();
|
|
38
|
+
```
|
|
17
39
|
|
|
18
40
|
## License
|
|
19
41
|
|
package/index.d.ts
CHANGED
|
@@ -74,6 +74,21 @@ export declare function decryptStringAsync(partitionId: string, dataRowRecordJso
|
|
|
74
74
|
export declare function setMaxStackAllocItemSize(n: number): void;
|
|
75
75
|
export declare function setSafetyPaddingOverhead(n: number): void;
|
|
76
76
|
|
|
77
|
+
export declare class SessionFactory {
|
|
78
|
+
constructor(config: AsherahConfig | AsherahConfigCompat);
|
|
79
|
+
static fromEnv(): SessionFactory;
|
|
80
|
+
getSession(partitionId: string): AsherahSession;
|
|
81
|
+
close(): void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare class AsherahSession {
|
|
85
|
+
encrypt(data: Buffer): string;
|
|
86
|
+
encryptString(data: string): string;
|
|
87
|
+
decrypt(dataRowRecordJson: string): Buffer;
|
|
88
|
+
decryptString(dataRowRecordJson: string): string;
|
|
89
|
+
close(): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
77
92
|
export type LogEvent = {
|
|
78
93
|
level: 'trace' | 'debug' | 'info' | 'warn' | 'error';
|
|
79
94
|
message: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asherah",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Asherah envelope encryption and key rotation library",
|
|
6
6
|
"main": "npm/index.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"node": ">= 18"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"asherah-darwin-arm64": "4.0.
|
|
41
|
-
"asherah-darwin-x64": "4.0.
|
|
42
|
-
"asherah-linux-x64-gnu": "4.0.
|
|
43
|
-
"asherah-linux-arm64-gnu": "4.0.
|
|
44
|
-
"asherah-linux-x64-musl": "4.0.
|
|
45
|
-
"asherah-linux-arm64-musl": "4.0.
|
|
46
|
-
"asherah-windows-x64": "4.0.
|
|
47
|
-
"asherah-windows-arm64": "4.0.
|
|
40
|
+
"asherah-darwin-arm64": "4.0.1",
|
|
41
|
+
"asherah-darwin-x64": "4.0.1",
|
|
42
|
+
"asherah-linux-x64-gnu": "4.0.1",
|
|
43
|
+
"asherah-linux-arm64-gnu": "4.0.1",
|
|
44
|
+
"asherah-linux-x64-musl": "4.0.1",
|
|
45
|
+
"asherah-linux-arm64-musl": "4.0.1",
|
|
46
|
+
"asherah-windows-x64": "4.0.1",
|
|
47
|
+
"asherah-windows-arm64": "4.0.1"
|
|
48
48
|
}
|
|
49
49
|
}
|