@cipherstash/protect-ffi 0.13.0-0 → 0.14.0
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 +14 -3
- package/lib/index.d.cts +15 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -124,20 +124,31 @@ protect-ffi/
|
|
|
124
124
|
Integration tests live in the `./integration-tests` directory.
|
|
125
125
|
These tests use the local build of Rust and JavaScript artifacts to test `@cipherstash/protect-ffi` as API consumers would.
|
|
126
126
|
|
|
127
|
-
These tests rely on
|
|
127
|
+
These tests rely on:
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
- CipherStash to be configured (via `.toml` config or environment variables), and
|
|
130
|
+
- Environment variables for Postgres to be set
|
|
131
|
+
|
|
132
|
+
Example environment variables:
|
|
130
133
|
```
|
|
131
134
|
CS_CLIENT_ID=
|
|
132
135
|
CS_CLIENT_KEY=
|
|
133
136
|
CS_CLIENT_ACCESS_KEY=
|
|
134
|
-
|
|
137
|
+
CS_WORKSPACE_CRN=
|
|
138
|
+
PGPORT=5432
|
|
139
|
+
PGDATABASE=cipherstash
|
|
140
|
+
PGUSER=cipherstash
|
|
141
|
+
PGPASSWORD=password
|
|
142
|
+
PGHOST=localhost
|
|
135
143
|
```
|
|
136
144
|
|
|
137
145
|
To run integration tests:
|
|
138
146
|
```
|
|
139
147
|
npm run debug
|
|
140
148
|
cd integration-tests
|
|
149
|
+
docker compose up --detach --wait
|
|
150
|
+
npm run eql:download
|
|
151
|
+
npm run eql:install
|
|
141
152
|
npm run test
|
|
142
153
|
```
|
|
143
154
|
|
package/lib/index.d.cts
CHANGED
|
@@ -4,10 +4,10 @@ export type Client = {
|
|
|
4
4
|
readonly [sym]: unknown;
|
|
5
5
|
};
|
|
6
6
|
declare module './load.cjs' {
|
|
7
|
-
function newClient(encryptSchema
|
|
8
|
-
function encrypt(client: Client, plaintext: EncryptPayload, ctsToken?: CtsToken): Promise<
|
|
7
|
+
function newClient(encryptSchema: string): Promise<Client>;
|
|
8
|
+
function encrypt(client: Client, plaintext: EncryptPayload, ctsToken?: CtsToken): Promise<Encrypted>;
|
|
9
9
|
function decrypt(client: Client, ciphertext: string, context?: Context, ctsToken?: CtsToken): Promise<string>;
|
|
10
|
-
function encryptBulk(client: Client, plaintextTargets: EncryptPayload[], ctsToken?: CtsToken): Promise<
|
|
10
|
+
function encryptBulk(client: Client, plaintextTargets: EncryptPayload[], ctsToken?: CtsToken): Promise<Encrypted[]>;
|
|
11
11
|
function decryptBulk(client: Client, ciphertexts: BulkDecryptPayload[], ctsToken?: CtsToken): Promise<string[]>;
|
|
12
12
|
}
|
|
13
13
|
export declare function decrypt(client: Client, ciphertext: string, lockContext?: Context, ctsToken?: CtsToken): Promise<string>;
|
|
@@ -28,3 +28,15 @@ export type CtsToken = {
|
|
|
28
28
|
export type Context = {
|
|
29
29
|
identityClaim: string[];
|
|
30
30
|
};
|
|
31
|
+
export type Encrypted = {
|
|
32
|
+
k: string;
|
|
33
|
+
c: string;
|
|
34
|
+
ob: string[] | null;
|
|
35
|
+
bf: number[] | null;
|
|
36
|
+
hm: string | null;
|
|
37
|
+
i: {
|
|
38
|
+
c: string;
|
|
39
|
+
t: string;
|
|
40
|
+
};
|
|
41
|
+
v: number;
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cipherstash/protect-ffi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"scripts": {
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@neon-rs/load": "^0.1.82"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@cipherstash/protect-ffi-win32-x64-msvc": "0.
|
|
65
|
-
"@cipherstash/protect-ffi-darwin-x64": "0.
|
|
66
|
-
"@cipherstash/protect-ffi-darwin-arm64": "0.
|
|
67
|
-
"@cipherstash/protect-ffi-linux-x64-gnu": "0.
|
|
68
|
-
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.
|
|
64
|
+
"@cipherstash/protect-ffi-win32-x64-msvc": "0.14.0",
|
|
65
|
+
"@cipherstash/protect-ffi-darwin-x64": "0.14.0",
|
|
66
|
+
"@cipherstash/protect-ffi-darwin-arm64": "0.14.0",
|
|
67
|
+
"@cipherstash/protect-ffi-linux-x64-gnu": "0.14.0",
|
|
68
|
+
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.14.0"
|
|
69
69
|
}
|
|
70
70
|
}
|