@coffre/vault 0.14.4 → 0.15.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 +6 -4
- package/dist/cloudflare.d.ts +343 -9
- package/dist/cloudflare.js +802 -6
- package/dist/{index-CIq4i_KT.d.ts → index-DQ-FKVF3.d.ts} +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/log-entry-BYWqj3O5.d.ts +364 -0
- package/dist/node.d.ts +182 -7
- package/dist/node.js +358 -16
- package/dist/{src-NM5NsYFs.js → src-DheG92EM.js} +9 -2
- package/dist/vault-kmtojYnW.js +14623 -0
- package/package.json +4 -5
- package/src/bulk.ts +89 -0
- package/src/changes.ts +478 -0
- package/src/checkpointer-node.ts +342 -0
- package/src/checkpointer-workers.ts +514 -0
- package/src/checkpointer.ts +1165 -0
- package/src/cloudflare.ts +207 -13
- package/src/config.ts +15 -3
- package/src/credentials.postgres.ts +78 -0
- package/src/credentials.sqlite.ts +240 -0
- package/src/credentials.ts +630 -0
- package/src/cutover.ts +275 -0
- package/src/decide.ts +437 -2
- package/src/inputs.ts +499 -0
- package/src/local.ts +20 -4
- package/src/log-checkpointer.ts +116 -0
- package/src/log-entry.ts +113 -0
- package/src/log-replay.ts +188 -0
- package/src/log-store.ts +695 -0
- package/src/node.ts +73 -9
- package/src/objects.ts +141 -0
- package/src/reads.ts +502 -0
- package/src/retention.ts +229 -0
- package/src/snapshot.postgres.ts +39 -9
- package/src/snapshot.sqlite.ts +28 -3
- package/src/snapshot.ts +72 -12
- package/src/store.ts +862 -37
- package/src/use.postgres.ts +111 -0
- package/src/use.sqlite.ts +542 -0
- package/src/use.ts +1060 -0
- package/src/vault.ts +1513 -240
- package/src/verifier.ts +136 -0
- package/src/witness-workers.ts +163 -0
- package/dist/vault-BBdXsny3.js +0 -5077
package/README.md
CHANGED
|
@@ -10,16 +10,18 @@ import { postgres, vault } from '@coffre/vault/cloudflare';
|
|
|
10
10
|
|
|
11
11
|
export default vault((env) => ({
|
|
12
12
|
database: postgres(env.VAULT_HYPERDRIVE), // coffre_vault_runtime, caching disabled
|
|
13
|
+
hotDatabase: postgres(env.HOT_HYPERDRIVE), // coffre_vault_hot, for 0.15's uses
|
|
13
14
|
kek: { id: env.VAULT_KEY_ID, key: env.VAULT_KEY }, // or awsKms({ keyArn, credentials }), with a signingKey
|
|
14
15
|
owners: env.OWNERS.split(','), // Owners of the whole instance, whom nobody demotes while named
|
|
15
16
|
}));
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
On Node, `serveVault({ socket, database, … })` from
|
|
19
|
-
with the vault's Postgres
|
|
20
|
-
and
|
|
19
|
+
On Node, `serveVault({ socket, database, hotDatabase, … })` from
|
|
20
|
+
`@coffre/vault/node`, with the vault's Postgres URLs. Only the vault's
|
|
21
|
+
logins, `coffre_vault_runtime` and its hot path's, `coffre_vault_hot`, may
|
|
22
|
+
write members and grants; the app uses `coffre_runtime`. See the
|
|
21
23
|
[deploy guide](https://github.com/erwinkn/coffre/blob/main/docs/deploy.md)
|
|
22
|
-
for the logins and
|
|
24
|
+
for the logins and the Hyperdrive configs.
|
|
23
25
|
|
|
24
26
|
Part of [coffre](https://github.com/erwinkn/coffre), a secrets manager you
|
|
25
27
|
deploy as a small project of your own. Its eight `@coffre/*` packages are
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,12 +1,273 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as SealThrough, n as Alarm, o as Tick, r as Checkpointer, s as Witness, t as LogMacKey } from "./log-entry-BYWqj3O5.js";
|
|
2
|
+
import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-DQ-FKVF3.js";
|
|
3
|
+
import { AdmitInput, ChangeBindingsInput, ChangePolicyInput, CutoverInput, EndReferencesInput, IssueTokenInput, NamedUseInput, PrepareInput, ReferenceInput, RemoveInput, RevokeCredentialInput, RewrapInput, Sealing, SetAccessInput, SetSettingsInput, SignInInput, UnwrapInput, UseInput, UseManyInput, Vault, VerifyLogInput, VouchInput, WrapInput } from "@coffre/core/vault";
|
|
4
|
+
import { HyperdrivePool, PostgresDatabase, PostgresDatabase as PostgresDatabase$1, postgres } from "@coffre/db/hyperdrive";
|
|
4
5
|
import { WorkerEntrypoint } from "cloudflare:workers";
|
|
6
|
+
import { LogEntry, LogReader, PairNotes, PairVerifiers, TreeName } from "@coffre/core/merkle";
|
|
5
7
|
export * from "@coffre/core/vault";
|
|
8
|
+
//#region src/reads.d.ts
|
|
9
|
+
/** A use as the pages list it (`log_reads`), every id lower-case. */
|
|
10
|
+
type ReadRow = {
|
|
11
|
+
number: bigint;
|
|
12
|
+
at: number;
|
|
13
|
+
credential: string;
|
|
14
|
+
/** The use's code: its purpose, keepsSensitive and way in (`USE_PURPOSES`). */
|
|
15
|
+
purpose: number;
|
|
16
|
+
principal: string;
|
|
17
|
+
/** The key the use named, where it is held: a reference's holder. */
|
|
18
|
+
secret: string;
|
|
19
|
+
environment: string;
|
|
20
|
+
project: string;
|
|
21
|
+
/** The fork it was read in. */
|
|
22
|
+
place: string | null;
|
|
23
|
+
/** Through a reference: its source then, and where that is. */
|
|
24
|
+
source: string | null;
|
|
25
|
+
sourceEnvironment: string | null;
|
|
26
|
+
sourceProject: string | null;
|
|
27
|
+
/** The version read: its key's, or its source's; null where its object names none. */
|
|
28
|
+
version: string | null;
|
|
29
|
+
mac: Buffer;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* How far the projector has gone: every use at or below `through` is
|
|
33
|
+
* projected; `pair`, the signed pair at or below it; `at`, the signed time
|
|
34
|
+
* of the newest pair whose uses are all projected, which the pages say they
|
|
35
|
+
* list reads through when it is behind.
|
|
36
|
+
*/
|
|
37
|
+
type ReadsCursor = {
|
|
38
|
+
through: bigint;
|
|
39
|
+
pair: bigint;
|
|
40
|
+
at: number;
|
|
41
|
+
mac: Buffer | null;
|
|
42
|
+
};
|
|
43
|
+
/** A way in's or key's object as the log holds it, for a projection: a change of it, whole, for its MAC; null for none. */
|
|
44
|
+
type Sealed = LogEntry | null;
|
|
45
|
+
/** What the projector needs of the database (log-store.ts, on both engines). */
|
|
46
|
+
type ReadsStore = Pick<LogReader, 'tiles'> & {
|
|
47
|
+
readsCursor(): Promise<ReadsCursor>;
|
|
48
|
+
/** The newest retention change and its leaf index in the changes tree (plan PR 7), for `sealedCut`. */
|
|
49
|
+
retention(): Promise<{
|
|
50
|
+
entry: LogEntry;
|
|
51
|
+
index: number;
|
|
52
|
+
} | null>;
|
|
53
|
+
pair(upto: bigint): Promise<{
|
|
54
|
+
upto: bigint;
|
|
55
|
+
notes: {
|
|
56
|
+
changes: string;
|
|
57
|
+
uses: string;
|
|
58
|
+
};
|
|
59
|
+
} | null>;
|
|
60
|
+
pairs(after: bigint, limit: number): Promise<{
|
|
61
|
+
upto: bigint;
|
|
62
|
+
notes: {
|
|
63
|
+
changes: string;
|
|
64
|
+
uses: string;
|
|
65
|
+
};
|
|
66
|
+
}[]>;
|
|
67
|
+
newest(): Promise<{
|
|
68
|
+
upto: bigint;
|
|
69
|
+
notes: {
|
|
70
|
+
changes: string;
|
|
71
|
+
uses: string;
|
|
72
|
+
};
|
|
73
|
+
} | null>;
|
|
74
|
+
entries(after: bigint, upto: bigint, options?: {
|
|
75
|
+
floor?: number;
|
|
76
|
+
limit?: number;
|
|
77
|
+
}): Promise<LogEntry[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Each object asked, in order: its first change (`first`), or its newest
|
|
80
|
+
* numbered below `below`; null for none.
|
|
81
|
+
*/
|
|
82
|
+
objects(asked: readonly {
|
|
83
|
+
object: string;
|
|
84
|
+
below: bigint;
|
|
85
|
+
first: boolean;
|
|
86
|
+
}[]): Promise<Sealed[]>;
|
|
87
|
+
/**
|
|
88
|
+
* The reads, each once by its number, their days made (`make_reads_day` on Postgres: a log older than the days made
|
|
89
|
+
* ahead holds uses of others), and the cursor on to `cursor`, never back: one write, and only while the cursor still
|
|
90
|
+
* stands at `from`, where the chunk started (FromChecked): whether it wrote. A projector another overtook writes
|
|
91
|
+
* nothing, so never the reads of a day retention has since dropped (review r11).
|
|
92
|
+
*/
|
|
93
|
+
writeReads(reads: readonly ReadRow[], from: bigint, cursor: ReadsCursor): Promise<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* What the listing holds of a stretch (`checkReads`): its reads numbered in `(after, upto]` at times in `[from, to]`,
|
|
96
|
+
* each with whether its member's day of it is in `log_read_days` (`dayed`), which their pages read.
|
|
97
|
+
*/
|
|
98
|
+
listing(stretch: {
|
|
99
|
+
after: bigint;
|
|
100
|
+
upto: bigint;
|
|
101
|
+
from: number;
|
|
102
|
+
to: number;
|
|
103
|
+
}): Promise<(ReadRow & {
|
|
104
|
+
dayed: boolean;
|
|
105
|
+
})[]>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The projector as a host runs it, apart from its checkpointer: on Node,
|
|
109
|
+
* `kick` after each tick starts a run unless one is going, and returns at
|
|
110
|
+
* once (checkpointer-node.ts); on Workers, an object of its own runs it on
|
|
111
|
+
* its own alarm (checkpointer-workers.ts). Either way no tick, seal, change
|
|
112
|
+
* or use ever waits on it (formal/Reads.tla, SealNeverWaitsOnProjection).
|
|
113
|
+
* Each run goes some steps over the host's store. A failure is an alarm, said once while it stands; the pages show the
|
|
114
|
+
* lag meanwhile.
|
|
115
|
+
*/
|
|
116
|
+
declare class Projector {
|
|
117
|
+
#private;
|
|
118
|
+
constructor(store: ReadsStore, keys: {
|
|
119
|
+
verifiers: PairVerifiers;
|
|
120
|
+
mac: LogMacKey;
|
|
121
|
+
}, alert: (message: string) => void);
|
|
122
|
+
/** Start a run unless one is going or the projector is stopped; never waits on it. */
|
|
123
|
+
kick(): void;
|
|
124
|
+
/** A run, or the one going: whether it left sealed uses to project. Never throws. */
|
|
125
|
+
run(): Promise<boolean>;
|
|
126
|
+
/** The run going, if any, ended: for a host that stops, and for tests. */
|
|
127
|
+
settled(): Promise<void>;
|
|
128
|
+
/** No run after this one: a host's stop. */
|
|
129
|
+
stop(): Promise<void>;
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/checkpointer-workers.d.ts
|
|
133
|
+
/** The part of a Durable Object's state the checkpointer uses. */
|
|
134
|
+
type ObjectState = {
|
|
135
|
+
storage: {
|
|
136
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
137
|
+
put<T>(key: string, value: T): Promise<void>;
|
|
138
|
+
sync(): Promise<void>;
|
|
139
|
+
delete(keys: string[]): Promise<number>;
|
|
140
|
+
list<T>(options: {
|
|
141
|
+
prefix: string;
|
|
142
|
+
start?: string;
|
|
143
|
+
end?: string;
|
|
144
|
+
limit?: number;
|
|
145
|
+
}): Promise<Map<string, T>>;
|
|
146
|
+
getAlarm(): Promise<number | null>;
|
|
147
|
+
setAlarm(scheduledTime: number): Promise<void>;
|
|
148
|
+
};
|
|
149
|
+
blockConcurrencyWhile<T>(work: () => Promise<T>): Promise<T>;
|
|
150
|
+
};
|
|
151
|
+
/** A Durable Object binding: `env.CHECKPOINTER`, `env.WITNESS`. */
|
|
152
|
+
type ObjectNamespace = {
|
|
153
|
+
idFromName(name: string): unknown;
|
|
154
|
+
get(id: unknown): {
|
|
155
|
+
fetch(request: Request): Promise<Response>;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* The change path's seam on Workers (plan PR 4): seal through the checkpointer's object. Its 503, or no answer in
|
|
160
|
+
* time, is `Unsealed` (T169): the change is committed and in force, and the app says 503, try again.
|
|
161
|
+
*/
|
|
162
|
+
export declare function durableSealThrough(namespace: ObjectNamespace, name?: string): SealThrough;
|
|
163
|
+
/** Starts the object's ticks, once; again is harmless. Throws when it cannot open, its alarm set all the same. */
|
|
164
|
+
export declare function startCheckpointer(namespace: ObjectNamespace, name?: string): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Starts the reads' projector (reads.ts, T166): the object of the same class named `name`, which projects from then
|
|
167
|
+
* on, on its own alarm. Again is harmless.
|
|
168
|
+
*/
|
|
169
|
+
export declare function startProjector(namespace: ObjectNamespace, name?: string): Promise<void>;
|
|
170
|
+
/** The object's head and its last ticks, each with its barrier, write and wall time. */
|
|
171
|
+
export declare function checkpointerStatus(namespace: ObjectNamespace, name?: string): Promise<{
|
|
172
|
+
open: boolean;
|
|
173
|
+
failed: string | null;
|
|
174
|
+
sealing: Sealing;
|
|
175
|
+
upto: string | null;
|
|
176
|
+
sizes: Record<'changes' | 'uses', number> | null;
|
|
177
|
+
ticks: (Omit<Tick, 'upto'> & {
|
|
178
|
+
upto: string;
|
|
179
|
+
wallMs: number;
|
|
180
|
+
at: number;
|
|
181
|
+
})[];
|
|
182
|
+
}>;
|
|
183
|
+
/** Whether the object seals (`Vault.sealing`, T169): its own view, or, if it does not answer within 2 s, that it does not. */
|
|
184
|
+
export declare function durableSealing(namespace: ObjectNamespace, name?: string): () => Promise<Sealing>;
|
|
185
|
+
/**
|
|
186
|
+
* The pair the signer remembers, where no database writer reaches: what the
|
|
187
|
+
* vault's verifier holds its walks to (`VaultOptions.heldOutside`).
|
|
188
|
+
*/
|
|
189
|
+
export declare function durableHeldOutside(namespace: ObjectNamespace, name?: string): () => Promise<PairNotes[]>;
|
|
190
|
+
/** The alarms the object kept since `since` (ms). */
|
|
191
|
+
export declare function checkpointerAlarms(namespace: ObjectNamespace, since?: number, name?: string): Promise<Alarm[]>;
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/witness-workers.d.ts
|
|
194
|
+
type WitnessSettings = {
|
|
195
|
+
/** The witness's own name, its cosignatures' key name: `witness.acme.example`, say. */
|
|
196
|
+
name: string;
|
|
197
|
+
/** Its own Ed25519 seed, 32 bytes, base64. */
|
|
198
|
+
key: string;
|
|
199
|
+
/** The log's two verifier keys, as the vault's checkpointer signs them. */
|
|
200
|
+
log: Record<TreeName, string>;
|
|
201
|
+
};
|
|
202
|
+
type Publication = {
|
|
203
|
+
notes: PairNotes;
|
|
204
|
+
from: Record<TreeName, number>;
|
|
205
|
+
proofs: Record<TreeName, string[]>;
|
|
206
|
+
};
|
|
207
|
+
/** The witness's Durable Object class. A new name for it is a new witness, which takes the next pair it is sent as given. */
|
|
208
|
+
declare function witnessObject<Env>(settings: (env: Env) => WitnessSettings | Promise<WitnessSettings>): {
|
|
209
|
+
new (state: ObjectState, env: Env): {
|
|
210
|
+
readonly "__#private@#state": ObjectState;
|
|
211
|
+
readonly "__#private@#env": Env;
|
|
212
|
+
fetch(request: Request): Promise<Response>;
|
|
213
|
+
/** Every failure answered from inside the gate, never thrown out of it, which would reset the object. */
|
|
214
|
+
"__#private@#answer"(p: Publication | null): Promise<Response>;
|
|
215
|
+
"__#private@#answerOr"(p: Publication | null): Promise<Response>;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/** The witness's object as the checkpointer's `Witness`: the pair and each tree's proof from the sizes the object holds. */
|
|
219
|
+
export declare function durableWitness(namespace: ObjectNamespace, options?: {
|
|
220
|
+
name?: string;
|
|
221
|
+
}): Witness;
|
|
222
|
+
/** The part of an R2 bucket binding the archive uses. */
|
|
223
|
+
type ArchiveBucket = {
|
|
224
|
+
put(key: string, value: string, options?: {
|
|
225
|
+
onlyIf?: {
|
|
226
|
+
etagDoesNotMatch?: string;
|
|
227
|
+
};
|
|
228
|
+
}): Promise<unknown | null>;
|
|
229
|
+
get(key: string): Promise<{
|
|
230
|
+
text(): Promise<string>;
|
|
231
|
+
} | null>;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Each pair it is sent, kept in an R2 bucket under `<prefix><upto, 20 digits>.json`.
|
|
235
|
+
* A place already archived with the same pair is fine (a pair sent again);
|
|
236
|
+
* one archived with another is refused, and said.
|
|
237
|
+
*/
|
|
238
|
+
export declare function r2Archive(bucket: ArchiveBucket, options?: {
|
|
239
|
+
prefix?: string;
|
|
240
|
+
}): Witness;
|
|
241
|
+
//#endregion
|
|
6
242
|
//#region src/cloudflare.d.ts
|
|
7
|
-
/**
|
|
243
|
+
/**
|
|
244
|
+
* What the vault Worker's `vault(env => …)` returns, for 0.15's log
|
|
245
|
+
* (docs/design/0.15-plan.md):
|
|
246
|
+
* - `hotDatabase`: the uses' own Hyperdrive config, whose login is
|
|
247
|
+
* `coffre_vault_hot`, and `uses`, how many uses an isolate has in flight
|
|
248
|
+
* at most (by default `connections`, the share of that config's pool an
|
|
249
|
+
* isolate may hold: T112 measures it), and `uses.batch`, the most keys
|
|
250
|
+
* a statement of a request's several makes uses of (100:
|
|
251
|
+
* `UseLimits.batch`);
|
|
252
|
+
* - `checkpointer`: the namespace of the checkpointer's Durable Object,
|
|
253
|
+
* `CoffreCheckpointer` (`checkpointer()`, below), bound beside the vault.
|
|
254
|
+
* A change answers once that object has sealed it (R51), and the
|
|
255
|
+
* verifier holds every check to the pair it remembers;
|
|
256
|
+
* - `witnesses` (docs/design/audit-tree.md, R40: a deployment opts in).
|
|
257
|
+
* A configuration without the first two is refused, at the first call.
|
|
258
|
+
*/
|
|
8
259
|
export type WorkersVaultConfig = VaultConfig & {
|
|
9
260
|
database: PostgresDatabase$1;
|
|
261
|
+
hotDatabase: PostgresDatabase$1;
|
|
262
|
+
checkpointer: ObjectNamespace;
|
|
263
|
+
witnesses?: readonly Witness[];
|
|
264
|
+
uses?: {
|
|
265
|
+
inFlight?: number;
|
|
266
|
+
connections?: number;
|
|
267
|
+
coverMs?: number;
|
|
268
|
+
names?: number;
|
|
269
|
+
batch?: number;
|
|
270
|
+
};
|
|
10
271
|
};
|
|
11
272
|
/**
|
|
12
273
|
* What the app's `VAULT` service binding calls. Each call gets a database of
|
|
@@ -16,10 +277,17 @@ export type WorkersVaultConfig = VaultConfig & {
|
|
|
16
277
|
*/
|
|
17
278
|
export declare class VaultEntrypoint extends WorkerEntrypoint implements Vault {
|
|
18
279
|
#private;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
280
|
+
/**
|
|
281
|
+
* 0.15's use: one connection of the hot path's config, for its one statement. Closed once the call is done, and by
|
|
282
|
+
* its deadline at the latest, so that a call answered `late` lets go of Hyperdrive by then, as its place in admission
|
|
283
|
+
* lapses soon after (use.ts, `HELD_PAST_DEADLINE_MS`; T170).
|
|
284
|
+
*/
|
|
285
|
+
use(input: UseInput): Promise<import("@coffre/core/vault").UseOutcome>;
|
|
286
|
+
/** A request's several keys (T167): the same one connection, for its one statement, or two. */
|
|
287
|
+
useMany(input: UseManyInput): Promise<import("@coffre/core/vault").UseManyOutcome>;
|
|
288
|
+
/** 0.15's use as the request names it: the same one connection, for its read of ids on a miss and its one use. */
|
|
289
|
+
useNamed(input: NamedUseInput): Promise<import("@coffre/core/vault").NamedUseOutcome>;
|
|
290
|
+
unwrap(input: UnwrapInput): Promise<import("@coffre/core/vault").Outcome<import("@coffre/core/vault").Unwrapped>>;
|
|
23
291
|
wrap(input: WrapInput): Promise<import("@coffre/core/vault").Outcome<import("@coffre/core/vault").Wrapped>>;
|
|
24
292
|
rewrap(input: RewrapInput): Promise<import("@coffre/core/vault").Outcome<import("@coffre/core/vault").Wrapped>>;
|
|
25
293
|
reference(input: ReferenceInput): Promise<import("@coffre/core/vault").Outcome<{
|
|
@@ -51,17 +319,83 @@ export declare class VaultEntrypoint extends WorkerEntrypoint implements Vault {
|
|
|
51
319
|
checkpoint: import("@coffre/core/vault").Checkpoint;
|
|
52
320
|
warning?: string;
|
|
53
321
|
}>>;
|
|
322
|
+
/** What the vault says of itself; its uses over the hot path's own config (`use`), which `#call`'s vault has not. */
|
|
54
323
|
about(): Promise<{
|
|
55
324
|
checkpointKeys: Record<string, import("@coffre/core/vault").CheckpointKey>;
|
|
56
325
|
owners?: string[];
|
|
57
326
|
rootAdmins: [];
|
|
327
|
+
log?: "0.15";
|
|
328
|
+
uses?: true;
|
|
329
|
+
batchUses?: true;
|
|
330
|
+
sealing?: true;
|
|
331
|
+
credentials?: true;
|
|
332
|
+
issues?: true;
|
|
333
|
+
binds?: true;
|
|
58
334
|
}>;
|
|
59
335
|
keyChecks(): Promise<import("@coffre/core/vault").KeyChecks>;
|
|
60
336
|
verifyLog(input: VerifyLogInput): Promise<import("@coffre/core/vault").LogVerification>;
|
|
337
|
+
prepare(input: PrepareInput): Promise<import("@coffre/core/vault").Outcome<import("@coffre/core/vault").Prepared>>;
|
|
338
|
+
waitSealed(input: {
|
|
339
|
+
number: string;
|
|
340
|
+
}): Promise<import("@coffre/core/vault").Outcome<{
|
|
341
|
+
witnessed: boolean | null;
|
|
342
|
+
}>>;
|
|
343
|
+
signIn(input: SignInInput): Promise<import("@coffre/core/vault").SignInOutcome>;
|
|
344
|
+
revokeCredential(input: RevokeCredentialInput): Promise<import("@coffre/core/vault").RevokeCredentialOutcome>;
|
|
345
|
+
issueToken(input: IssueTokenInput): Promise<import("@coffre/core/vault").IssueTokenOutcome>;
|
|
346
|
+
changeBindings(input: ChangeBindingsInput): Promise<import("@coffre/core/vault").ChangeBindingsOutcome>;
|
|
347
|
+
cutover(input?: CutoverInput): Promise<import("@coffre/core/vault").CutoverOutcome>;
|
|
348
|
+
verifyTrees(): Promise<import("@coffre/core/vault").TreeVerification>;
|
|
349
|
+
verifyReads(input: {
|
|
350
|
+
from: string;
|
|
351
|
+
}): Promise<import("@coffre/core/vault").ReadsVerification>;
|
|
352
|
+
vouch(input: VouchInput): Promise<{
|
|
353
|
+
forged: string[];
|
|
354
|
+
}>;
|
|
355
|
+
/** Whether the checkpointer seals (T169), asked of its object for at most 2 s; no database, and no start awaited. */
|
|
356
|
+
sealing(): Promise<import("@coffre/core/vault").Sealing>;
|
|
61
357
|
/** No HTTP surface: only the app's service binding reaches the vault. */
|
|
62
358
|
fetch(): Response;
|
|
63
359
|
}
|
|
64
360
|
/** The vault Worker's default export, `VaultEntrypoint`, configured from its `env`. */
|
|
65
361
|
export declare function vault<Env>(configure_: (env: Env) => WorkersVaultConfig): typeof VaultEntrypoint;
|
|
362
|
+
/**
|
|
363
|
+
* 0.15's checkpointer, the Durable Object class a deployment binds beside
|
|
364
|
+
* the vault, configured by the same `vault(env => …)`: its Hyperdrive, its
|
|
365
|
+
* signing key, its witnesses. `export const CoffreCheckpointer = checkpointer()`.
|
|
366
|
+
*/
|
|
367
|
+
export declare function checkpointer(): {
|
|
368
|
+
new (state: ObjectState, env: object): {
|
|
369
|
+
readonly "__#private@#state": ObjectState;
|
|
370
|
+
readonly "__#private@#env": object;
|
|
371
|
+
"__#private@#checkpointer": Checkpointer | null;
|
|
372
|
+
"__#private@#pool": HyperdrivePool | null;
|
|
373
|
+
"__#private@#upkeep": (() => Promise<void>) | null;
|
|
374
|
+
"__#private@#projects": boolean | null;
|
|
375
|
+
"__#private@#projector": Projector | null;
|
|
376
|
+
"__#private@#daysFor": string | null;
|
|
377
|
+
"__#private@#daysTried": number;
|
|
378
|
+
"__#private@#daysFailed": string | null;
|
|
379
|
+
"__#private@#upkeeping": boolean;
|
|
380
|
+
"__#private@#lastSeen"(): {
|
|
381
|
+
at: number;
|
|
382
|
+
failures: readonly string[];
|
|
383
|
+
} | null;
|
|
384
|
+
readonly "__#private@#ticks": (Tick & {
|
|
385
|
+
wallMs: number;
|
|
386
|
+
at: number;
|
|
387
|
+
})[];
|
|
388
|
+
"__#private@#open"(): Promise<Checkpointer | null>;
|
|
389
|
+
"__#private@#failed": string | null;
|
|
390
|
+
"__#private@#failure"(message: string): Promise<void>;
|
|
391
|
+
"__#private@#reset"(): Promise<void>;
|
|
392
|
+
"__#private@#record"(alarm: Alarm): Promise<void>;
|
|
393
|
+
"__#private@#makeDays"(): Promise<void>;
|
|
394
|
+
"__#private@#project"(): Promise<void>;
|
|
395
|
+
"__#private@#isProjector"(): Promise<boolean>;
|
|
396
|
+
alarm(): Promise<void>;
|
|
397
|
+
fetch(request: Request): Promise<Response>;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
66
400
|
//#endregion
|
|
67
|
-
export { type AwsCredentials, type AwsKmsOptions, type Kek, KekBadClaimError, type KekProvider, KekUnavailableError, type PostgresDatabase, type SecretContext, type Vault, type VaultConfig, type WrappedDek, awsKms, checkpointMessage, derivedSigningKey, postgres, verifyCheckpoint };
|
|
401
|
+
export { type AwsCredentials, type AwsKmsOptions, type Kek, KekBadClaimError, type KekProvider, KekUnavailableError, type ObjectNamespace, type PostgresDatabase, type SecretContext, type Vault, type VaultConfig, type WitnessSettings, type WrappedDek, awsKms, checkpointMessage, derivedSigningKey, postgres, verifyCheckpoint, witnessObject as witness };
|