@k9o/kibo 1.1.1 → 1.3.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/CHANGELOG.md +23 -0
- package/README.md +54 -32
- package/dist/index.d.ts +54 -68
- package/dist/index.js +133 -75
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +18 -31
- package/package.json +3 -3
- package/src/client-factory.ts +1 -1
- package/src/crypto-types.ts +3 -3
- package/src/crypto.ts +11 -24
- package/src/index.ts +8 -13
- package/src/types.ts +18 -31
- package/src/vault.ts +71 -76
- package/src/wasm-loader.ts +106 -0
- package/wasm/kibo_kms_rest_ffi.js +9 -9
- package/wasm/kibo_kms_rest_ffi_bg.wasm +0 -0
- package/wasm/kibo_kms_rest_ffi_bg.wasm.d.ts +3 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.3.0 — 2026-10-26
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- `vault.secrets.get(name)` looks the secret up by exact name through the list route and returns its metadata.
|
|
8
|
+
- `region` is optional on every named-secret method.
|
|
9
|
+
- `vault.secrets.revealChallenge` takes an optional `reason`.
|
|
10
|
+
- `KIBO_WASM_ERROR` now says whether the core is missing or present but failed to load.
|
|
11
|
+
- README: `encrypt` and `decrypt` are standalone exports, not methods on the client. The vault is `client.kibo.vault`.
|
|
12
|
+
|
|
13
|
+
### Removed
|
|
14
|
+
|
|
15
|
+
- Nothing.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Nothing. `setZkWasm(core)` remains the way to supply your own core.
|
|
20
|
+
|
|
21
|
+
## 1.0.0
|
|
22
|
+
|
|
23
|
+
First public release.
|
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Kibo is the Kilimanjaro vault SDK. Store and reveal secrets, keep wrapped data keys, and encrypt on the client with keys held in your own KMS.
|
|
4
4
|
|
|
5
|
+
Kilimanjaro is the AI-native foundation for building critical applications. Its products are Keep (AI Security and Governance),
|
|
6
|
+
Pulse (Data Intelligence), Gate (Customer Identity and Access Management) and Kibo (Keys and Secrets Management).
|
|
7
|
+
|
|
5
8
|
## Contents
|
|
6
9
|
|
|
7
10
|
- [Links](#links)
|
|
@@ -12,6 +15,11 @@ Kibo is the Kilimanjaro vault SDK. Store and reveal secrets, keep wrapped data k
|
|
|
12
15
|
- [Encrypt and decrypt](#encrypt-and-decrypt)
|
|
13
16
|
- [Handle errors](#handle-errors)
|
|
14
17
|
- [Appendix](#appendix)
|
|
18
|
+
- [Client options](#client-options)
|
|
19
|
+
- [Methods](#methods)
|
|
20
|
+
- [Encrypt and decrypt fields](#encrypt-and-decrypt-fields)
|
|
21
|
+
- [Error codes](#error-codes)
|
|
22
|
+
- [Related packages](#related-packages)
|
|
15
23
|
|
|
16
24
|
## Links
|
|
17
25
|
|
|
@@ -19,11 +27,6 @@ Kibo is the Kilimanjaro vault SDK. Store and reveal secrets, keep wrapped data k
|
|
|
19
27
|
- Documentation / Developer Hub: <https://docs.kilimanjaro.dev>
|
|
20
28
|
- Platform API: <https://api.k9o.io>
|
|
21
29
|
- Platform Console: <https://console.k9o.io>
|
|
22
|
-
- [Client options](#client-options)
|
|
23
|
-
- [Methods](#methods)
|
|
24
|
-
- [Encrypt and decrypt fields](#encrypt-and-decrypt-fields)
|
|
25
|
-
- [Error codes](#error-codes)
|
|
26
|
-
- [Related packages](#related-packages)
|
|
27
30
|
|
|
28
31
|
## Install
|
|
29
32
|
|
|
@@ -34,8 +37,9 @@ npm install @k9o/kibo @k9o/core
|
|
|
34
37
|
Bun works too: `bun add @k9o/kibo @k9o/core`.
|
|
35
38
|
|
|
36
39
|
- Needs a runtime with global `fetch`: Node 18+, Bun 1.1+, or a modern browser.
|
|
37
|
-
- Needs `@k9o/core`, which provides the client. The vault is
|
|
38
|
-
- `encrypt` and `decrypt`
|
|
40
|
+
- Needs `@k9o/core`, which provides the client. The vault is `client.kibo.vault`.
|
|
41
|
+
- `encrypt` and `decrypt` are standalone exports of `@k9o/kibo`, not methods on the client.
|
|
42
|
+
- They use the Kibo core (WebAssembly), which the package ships. See [encrypt and decrypt](#encrypt-and-decrypt).
|
|
39
43
|
|
|
40
44
|
## Quick start
|
|
41
45
|
|
|
@@ -53,13 +57,12 @@ const client = createClient({
|
|
|
53
57
|
|
|
54
58
|
For a custom host, pass the full organization host as `baseUrl` and `projectSlug`, and leave out `orgSlug`. See [client options](#client-options).
|
|
55
59
|
|
|
56
|
-
Create a secret. `region` is
|
|
60
|
+
Create a secret. `region` is optional on every secret method. Pass it to pin a region, such as `region: "de01"`.
|
|
57
61
|
|
|
58
62
|
```ts
|
|
59
63
|
const created = await client.kibo.vault.secrets.create({
|
|
60
64
|
name: "tasks/webhook-signing-key",
|
|
61
65
|
value: "whsec_example",
|
|
62
|
-
region: "de01",
|
|
63
66
|
});
|
|
64
67
|
const secret = created.data;
|
|
65
68
|
|
|
@@ -85,16 +88,30 @@ for (const item of secrets) {
|
|
|
85
88
|
tasks/webhook-signing-key 1
|
|
86
89
|
```
|
|
87
90
|
|
|
91
|
+
Read one secret's metadata by its exact name. This does not reveal the value.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const found = await client.kibo.vault.secrets.get("tasks/webhook-signing-key");
|
|
95
|
+
|
|
96
|
+
console.log(found.data.name, found.data.version);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
tasks/webhook-signing-key 1
|
|
101
|
+
```
|
|
102
|
+
|
|
88
103
|
Every method resolves to `{ data, meta }`. See [methods](#methods) for the full list.
|
|
89
104
|
|
|
90
105
|
## Reveal a secret
|
|
91
106
|
|
|
92
107
|
Revealing takes two calls: ask for a single-use challenge, then present it.
|
|
108
|
+
A plain read of a secret is a reveal, so it is refused without the challenge.
|
|
93
109
|
|
|
94
110
|
```ts
|
|
95
|
-
const challenge = await client.kibo.vault.secrets.revealChallenge("tasks/webhook-signing-key", {
|
|
111
|
+
const challenge = await client.kibo.vault.secrets.revealChallenge("tasks/webhook-signing-key", {
|
|
112
|
+
reason: "rotate the webhook endpoint",
|
|
113
|
+
});
|
|
96
114
|
const revealed = await client.kibo.vault.secrets.reveal("tasks/webhook-signing-key", {
|
|
97
|
-
region: "de01",
|
|
98
115
|
challenge: challenge.data.challenge,
|
|
99
116
|
});
|
|
100
117
|
|
|
@@ -127,22 +144,23 @@ aws-kms
|
|
|
127
144
|
|
|
128
145
|
## Encrypt and decrypt
|
|
129
146
|
|
|
130
|
-
`encrypt` and `decrypt` run on your machine against your own KMS. They
|
|
131
|
-
This package has no cryptography of its own.
|
|
147
|
+
`encrypt` and `decrypt` run on your machine against your own KMS. They make no call to the platform.
|
|
148
|
+
They wrap the Kibo core, a WebAssembly module. This package has no cryptography of its own.
|
|
132
149
|
|
|
133
|
-
- The
|
|
134
|
-
-
|
|
135
|
-
-
|
|
150
|
+
- The package ships the core under `wasm/` and loads it on first use.
|
|
151
|
+
- To use your own build, load it and pass it to `setZkWasm(core)`.
|
|
152
|
+
- A missing or unloadable core fails with `KIBO_WASM_ERROR`. The message says which. See [handle errors](#handle-errors).
|
|
136
153
|
- The vault methods above work without the core.
|
|
137
154
|
|
|
138
155
|
```ts
|
|
139
156
|
import { encrypt, decrypt } from "@k9o/kibo";
|
|
157
|
+
import type { KiboEncryptInput } from "@k9o/kibo";
|
|
140
158
|
|
|
141
159
|
const kmsToken = process.env.KMS_FEDERATED_TOKEN ?? "";
|
|
142
160
|
const context = [{ key: "collection", value: "tasks" }];
|
|
143
161
|
const title = new TextEncoder().encode("Write the README");
|
|
144
162
|
|
|
145
|
-
const
|
|
163
|
+
const input: KiboEncryptInput = {
|
|
146
164
|
provider: "aws-kms",
|
|
147
165
|
posture: "byok",
|
|
148
166
|
kms_cred: { secret: kmsToken, expires_at_unix_secs: 1_800_000_000 },
|
|
@@ -151,7 +169,9 @@ const sealed = await encrypt({
|
|
|
151
169
|
attestation_tier: "software",
|
|
152
170
|
encryption_context: context,
|
|
153
171
|
plaintext: title,
|
|
154
|
-
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const sealed = await encrypt(input);
|
|
155
175
|
|
|
156
176
|
const opened = await decrypt({
|
|
157
177
|
kms_cred: { secret: kmsToken, expires_at_unix_secs: 1_800_000_000 },
|
|
@@ -175,7 +195,7 @@ Write the README
|
|
|
175
195
|
|
|
176
196
|
## Handle errors
|
|
177
197
|
|
|
178
|
-
Every failure is a `KError` from `@k9o/core`. Check `code`.
|
|
198
|
+
Every failure is a `KError` from `@k9o/core`. Check `code`. The `input` is the one from the previous section.
|
|
179
199
|
|
|
180
200
|
```ts
|
|
181
201
|
import { KError } from "@k9o/core";
|
|
@@ -185,15 +205,17 @@ try {
|
|
|
185
205
|
await encrypt(input);
|
|
186
206
|
} catch (error) {
|
|
187
207
|
if (error instanceof KError && error.code === "KIBO_WASM_ERROR") {
|
|
188
|
-
console.log(error.
|
|
208
|
+
console.log(error.code);
|
|
189
209
|
}
|
|
190
210
|
}
|
|
191
211
|
```
|
|
192
212
|
|
|
193
213
|
```text
|
|
194
|
-
|
|
214
|
+
KIBO_WASM_ERROR
|
|
195
215
|
```
|
|
196
216
|
|
|
217
|
+
The `message` says whether the core is missing or is present but failed to load.
|
|
218
|
+
|
|
197
219
|
See [error codes](#error-codes).
|
|
198
220
|
|
|
199
221
|
## Appendix
|
|
@@ -216,14 +238,14 @@ All are under `client.kibo.vault`.
|
|
|
216
238
|
| Method | What it does |
|
|
217
239
|
|---|---|
|
|
218
240
|
| `secrets.list({ prefix?, cursor?, limit? })` | List secret metadata |
|
|
219
|
-
| `secrets.get(name
|
|
220
|
-
| `secrets.create({ name, value, region
|
|
221
|
-
| `secrets.revealChallenge(name, { region })` | Mint a single-use reveal challenge |
|
|
222
|
-
| `secrets.reveal(name, {
|
|
223
|
-
| `secrets.update(name, {
|
|
224
|
-
| `secrets.rotate(name, { region })` | Re-wrap the secret under a fresh key |
|
|
225
|
-
| `secrets.move(name, {
|
|
226
|
-
| `secrets.delete(name, { region })` | Retire the secret |
|
|
241
|
+
| `secrets.get(name)` | Find one secret by exact name through the list route; returns its metadata |
|
|
242
|
+
| `secrets.create({ name, value, region?, visibility?, metadata? })` | Seal a new secret |
|
|
243
|
+
| `secrets.revealChallenge(name, { region?, reason? })` | Mint a single-use reveal challenge |
|
|
244
|
+
| `secrets.reveal(name, { challenge, region? })` | Return the plaintext value |
|
|
245
|
+
| `secrets.update(name, { value, region?, metadata? })` | Set a new value and bump the version |
|
|
246
|
+
| `secrets.rotate(name, { region? })` | Re-wrap the secret under a fresh key |
|
|
247
|
+
| `secrets.move(name, { newPath, region? })` | Rename the secret's path |
|
|
248
|
+
| `secrets.delete(name, { region? })` | Retire the secret |
|
|
227
249
|
| `zkDeks.store({ envelope, provider, keyVersionRef })` | Store a wrapped data key envelope |
|
|
228
250
|
| `zkDeks.fetch(id)` | Fetch a stored envelope by its handle |
|
|
229
251
|
|
|
@@ -233,7 +255,7 @@ Exported from `@k9o/kibo` directly:
|
|
|
233
255
|
|---|---|
|
|
234
256
|
| `encrypt(input)` | Encrypt bytes with your KMS; returns `{ envelope }` |
|
|
235
257
|
| `decrypt(input)` | Decrypt an envelope; returns `{ plaintext }` |
|
|
236
|
-
| `setZkWasm(core)` | Supply
|
|
258
|
+
| `setZkWasm(core)` | Supply your own Kibo core instead of the shipped one |
|
|
237
259
|
| `createKiboClient(config)` | Build a vault client from a core HTTP config |
|
|
238
260
|
|
|
239
261
|
`visibility` is `{ kind: "private" }` (default) or `{ kind: "shared", principals?, roles? }`.
|
|
@@ -259,7 +281,7 @@ Exported from `@k9o/kibo` directly:
|
|
|
259
281
|
|
|
260
282
|
| Code | When |
|
|
261
283
|
|---|---|
|
|
262
|
-
| `KIBO_WASM_ERROR` | The Kibo core is
|
|
284
|
+
| `KIBO_WASM_ERROR` | The Kibo core is missing, or is present but failed to load; the message says which |
|
|
263
285
|
| `KIBO_WASM_DECODE_ERROR` | The core returned something other than bytes |
|
|
264
286
|
| `K9O_CRYPTO_POSTURE_FLOOR_VIOLATION` | `posture` is below the floor in `posture_policy`; `context` has `dimension`, `requested`, `declared` |
|
|
265
287
|
| `UPSTREAM_KMS_ERROR` | Your own KMS failed the call |
|
|
@@ -271,7 +293,7 @@ Other codes from the core are passed through unchanged.
|
|
|
271
293
|
|
|
272
294
|
| Package | Purpose |
|
|
273
295
|
|---|---|
|
|
274
|
-
| `@k9o/core` | The platform SDK;
|
|
296
|
+
| `@k9o/core` | The platform SDK; exposes the vault as `client.kibo.vault` |
|
|
275
297
|
| `@k9o/kibo-react-native` | Client-side encryption for React Native |
|
|
276
298
|
| `@k9o/cli` | `k9o vault-secret` works with the same secrets |
|
|
277
299
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,18 +4,17 @@ import { StoreZkDekInput, ZkDekHandle, ZkDekRecord, ListSecretsInput, ListSecret
|
|
|
4
4
|
export { AttestationTier, SecretVisibility } from './types.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* `client.kibo.vault.*`
|
|
7
|
+
* `client.kibo.vault.*` - the Kibo vault surface.
|
|
8
8
|
*
|
|
9
|
-
* `vault.zkDeks.{store,fetch}`
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* surface (`kibo.encrypt`/`decrypt`) is provided by the ZK core binding when it is
|
|
14
|
-
* bundled.
|
|
9
|
+
* `vault.zkDeks.{store,fetch}` store and fetch the opaque customer-wrapped DEK envelope, project-scoped. There is
|
|
10
|
+
* no cryptography in this client: it is a plain authenticated REST round-trip carrying an opaque blob (the
|
|
11
|
+
* wrapping happens in the standalone `encrypt`/`decrypt`, which never call the platform).
|
|
12
|
+
* `vault.secrets.*` is the typed secrets family.
|
|
15
13
|
*/
|
|
16
14
|
|
|
15
|
+
/** @internal */
|
|
17
16
|
declare function makeVaultNamespace(config: HttpClientConfig): {
|
|
18
|
-
/**
|
|
17
|
+
/** Opaque store/fetch of a customer-wrapped DEK envelope. */
|
|
19
18
|
zkDeks: {
|
|
20
19
|
/**
|
|
21
20
|
* Store an opaque customer-wrapped DEK envelope.
|
|
@@ -31,78 +30,65 @@ declare function makeVaultNamespace(config: HttpClientConfig): {
|
|
|
31
30
|
fetch(id: string): Promise<Envelope<ZkDekRecord>>;
|
|
32
31
|
};
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* secret (everything except `list`) requires `region` — live-verified against staging, not
|
|
37
|
-
* documented in the route's OpenAPI schema. `list` is the one exception (verified it does NOT
|
|
38
|
-
* need `region`).
|
|
33
|
+
* Typed secrets surface (`/@<projectSlug>/vault/secrets`): list / get / create / revealChallenge / reveal /
|
|
34
|
+
* update / rotate / move / delete.
|
|
39
35
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
36
|
+
* `region`: the gateway sets the residency region of every vault call itself and discards a caller-supplied
|
|
37
|
+
* `region` query parameter, so it is optional on every method. When given, it is still sent (older gateways
|
|
38
|
+
* required it).
|
|
39
|
+
*
|
|
40
|
+
* Response shapes for `update`/`rotate`/`move` are typed to what the gateway returns, not the OpenAPI's
|
|
41
|
+
* `SecretSummary` (see `UpdateSecretResult`/`RotateSecretResult`/`MoveSecretResult` in `types.ts`).
|
|
43
42
|
*/
|
|
44
43
|
secrets: {
|
|
45
|
-
/** List secrets (metadata only
|
|
46
|
-
|
|
47
|
-
list(input?: ListSecretsInput): Promise<Envelope<ListSecretsResult>>;
|
|
44
|
+
/** List secrets (metadata only, never ciphertext). `GET /@<projectSlug>/vault/secrets`. */
|
|
45
|
+
list: (input?: ListSecretsInput) => Promise<Envelope<ListSecretsResult>>;
|
|
48
46
|
/**
|
|
49
|
-
* Read
|
|
50
|
-
* `GET /@<projectSlug>/vault/secrets/<name>?region=<region>`.
|
|
47
|
+
* Read one secret's metadata (never its value; use `revealChallenge` + `reveal` for that).
|
|
51
48
|
*
|
|
52
|
-
*
|
|
53
|
-
* `
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* single secret's metadata until the gateway/kibo side is fixed.
|
|
49
|
+
* Vault answers a `GET /@<projectSlug>/vault/secrets/<name>` only as a reveal: with no
|
|
50
|
+
* `X-K9O-Reveal-Challenge` header it refuses with 401 `K9O_REVEAL_CHALLENGE_REQUIRED`, whatever the caller's
|
|
51
|
+
* rights. There is no plain metadata read on that route, so `get` reads the metadata the route that exists
|
|
52
|
+
* for it returns: it lists by the exact name as prefix and picks the exact match. It throws `K9O_NOT_FOUND`
|
|
53
|
+
* (status 404) when no secret has that name.
|
|
58
54
|
*/
|
|
59
|
-
get(name: string,
|
|
60
|
-
region
|
|
55
|
+
get(name: string, _opts?: {
|
|
56
|
+
region?: string;
|
|
61
57
|
}): Promise<Envelope<SecretSummary>>;
|
|
62
58
|
/**
|
|
63
59
|
* Create a secret under the caller's own auth.
|
|
64
|
-
* `POST /@<projectSlug>/vault/secrets/<name
|
|
65
|
-
*
|
|
66
|
-
* 🔴 `region` is REQUIRED on the query string, live-verified against staging — the vault-forward
|
|
67
|
-
* proxy fail-closes with `K9O_INVALID_FIELD_VALUE` ("this request requires an authoritative
|
|
68
|
-
* region") without it. Distinct from any `region` carried inside `input.value`'s envelope (e.g.
|
|
69
|
-
* the BYOS aws_sigv4 STS-signing region): this one scopes the vault WRITE itself, mirroring the
|
|
70
|
-
* gateway's `gatewayRegion()` residency guard (region-guard.ts) that closed a 2026-08 wrong-region
|
|
71
|
-
* incident for the audit path — the request-shape unit tests never caught this because they don't
|
|
72
|
-
* exercise a real gateway.
|
|
60
|
+
* `POST /@<projectSlug>/vault/secrets/<name>` -> the `sec_<base62>` summary.
|
|
73
61
|
*/
|
|
74
62
|
create(input: CreateSecretInput): Promise<Envelope<SecretSummary>>;
|
|
75
|
-
/** Mint a single-use reveal challenge
|
|
76
|
-
*
|
|
77
|
-
revealChallenge(name: string, opts
|
|
78
|
-
region
|
|
63
|
+
/** Mint a single-use reveal challenge; pass it to the immediately-following `reveal()`.
|
|
64
|
+
* `POST .../<name>?op=reveal-challenge`. The optional `reason` is accepted by the gateway and not forwarded. */
|
|
65
|
+
revealChallenge(name: string, opts?: {
|
|
66
|
+
region?: string;
|
|
67
|
+
reason?: string;
|
|
79
68
|
}): Promise<Envelope<RevealChallenge>>;
|
|
80
69
|
/** Reveal a secret's plaintext value using a single-use challenge from `revealChallenge()`.
|
|
81
|
-
* `GET .../<name
|
|
82
|
-
*
|
|
83
|
-
* with `create`'s encode). */
|
|
70
|
+
* `GET .../<name>` with `X-K9O-Reveal-Challenge`. Decodes the wire's base64 `value` back to plaintext
|
|
71
|
+
* (symmetric with `create`'s encode). */
|
|
84
72
|
reveal(name: string, opts: {
|
|
85
|
-
region
|
|
73
|
+
region?: string;
|
|
86
74
|
challenge: string;
|
|
87
75
|
}): Promise<Envelope<RevealSecretResult>>;
|
|
88
|
-
/** Update a secret's value (bumps version)
|
|
89
|
-
*
|
|
90
|
-
* the OpenAPI schema documents — call `get()` after if you need the rest. */
|
|
76
|
+
/** Update a secret's value (bumps version), owner-only. `PUT .../<name>`.
|
|
77
|
+
* Returns only `{id, name, version}` (see `UpdateSecretResult`); call `get()` after for the rest. */
|
|
91
78
|
update(name: string, input: UpdateSecretInput): Promise<Envelope<UpdateSecretResult>>;
|
|
92
|
-
/** Rotate a secret's wrapping key (re-wraps under a fresh `kid`; content unchanged)
|
|
93
|
-
* `POST .../<name>?op=rotate
|
|
94
|
-
rotate(name: string, opts
|
|
95
|
-
region
|
|
79
|
+
/** Rotate a secret's wrapping key (re-wraps under a fresh `kid`; content unchanged), owner-only.
|
|
80
|
+
* `POST .../<name>?op=rotate`. */
|
|
81
|
+
rotate(name: string, opts?: {
|
|
82
|
+
region?: string;
|
|
96
83
|
}): Promise<Envelope<RotateSecretResult>>;
|
|
97
|
-
/** Move (rename) a secret's hierarchical path
|
|
98
|
-
* `POST .../<name>?op=move®ion=<region>`. */
|
|
84
|
+
/** Move (rename) a secret's hierarchical path, owner-only. `POST .../<name>?op=move`. */
|
|
99
85
|
move(name: string, opts: {
|
|
100
|
-
region
|
|
86
|
+
region?: string;
|
|
101
87
|
newPath: string;
|
|
102
88
|
}): Promise<Envelope<MoveSecretResult>>;
|
|
103
|
-
/** Retire a secret
|
|
104
|
-
delete(name: string, opts
|
|
105
|
-
region
|
|
89
|
+
/** Retire a secret, owner-only. `DELETE .../<name>`. */
|
|
90
|
+
delete(name: string, opts?: {
|
|
91
|
+
region?: string;
|
|
106
92
|
}): Promise<Envelope<void>>;
|
|
107
93
|
};
|
|
108
94
|
};
|
|
@@ -118,7 +104,7 @@ declare function makeVaultNamespace(config: HttpClientConfig): {
|
|
|
118
104
|
|
|
119
105
|
/** Shape of the per-instance client returned by `createKiboClient`. */
|
|
120
106
|
type KiboClient = {
|
|
121
|
-
/** Vault surface
|
|
107
|
+
/** Vault surface: `vault.secrets.*` and `vault.zkDeks.{store,fetch}`. */
|
|
122
108
|
vault: ReturnType<typeof makeVaultNamespace>;
|
|
123
109
|
};
|
|
124
110
|
/** Construct a Kibo client bound to the supplied (core) HTTP config. */
|
|
@@ -126,7 +112,7 @@ declare function createKiboClient(config: HttpClientConfig): KiboClient;
|
|
|
126
112
|
|
|
127
113
|
/**
|
|
128
114
|
* TS contract for the ZK encrypt/decrypt FFI surface — mirrors the Rust
|
|
129
|
-
* `kibo-kms-rest-ffi::types` (the bound core
|
|
115
|
+
* `kibo-kms-rest-ffi::types` (the bound core) field-for-field.
|
|
130
116
|
*
|
|
131
117
|
* These types cross the wasm boundary as plain JS objects (serde-wasm-bindgen),
|
|
132
118
|
* so the field names + enum wire-tokens must match the Rust serde exactly:
|
|
@@ -156,7 +142,7 @@ interface KiboAllowedOracleModes {
|
|
|
156
142
|
brokered: boolean;
|
|
157
143
|
direct: boolean;
|
|
158
144
|
}
|
|
159
|
-
/** Project-declared crypto-posture floor. Omit fields for the
|
|
145
|
+
/** Project-declared crypto-posture floor . Omit fields for the
|
|
160
146
|
* most-permissive default (`platform_managed` floor + both oracle modes). */
|
|
161
147
|
interface KiboPosturePolicy {
|
|
162
148
|
min_custody_posture?: KiboMinPosture;
|
|
@@ -225,7 +211,7 @@ interface KiboDecryptOutput {
|
|
|
225
211
|
|
|
226
212
|
/**
|
|
227
213
|
* ZK encrypt/decrypt — the thin TS wrapper over the bound crypto core
|
|
228
|
-
* (`kibo-kms-rest-ffi
|
|
214
|
+
* (`kibo-kms-rest-ffi`) compiled to wasm. ZERO crypto here: every
|
|
229
215
|
* wrap/unwrap, envelope framing, posture-floor enforcement, and KMS round-trip
|
|
230
216
|
* lives in the audited Rust core. This layer only marshals the typed input
|
|
231
217
|
* across the wasm boundary and maps the core's error string → `KError`.
|
|
@@ -234,9 +220,9 @@ interface KiboDecryptOutput {
|
|
|
234
220
|
* objects via serde-wasm-bindgen, and rejecting with the `ZkFfiError` display
|
|
235
221
|
* string (`"<K9O_CODE>: <message>"`, optionally with a posture-violation tail).
|
|
236
222
|
*
|
|
237
|
-
*
|
|
238
|
-
* `vault.zkDeks.{store,fetch}` surface
|
|
239
|
-
* decoupled (the core never sees the store).
|
|
223
|
+
* These are standalone exports (`import { encrypt, decrypt } from "@k9o/kibo"`), not methods of the client: they run
|
|
224
|
+
* locally against the customer's own KMS and make no platform call. The `vault.zkDeks.{store,fetch}` surface
|
|
225
|
+
* (envelope persistence) is separate and decoupled (the core never sees the store).
|
|
240
226
|
*/
|
|
241
227
|
|
|
242
228
|
/** The minimal surface the bound ZK-core wasm exposes. */
|
|
@@ -252,7 +238,7 @@ interface ZkWasm {
|
|
|
252
238
|
declare function setZkWasm(mod: ZkWasm): void;
|
|
253
239
|
/**
|
|
254
240
|
* Encrypt `input.plaintext` via the customer KMS, client-side. Returns the
|
|
255
|
-
* opaque ZKFE envelope — store it via `vault.zkDeks.store`
|
|
241
|
+
* opaque ZKFE envelope — store it via `vault.zkDeks.store` or keep it
|
|
256
242
|
* yourself; it is meaningless to the platform.
|
|
257
243
|
*/
|
|
258
244
|
declare function encrypt(input: KiboEncryptInput): Promise<KiboEncryptOutput>;
|
|
@@ -263,4 +249,4 @@ declare function encrypt(input: KiboEncryptInput): Promise<KiboEncryptOutput>;
|
|
|
263
249
|
*/
|
|
264
250
|
declare function decrypt(input: KiboDecryptInput): Promise<KiboDecryptOutput>;
|
|
265
251
|
|
|
266
|
-
export { CreateSecretInput, type KiboAllowedOracleModes, type KiboAttestationTier, type KiboClient, type KiboCredential, type KiboDecryptInput, type KiboDecryptOutput, type KiboEncryptInput, type KiboEncryptOutput, type KiboKeyRef, type KiboKvPair, type KiboMinPosture, type KiboOracleMode, type KiboPosture, type KiboPosturePolicy, type KiboProviderConfig, type KiboStrategy, KmsProvider, ListSecretsInput, ListSecretsResult, MoveSecretResult, RevealChallenge, RevealSecretResult, RotateSecretResult, SecretSummary, StoreZkDekInput, UpdateSecretInput, UpdateSecretResult, ZkDekHandle, ZkDekRecord, type ZkWasm, createKiboClient, decrypt, encrypt,
|
|
252
|
+
export { CreateSecretInput, type KiboAllowedOracleModes, type KiboAttestationTier, type KiboClient, type KiboCredential, type KiboDecryptInput, type KiboDecryptOutput, type KiboEncryptInput, type KiboEncryptOutput, type KiboKeyRef, type KiboKvPair, type KiboMinPosture, type KiboOracleMode, type KiboPosture, type KiboPosturePolicy, type KiboProviderConfig, type KiboStrategy, KmsProvider, ListSecretsInput, ListSecretsResult, MoveSecretResult, RevealChallenge, RevealSecretResult, RotateSecretResult, SecretSummary, StoreZkDekInput, UpdateSecretInput, UpdateSecretResult, ZkDekHandle, ZkDekRecord, type ZkWasm, createKiboClient, decrypt, encrypt, setZkWasm };
|