@kumiai/mls 0.12.4 → 0.13.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/lib/anchor.d.ts +6 -2
- package/lib/anchor.js +1 -1
- package/lib/authentication.d.ts +8 -3
- package/lib/authentication.js +139 -46
- package/lib/capability.js +16 -7
- package/lib/controller-ingest.d.ts +14 -2
- package/lib/controller-ingest.js +15 -8
- package/lib/controller-log.d.ts +12 -6
- package/lib/controller-log.js +29 -15
- package/lib/device-proof.d.ts +2 -1
- package/lib/device-proof.js +2 -1
- package/lib/embedded-resolver.d.ts +7 -2
- package/lib/embedded-resolver.js +16 -6
- package/lib/envelope-fold.d.ts +3 -2
- package/lib/envelope-fold.js +14 -6
- package/lib/fold.d.ts +17 -3
- package/lib/fold.js +9 -3
- package/lib/group-commit.d.ts +11 -2
- package/lib/group-commit.js +76 -32
- package/lib/group-context.d.ts +3 -2
- package/lib/group-context.js +6 -2
- package/lib/group-create.d.ts +5 -1
- package/lib/group-create.js +36 -14
- package/lib/group-credential.d.ts +13 -3
- package/lib/group-credential.js +17 -6
- package/lib/group-device.d.ts +32 -22
- package/lib/group-device.js +66 -51
- package/lib/group-handle.d.ts +84 -30
- package/lib/group-handle.js +368 -154
- package/lib/group-lifecycle.d.ts +44 -11
- package/lib/group-lifecycle.js +193 -85
- package/lib/group-membership.d.ts +6 -1
- package/lib/group-membership.js +2 -2
- package/lib/group-welcome.d.ts +5 -1
- package/lib/group-welcome.js +34 -10
- package/lib/head.d.ts +25 -5
- package/lib/head.js +17 -8
- package/lib/history.d.ts +14 -3
- package/lib/history.js +8 -5
- package/lib/index.d.ts +27 -1
- package/lib/key-package-codec.d.ts +4 -1
- package/lib/key-package-codec.js +1 -1
- package/lib/ledger.d.ts +14 -6
- package/lib/ledger.js +56 -19
- package/lib/lifecycle-proof.d.ts +5 -4
- package/lib/lifecycle-proof.js +111 -51
- package/lib/lifecycle.d.ts +18 -9
- package/lib/lifecycle.js +184 -81
- package/lib/member-root.d.ts +54 -15
- package/lib/member-root.js +115 -53
- package/lib/policy.d.ts +5 -1
- package/lib/policy.js +1 -1
- package/lib/recovery-verdict.d.ts +12 -3
- package/lib/recovery-verdict.js +56 -22
- package/lib/recovery.d.ts +20 -5
- package/lib/recovery.js +117 -46
- package/lib/registry.d.ts +46 -10
- package/lib/registry.js +64 -38
- package/lib/roster.d.ts +7 -1
- package/lib/roster.js +18 -7
- package/lib/secret-tree.d.ts +5 -1
- package/lib/secret-tree.js +1 -1
- package/lib/types.d.ts +3 -0
- package/package.json +9 -5
package/lib/lifecycle-proof.js
CHANGED
|
@@ -14,9 +14,14 @@ import { attestedTreeTime, isLapsed, leafAt } from './lifecycle.js';
|
|
|
14
14
|
import { cascadeOf, effectiveAttestingMembers, effectProofContext, memberRootStatus } from './member-root.js';
|
|
15
15
|
import { denySetOf, registryApply } from './registry.js';
|
|
16
16
|
export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
17
|
-
/** Keep controller merge limits inside the lifecycle proof error boundary. */ export function mergeLifecycleProofLogs(controller, first, second) {
|
|
17
|
+
/** Keep controller merge limits inside the lifecycle proof error boundary. */ export async function mergeLifecycleProofLogs(controller, first, second, options) {
|
|
18
18
|
try {
|
|
19
|
-
return mergeLogs(
|
|
19
|
+
return await mergeLogs({
|
|
20
|
+
...options,
|
|
21
|
+
did: controller,
|
|
22
|
+
left: first,
|
|
23
|
+
right: second
|
|
24
|
+
});
|
|
20
25
|
} catch (cause) {
|
|
21
26
|
if (!(cause instanceof Error) || !cause.message.startsWith(LOG_TOO_LARGE)) throw cause;
|
|
22
27
|
const error = new RevokeProofError('too-large');
|
|
@@ -24,13 +29,13 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
24
29
|
throw error;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
|
-
/** Reattach historical closures without reviving unapplied current-epoch events. */ export function lifecycleProofLog(controller, ingested, proof) {
|
|
28
|
-
return mergeLifecycleProofLogs(controller, ingested.log, {
|
|
32
|
+
/** Reattach historical closures without reviving unapplied current-epoch events. */ export async function lifecycleProofLog(controller, ingested, proof, options) {
|
|
33
|
+
return await mergeLifecycleProofLogs(controller, ingested.log, {
|
|
29
34
|
chain: ingested.log.chain,
|
|
30
35
|
events: proof.events.filter(({ event })=>event.e !== ingested.after.head.epoch)
|
|
31
|
-
});
|
|
36
|
+
}, options);
|
|
32
37
|
}
|
|
33
|
-
/** Authenticate replayable log data without reading any membership state. */ export function authenticateLifecycleProof(controllerID, verified, registry) {
|
|
38
|
+
/** Authenticate replayable log data without reading any membership state. */ export async function authenticateLifecycleProof(controllerID, verified, registry, options) {
|
|
34
39
|
const controller = normalizeDID(controllerID);
|
|
35
40
|
const subject = normalizeDID(verified.entry.subject);
|
|
36
41
|
const value = verified.entry.value;
|
|
@@ -41,10 +46,19 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
41
46
|
if (value.op === 'log' || value.op === 'seed') {
|
|
42
47
|
if (!isControllerLog(proof)) throw new RevokeProofError('not-authority-signed');
|
|
43
48
|
if (value.op === 'seed' ? previous?.recordedLog != null : previous?.recordedLog == null) throw new RevokeProofError('detached');
|
|
44
|
-
const ingested = ingestControllerLog(
|
|
49
|
+
const ingested = await ingestControllerLog({
|
|
50
|
+
controller,
|
|
51
|
+
recorded: previous?.recordedLog,
|
|
52
|
+
proof,
|
|
53
|
+
previous,
|
|
54
|
+
...options
|
|
55
|
+
});
|
|
45
56
|
if (value.op === 'log') {
|
|
46
57
|
if (ingested.introduced.length === 0 && ingested.before?.states.at(-1)?.digest === ingested.after.states.at(-1)?.digest) throw new RevokeProofError('effects-mismatch');
|
|
47
|
-
const delta = effectDelta(
|
|
58
|
+
const delta = effectDelta({
|
|
59
|
+
before: ingested.before?.head,
|
|
60
|
+
after: ingested.after.head
|
|
61
|
+
});
|
|
48
62
|
if (delta.generation) throw new RevokeProofError('needs-reset');
|
|
49
63
|
if (delta.denied.length > 0 || delta.removed.length > 0) throw new RevokeProofError('effects-mismatch');
|
|
50
64
|
}
|
|
@@ -57,15 +71,24 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
57
71
|
if (proof.chain.length > 0 && proof.chain.every(({ event })=>event.g < floor)) throw new RevokeProofError('generation-floor');
|
|
58
72
|
if (value.op === 'reset' && proof.chain[0]?.event.t === 'icp' && proof.chain.every(({ event })=>event.g <= floor)) throw new RevokeProofError('generation-floor');
|
|
59
73
|
if (value.op === 'revoke' && proof.chain.some(({ event })=>event.g > (previous?.genFloor ?? 0))) throw new RevokeProofError('needs-reset');
|
|
60
|
-
const ingested = ingestControllerLog(
|
|
74
|
+
const ingested = await ingestControllerLog({
|
|
75
|
+
controller,
|
|
76
|
+
recorded: previous?.recordedLog,
|
|
77
|
+
proof,
|
|
78
|
+
previous,
|
|
79
|
+
...options
|
|
80
|
+
});
|
|
61
81
|
if (ingested.after.head.saturated) throw new RevokeProofError('too-large');
|
|
62
|
-
const delta = effectDelta(
|
|
82
|
+
const delta = effectDelta({
|
|
83
|
+
before: ingested.before?.head,
|
|
84
|
+
after: ingested.after.head
|
|
85
|
+
});
|
|
63
86
|
if (value.op === 'reset') {
|
|
64
87
|
if (!delta.generation || ingested.after.head.gen <= floor) throw new RevokeProofError('generation-floor');
|
|
65
88
|
} else if (delta.generation) throw new RevokeProofError('needs-reset');
|
|
66
|
-
const proofLog = lifecycleProofLog(controller, ingested, proof);
|
|
67
|
-
const context = effectProofContext(controller, proofLog);
|
|
68
|
-
const expected = context.claimsFor(previous?.recordedLog, floor);
|
|
89
|
+
const proofLog = await lifecycleProofLog(controller, ingested, proof, options);
|
|
90
|
+
const context = await effectProofContext(controller, proofLog, options);
|
|
91
|
+
const expected = await context.claimsFor(previous?.recordedLog, floor);
|
|
69
92
|
if (value.effects == null || value.effects.length === 0 && value.op !== 'reset') throw new RevokeProofError('no-rev');
|
|
70
93
|
const target = (claim)=>claim.kind === 'deny' ? `deny:${normalizeDID(claim.did)}` : `remove:${normalizeDID(claim.member.did)}:${claim.member.add}`;
|
|
71
94
|
if (value.effects.length !== expected.length || expected.some((claim, index)=>{
|
|
@@ -74,7 +97,7 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
74
97
|
})) throw new RevokeProofError('effects-mismatch');
|
|
75
98
|
for (const claim of value.effects){
|
|
76
99
|
if (value.op !== 'reset' && 'snapshot' in claim.ref) throw new RevokeProofError('no-rev');
|
|
77
|
-
context.effectOf(claim, floor);
|
|
100
|
+
await context.effectOf(claim, floor);
|
|
78
101
|
}
|
|
79
102
|
const resetIndex = value.op === 'reset' ? ingested.log.chain.findIndex(({ event }, index, chain)=>index > 0 && event.g > (chain[index - 1]?.event.g ?? 0)) : -1;
|
|
80
103
|
return {
|
|
@@ -120,6 +143,9 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
120
143
|
const controllerID = group.anchor.controller;
|
|
121
144
|
if (controllerID == null) throw new RevokeProofError('wrong-controller');
|
|
122
145
|
const controller = normalizeDID(controllerID);
|
|
146
|
+
const options = {
|
|
147
|
+
crypto: group.crypto
|
|
148
|
+
};
|
|
123
149
|
const subject = normalizeDID(verified.entry.subject);
|
|
124
150
|
const value = verified.entry.value;
|
|
125
151
|
const issuerController = group.bindingOfDID(verified.issuer)?.controller;
|
|
@@ -127,25 +153,35 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
127
153
|
throw new RevokeProofError('wrong-controller');
|
|
128
154
|
}
|
|
129
155
|
const previous = registry.controllers.get(controller);
|
|
130
|
-
const leaves = group.listMembers().map((member)=>{
|
|
156
|
+
const leaves = await Promise.all(group.listMembers().map(async (member)=>{
|
|
131
157
|
const binding = group.bindingOfDID(member.id);
|
|
132
|
-
const folded = binding?.prefix == null ? undefined : foldChain(controller, binding.prefix);
|
|
158
|
+
const folded = binding?.prefix == null ? undefined : await foldChain(controller, binding.prefix, options);
|
|
133
159
|
return {
|
|
134
160
|
did: normalizeDID(member.id),
|
|
135
161
|
leafIndex: member.leafIndex,
|
|
136
162
|
generation: folded?.ok ? folded.states.at(-1)?.gen : undefined,
|
|
137
163
|
prefix: binding?.prefix ?? []
|
|
138
164
|
};
|
|
139
|
-
});
|
|
165
|
+
}));
|
|
140
166
|
const timeFloor = previous?.timeFloor ?? 0;
|
|
141
167
|
if (value.op === 'clock') {
|
|
142
168
|
if (subject !== controller) throw new RevokeProofError('wrong-controller');
|
|
143
169
|
if (value.time == null || !Number.isFinite(value.time)) throw new RevokeProofError('effects-mismatch');
|
|
144
170
|
if (value.attest === true) {
|
|
145
|
-
const folded = previous?.recordedLog == null ? undefined : foldControllerLog(controller, previous.recordedLog);
|
|
171
|
+
const folded = previous?.recordedLog == null ? undefined : await foldControllerLog(controller, previous.recordedLog, options);
|
|
146
172
|
const eligible = effectiveAttestingMembers(folded?.ok ? folded.head : undefined, previous, value.time).some(([, member])=>normalizeDID(member.did) === normalizeDID(verified.issuer) && value.time > (previous?.attestations.get(member.key) ?? 0));
|
|
147
173
|
if (!eligible) throw new RevokeProofError('effects-mismatch');
|
|
148
|
-
} else if (value.time <= timeFloor || value.time > Math.max(
|
|
174
|
+
} else if (value.time <= timeFloor || value.time > Math.max(await attestedTreeTime({
|
|
175
|
+
tree: group.state.ratchetTree,
|
|
176
|
+
registry: group.registry,
|
|
177
|
+
controllerID: controller,
|
|
178
|
+
...options
|
|
179
|
+
}), await attestedTreeTime({
|
|
180
|
+
tree: group.state.ratchetTree,
|
|
181
|
+
registry,
|
|
182
|
+
controllerID: controller,
|
|
183
|
+
...options
|
|
184
|
+
}))) {
|
|
149
185
|
throw new RevokeProofError('effects-mismatch');
|
|
150
186
|
}
|
|
151
187
|
return {
|
|
@@ -161,14 +197,17 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
161
197
|
removeLeafIndices: []
|
|
162
198
|
};
|
|
163
199
|
}
|
|
164
|
-
const authenticated = authenticateLifecycleProof(controller, verified, registry);
|
|
200
|
+
const authenticated = await authenticateLifecycleProof(controller, verified, registry, options);
|
|
165
201
|
if (value.op === 'log') {
|
|
166
202
|
const index = group.findMemberLeafIndex(verified.issuer);
|
|
167
203
|
const leaf = index == null ? undefined : leafAt(group.state.ratchetTree, index);
|
|
168
204
|
if (leaf == null) throw new RevokeProofError('wrong-controller');
|
|
169
205
|
if (denySetOf(registry).has(normalizeDID(verified.issuer))) throw new LeafBindingError('denied-id');
|
|
170
|
-
if (isLapsed(group, leaf, registry)) throw new LeafLapsedError('lapsed');
|
|
171
|
-
const before = historySize(
|
|
206
|
+
if (await isLapsed(group, leaf, registry)) throw new LeafLapsedError('lapsed');
|
|
207
|
+
const before = historySize({
|
|
208
|
+
tree: group.state.ratchetTree,
|
|
209
|
+
entries: group.ledger.map(({ verified })=>verified)
|
|
210
|
+
});
|
|
172
211
|
if (before + proofSize(value.proof) > HISTORY_HORIZON) throw new RevokeProofError('too-large');
|
|
173
212
|
return {
|
|
174
213
|
controller,
|
|
@@ -180,7 +219,7 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
180
219
|
};
|
|
181
220
|
}
|
|
182
221
|
if (value.op !== 'revoke' && value.op !== 'reset') throw new RevokeProofError('no-rev');
|
|
183
|
-
const candidate = registryApply({
|
|
222
|
+
const candidate = await registryApply({
|
|
184
223
|
...verified,
|
|
185
224
|
entry: {
|
|
186
225
|
...verified.entry,
|
|
@@ -189,7 +228,7 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
189
228
|
revoked: []
|
|
190
229
|
}
|
|
191
230
|
}
|
|
192
|
-
}, registry, controller);
|
|
231
|
+
}, registry, controller, options);
|
|
193
232
|
for (const raw of value.survivors ?? []){
|
|
194
233
|
const { payload } = readCapability(raw);
|
|
195
234
|
assertControllerGrant(payload, controller);
|
|
@@ -198,19 +237,27 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
198
237
|
const leaf = group.bindingOfDID(payload.aud);
|
|
199
238
|
const key = capabilityKey(payload).publicKey;
|
|
200
239
|
if (leaf?.controller !== controller || key.length !== leaf.leafKey.length || key.some((byte, index)=>byte !== leaf.leafKey[index])) throw new LeafBindingError('confirmation-invalid');
|
|
201
|
-
const status = memberRootStatus(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
240
|
+
const status = await memberRootStatus({
|
|
241
|
+
registry: candidate,
|
|
242
|
+
controller,
|
|
243
|
+
root: {
|
|
244
|
+
kind: 'member',
|
|
245
|
+
did: payload.iss,
|
|
246
|
+
add: payload.mbr.add,
|
|
247
|
+
gen: payload.mbr.g
|
|
248
|
+
},
|
|
249
|
+
...options
|
|
206
250
|
});
|
|
207
251
|
if (status.status !== 'effective') throw new LeafBindingError(status.status === 'removed' ? 'member-removed' : 'member-unavailable');
|
|
208
252
|
const resolver = createRegistryControllerResolver({
|
|
209
253
|
controllerID: controller,
|
|
210
254
|
prefix: candidate.controllers.get(controller)?.recordedLog?.chain ?? [],
|
|
211
|
-
registry: candidate
|
|
255
|
+
registry: candidate,
|
|
256
|
+
crypto: group.crypto
|
|
212
257
|
}).frozen();
|
|
213
|
-
const token = await verifyToken(
|
|
258
|
+
const token = await verifyToken({
|
|
259
|
+
...options,
|
|
260
|
+
token: raw,
|
|
214
261
|
methods: [
|
|
215
262
|
resolver
|
|
216
263
|
],
|
|
@@ -220,9 +267,12 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
220
267
|
});
|
|
221
268
|
assertCapabilityToken(token);
|
|
222
269
|
await checkCapability({
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
270
|
+
...options,
|
|
271
|
+
permission: {
|
|
272
|
+
act: MLS_LEAF_ACT,
|
|
273
|
+
res: MLS_LEAF_RES
|
|
274
|
+
},
|
|
275
|
+
payload: payload,
|
|
226
276
|
atTime: payload.iat,
|
|
227
277
|
methods: [
|
|
228
278
|
resolver
|
|
@@ -246,26 +296,36 @@ export { controllerLogSize, HISTORY_HORIZON } from './history.js';
|
|
|
246
296
|
})),
|
|
247
297
|
...(value.effects ?? []).filter((claim)=>claim.kind !== 'deny' || !resetDIDs.has(normalizeDID(claim.did)))
|
|
248
298
|
];
|
|
249
|
-
const cascade = cascadeOf(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
299
|
+
const cascade = await cascadeOf({
|
|
300
|
+
leaves: group.listMembers().flatMap((member)=>{
|
|
301
|
+
const binding = group.bindingOfDID(member.id);
|
|
302
|
+
if (binding?.controller == null || binding.prefix == null) return [];
|
|
303
|
+
return [
|
|
304
|
+
{
|
|
305
|
+
did: member.id,
|
|
306
|
+
leafIndex: member.leafIndex,
|
|
307
|
+
binding: {
|
|
308
|
+
...binding,
|
|
309
|
+
id: binding.controller,
|
|
310
|
+
prefix: binding.prefix
|
|
311
|
+
},
|
|
312
|
+
leafKey: binding.leafKey
|
|
313
|
+
}
|
|
314
|
+
];
|
|
315
|
+
}),
|
|
316
|
+
claims,
|
|
317
|
+
before: registry,
|
|
318
|
+
after: candidate,
|
|
319
|
+
controller,
|
|
320
|
+
...options
|
|
321
|
+
});
|
|
265
322
|
if (value.op === 'reset') cascade.revoked = cascade.revoked.filter(({ did, cascadedFrom })=>resetDIDs.has(did) || cascadedFrom != null);
|
|
266
323
|
const affected = new Set(cascade.removeLeafIndices);
|
|
267
324
|
const removed = leaves.filter(({ leafIndex })=>affected.has(leafIndex));
|
|
268
|
-
const before = historySize(
|
|
325
|
+
const before = historySize({
|
|
326
|
+
tree: group.state.ratchetTree,
|
|
327
|
+
entries: group.ledger.map(({ verified })=>verified)
|
|
328
|
+
});
|
|
269
329
|
const after = before + proofSize(value.proof) - removed.reduce((size, leaf)=>size + controllerLogSize(leaf.prefix), 0);
|
|
270
330
|
if (after > HISTORY_HORIZON && after > before) throw new RevokeProofError('too-large');
|
|
271
331
|
return {
|
package/lib/lifecycle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OwnIdentity } from '@kokuin/token';
|
|
1
|
+
import { type CryptoOptions, type OwnIdentity } from '@kokuin/token';
|
|
2
2
|
import { type ClientState, type GroupContextExtension, type IncomingMessageCallback, type LeafNode } from 'ts-mls';
|
|
3
3
|
import { type JudgingContext } from './authentication.js';
|
|
4
4
|
import { type ControllerBinding } from './credential.js';
|
|
@@ -9,15 +9,25 @@ import { type DeviceRegistry } from './registry.js';
|
|
|
9
9
|
export type CommitRejectionReason = 'binding' | 'lapse' | 'floor' | 'policy' | 'invalid';
|
|
10
10
|
export declare function rejectionReason(error: unknown): CommitRejectionReason;
|
|
11
11
|
export declare function leafAt(tree: ClientState['ratchetTree'], index: number): LeafNode | undefined;
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type AttestedTreeTimeParams = {
|
|
13
|
+
tree: ClientState['ratchetTree'];
|
|
14
|
+
registry: DeviceRegistry;
|
|
15
|
+
controllerID: string;
|
|
16
|
+
} & CryptoOptions;
|
|
17
|
+
export declare function attestedTreeTime({ tree, registry, controllerID, ...options }: AttestedTreeTimeParams): Promise<number>;
|
|
18
|
+
export declare function treeTime(group: Pick<GroupHandle, 'state' | 'anchor' | 'registry'> & CryptoOptions, controllerID: string, registry?: DeviceRegistry): Promise<number>;
|
|
19
|
+
export declare function isLapsed(group: Pick<GroupHandle, 'state' | 'anchor' | 'registry'> & CryptoOptions, leaf: LeafNode, registry?: DeviceRegistry): Promise<boolean>;
|
|
20
|
+
export type LeafExpiryParams = {
|
|
21
|
+
binding: ControllerBinding;
|
|
22
|
+
registry: DeviceRegistry;
|
|
23
|
+
controller: string;
|
|
24
|
+
} & CryptoOptions;
|
|
25
|
+
export declare function leafExpiry({ binding, registry, controller, ...options }: LeafExpiryParams): Promise<number | undefined>;
|
|
16
26
|
export declare function validateEntry(group: GroupHandle, leaf: LeafNode, previous?: LeafNode, judging?: JudgingContext): Promise<void>;
|
|
17
27
|
/** The same credential and key a tree already holds at that leaf index. */
|
|
18
28
|
export declare function isUnchangedLeaf(tree: ClientState['ratchetTree'], index: number, leaf: Pick<LeafNode, 'credential' | 'signaturePublicKey'>): boolean;
|
|
19
29
|
export declare function validateWelcomeTree(group: GroupHandle, judging?: JudgingContext): Promise<void>;
|
|
20
|
-
type IncomingMessage = Parameters<IncomingMessageCallback>[0];
|
|
30
|
+
export type IncomingMessage = Parameters<IncomingMessageCallback>[0];
|
|
21
31
|
export type PrepareLifecycleGateParams = {
|
|
22
32
|
group: GroupHandle;
|
|
23
33
|
entries: Array<VerifiedLedgerEntry>;
|
|
@@ -26,7 +36,7 @@ export type PrepareLifecycleGateParams = {
|
|
|
26
36
|
externalLeaf?: LeafNode;
|
|
27
37
|
};
|
|
28
38
|
export type LifecycleGate = {
|
|
29
|
-
check: (incoming: IncomingMessage) => void
|
|
39
|
+
check: (incoming: IncomingMessage) => Promise<void>;
|
|
30
40
|
postApply: (state: ClientState) => Promise<void>;
|
|
31
41
|
};
|
|
32
42
|
/** The callback judges proposals; survivors check the path before any state is installed. */
|
|
@@ -38,7 +48,7 @@ export type AssertSenderNotLapsedParams = {
|
|
|
38
48
|
extensions: Array<GroupContextExtension>;
|
|
39
49
|
};
|
|
40
50
|
/** Historical messages use the tree and registry authenticated in their own epoch. */
|
|
41
|
-
export declare function assertSenderNotLapsed(params: AssertSenderNotLapsedParams): void
|
|
51
|
+
export declare function assertSenderNotLapsed(params: AssertSenderNotLapsedParams): Promise<void>;
|
|
42
52
|
export type AssertRecoveryBindingParams = {
|
|
43
53
|
group: GroupHandle;
|
|
44
54
|
identity: OwnIdentity;
|
|
@@ -46,4 +56,3 @@ export type AssertRecoveryBindingParams = {
|
|
|
46
56
|
};
|
|
47
57
|
/** @internal Check a replacement against the complete external admission predicates. */
|
|
48
58
|
export declare function assertRecoveryBinding(params: AssertRecoveryBindingParams): Promise<void>;
|
|
49
|
-
export {};
|