@serfab/cadre-core 1.20.0 → 1.22.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 +294 -294
- package/dist/cadre-node.d.ts +329 -53
- package/dist/cadre-node.js +767 -85
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-authorization.d.ts +32 -2
- package/dist/control-authorization.js +19 -0
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-database.d.ts +236 -23
- package/dist/control-database.js +601 -178
- package/dist/control-database.js.map +1 -1
- package/dist/control-schema.d.ts +3 -3
- package/dist/control-schema.js +71 -7
- package/dist/control-schema.js.map +1 -1
- package/dist/ed25519-key.d.ts +8 -0
- package/dist/ed25519-key.js +11 -1
- package/dist/ed25519-key.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/machine-removal.d.ts +51 -1
- package/dist/machine-removal.js +42 -1
- package/dist/machine-removal.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +8 -0
- package/dist/membership-connection-gater.js +13 -1
- package/dist/membership-connection-gater.js.map +1 -1
- package/dist/owner-keys.js +2 -1
- package/dist/owner-keys.js.map +1 -1
- package/dist/owner-signer.js +3 -4
- package/dist/owner-signer.js.map +1 -1
- package/dist/peer-authorization.d.ts +14 -2
- package/dist/peer-authorization.js +24 -1
- package/dist/peer-authorization.js.map +1 -1
- package/dist/relay-reservation.js +20 -1
- package/dist/relay-reservation.js.map +1 -1
- package/dist/sealed-party-key.d.ts +32 -0
- package/dist/sealed-party-key.js +162 -0
- package/dist/sealed-party-key.js.map +1 -0
- package/dist/seed-bootstrap.d.ts +10 -3
- package/dist/seed-bootstrap.js +12 -0
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/strand-addr-protocol.d.ts +56 -6
- package/dist/strand-addr-protocol.js +57 -5
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-app-schema-report.d.ts +6 -3
- package/dist/strand-app-schema-report.js +13 -7
- package/dist/strand-app-schema-report.js.map +1 -1
- package/dist/strand-commit-durability.d.ts +33 -2
- package/dist/strand-commit-durability.js +44 -4
- package/dist/strand-commit-durability.js.map +1 -1
- package/dist/strand-database.d.ts +36 -6
- package/dist/strand-database.js +35 -11
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +133 -9
- package/dist/strand-instance-manager.js +266 -42
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.d.ts +250 -51
- package/dist/strand-membership-reconciler.js +410 -66
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +7 -0
- package/dist/strand-membership-writer.js +9 -0
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-party-key-rotation.d.ts +177 -0
- package/dist/strand-party-key-rotation.js +340 -0
- package/dist/strand-party-key-rotation.js.map +1 -0
- package/dist/strand-party-machines.d.ts +111 -0
- package/dist/strand-party-machines.js +258 -0
- package/dist/strand-party-machines.js.map +1 -0
- package/dist/strand-party-peers.d.ts +101 -0
- package/dist/strand-party-peers.js +49 -0
- package/dist/strand-party-peers.js.map +1 -0
- package/dist/strand-peer-redial.d.ts +34 -7
- package/dist/strand-peer-redial.js +46 -13
- package/dist/strand-peer-redial.js.map +1 -1
- package/dist/strand-revocation-enforcer.d.ts +15 -1
- package/dist/strand-revocation-enforcer.js +16 -9
- package/dist/strand-revocation-enforcer.js.map +1 -1
- package/dist/strand-transport-key.js +3 -0
- package/dist/strand-transport-key.js.map +1 -1
- package/dist/strand-watcher.d.ts +7 -4
- package/dist/strand-watcher.js +12 -7
- package/dist/strand-watcher.js.map +1 -1
- package/dist/types.d.ts +165 -17
- package/dist/types.js.map +1 -1
- package/package.json +9 -8
- package/src/cadre-node.ts +12252 -11528
- package/src/control-authorization.ts +41 -1
- package/src/control-database.ts +6123 -5594
- package/src/control-schema.ts +71 -7
- package/src/ed25519-key.ts +12 -1
- package/src/index.ts +957 -924
- package/src/machine-removal.ts +80 -1
- package/src/membership-connection-gater.ts +13 -1
- package/src/owner-keys.ts +2 -1
- package/src/owner-signer.ts +92 -94
- package/src/peer-authorization.ts +27 -3
- package/src/relay-reservation.ts +28 -1
- package/src/sealed-party-key.ts +190 -0
- package/src/seed-bootstrap.ts +17 -3
- package/src/strand-addr-protocol.ts +67 -6
- package/src/strand-app-schema-report.ts +17 -10
- package/src/strand-commit-durability.ts +54 -5
- package/src/strand-database.ts +48 -12
- package/src/strand-instance-manager.ts +330 -42
- package/src/strand-membership-reconciler.ts +1310 -942
- package/src/strand-membership-writer.ts +10 -0
- package/src/strand-party-key-rotation.ts +436 -0
- package/src/strand-party-machines.ts +293 -0
- package/src/strand-party-peers.ts +129 -0
- package/src/strand-peer-redial.ts +61 -14
- package/src/strand-revocation-enforcer.ts +27 -9
- package/src/strand-transport-key.ts +3 -0
- package/src/strand-watcher.ts +12 -7
- package/src/types.ts +3112 -2962
package/dist/control-schema.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Parser } from '@quereus/quereus';
|
|
|
9
9
|
* docs/architecture.md → "Control schema versions and migrations", enforced by
|
|
10
10
|
* `control-schema-versions.spec.ts`.
|
|
11
11
|
*/
|
|
12
|
-
export const CONTROL_SCHEMA_VERSION =
|
|
12
|
+
export const CONTROL_SCHEMA_VERSION = 4;
|
|
13
13
|
/**
|
|
14
14
|
* The first control schema version whose fixture is kept, and the oldest a store can be
|
|
15
15
|
* migrated from. A store that records a version below it (written by 1.16.0 and earlier,
|
|
@@ -44,9 +44,10 @@ export const CONTROL_SCHEMA_DECLARATION = `-- A Sereus party's cadre (its nodes)
|
|
|
44
44
|
-- an owner key never accept each other's approvals. FormationUsage is the exception, its
|
|
45
45
|
-- two digests scoped by the invitation token instead (FormationUsage.Authorized).
|
|
46
46
|
--
|
|
47
|
-
-- Rows of the guarded tables (OwnerKey, ValidationKey, Strand, StrandPartyKey,
|
|
48
|
-
-- JoinRequest, CadrePeer, DeviceToken, CadreInvite,
|
|
49
|
-
-- into their add and remove digests. \`unique\` holds
|
|
47
|
+
-- Rows of the guarded tables (OwnerKey, ValidationKey, Strand, StrandPartyKey,
|
|
48
|
+
-- PendingStrandPartyKey, JoinedStrand, JoinRequest, CadrePeer, DeviceToken, CadreInvite,
|
|
49
|
+
-- OwnerGrant) carry a one-off StampId bound into their add and remove digests. \`unique\` holds
|
|
50
|
+
-- over live rows only, so a delete retires
|
|
50
51
|
-- the stamp into Revocation in the same transaction (RevocationRecorded) and an insert refuses
|
|
51
52
|
-- a retired stamp (NotRevoked): the never-expiring add approval cannot re-seat a removed row.
|
|
52
53
|
-- A legitimate re-add mints a fresh stamp and a fresh signature. CadreInvite and OwnerGrant
|
|
@@ -268,6 +269,43 @@ declare schema CadreControl {
|
|
|
268
269
|
)
|
|
269
270
|
) with context (OwnerKey text, Signature text);
|
|
270
271
|
|
|
272
|
+
-- The key this party's membership in one closed strand is moving to, while the move is under
|
|
273
|
+
-- way. It is written before the strand is touched and swapped into StrandPartyKey only after
|
|
274
|
+
-- the strand-side work is done: seating a fresh key and crashing before the control row changes
|
|
275
|
+
-- would leave a manager seat nobody holds, and changing the control row first would delete the
|
|
276
|
+
-- only copy of the old key, which the seating needs. A table of its own because StrandPartyKey
|
|
277
|
+
-- is keyed on the strand id alone and NoUpdate. Guarded as StrandPartyKey is, with no reap
|
|
278
|
+
-- branch for the same reason: the key is stored nowhere else.
|
|
279
|
+
-- NOTE: unlike a tombstone (Revocation.ReissuedAt), a pending row committed while the remover
|
|
280
|
+
-- was alone has no re-issue path, so a remover that removes alone and is lost before its
|
|
281
|
+
-- rotations finish loses the rows with it. If that ever matters, give this table that idiom.
|
|
282
|
+
table PendingStrandPartyKey (
|
|
283
|
+
Id text primary key, -- the strand id
|
|
284
|
+
PublicKey text, -- the key being moved to, public half (base64url): the Strand.Member.Key it is seated as.
|
|
285
|
+
-- In the clear so a second removal lists it in Superseded without opening the row.
|
|
286
|
+
SealedKey text, -- its private half (StrandPartyKey.PrivateKey encoding), sealed to the identity keys of the
|
|
287
|
+
-- machines that remain (sealed-party-key.ts): the row is written in the removed machine's last
|
|
288
|
+
-- control transaction and reaches it, so what it carries must open only for the others.
|
|
289
|
+
Superseded text null, -- comma-joined public keys (base64url) of earlier pending keys this row replaced.
|
|
290
|
+
-- A second removal replaces the row because the old key may have reached the
|
|
291
|
+
-- machine it removes, and a seat that key already holds must then be revoked.
|
|
292
|
+
StampId text unique,
|
|
293
|
+
constraint NotRevoked check on insert (
|
|
294
|
+
not exists (select 1 from Revocation R where R.TableName = 'PendingStrandPartyKey' and R.StampId = new.StampId)
|
|
295
|
+
),
|
|
296
|
+
constraint RevocationRecorded check on delete (
|
|
297
|
+
exists (select 1 from Revocation R where R.TableName = 'PendingStrandPartyKey' and R.StampId = old.StampId and R.RowKey = old.Id)
|
|
298
|
+
),
|
|
299
|
+
constraint NoUpdate check on update (false),
|
|
300
|
+
-- Binding Superseded as well as the key: a captured approval cannot drop a key from the list.
|
|
301
|
+
constraint AuthorizedInsert check on insert (
|
|
302
|
+
exists (select 1 from OwnerKey A where A.Key = context.OwnerKey and not exists (select 1 from Revocation R where R.TableName = 'OwnerKey' and R.StampId = A.StampId) and verify(digest('CadreControl.PendingStrandPartyKey', 'add', party_id(), new.Id, new.PublicKey, new.SealedKey, coalesce(new.Superseded, ''), new.StampId), context.Signature, A.Key, 'ed25519'))
|
|
303
|
+
),
|
|
304
|
+
constraint AuthorizedDelete check on delete (
|
|
305
|
+
exists (select 1 from OwnerKey A where A.Key = context.OwnerKey and not exists (select 1 from Revocation R where R.TableName = 'OwnerKey' and R.StampId = A.StampId) and verify(digest('CadreControl.PendingStrandPartyKey', 'remove', party_id(), old.Id, old.StampId), context.Signature, A.Key, 'ed25519'))
|
|
306
|
+
)
|
|
307
|
+
) with context (OwnerKey text, Signature text);
|
|
308
|
+
|
|
271
309
|
-- A strand this party joined from another party, whose control database holds the Strand
|
|
272
310
|
-- row. Every machine of the party reads it, so a replica host keeps a copy and the party's
|
|
273
311
|
-- other machines can attach. A separate table because every reader of Strand takes it to
|
|
@@ -555,6 +593,30 @@ declare schema CadreControl {
|
|
|
555
593
|
)
|
|
556
594
|
) with context (OwnerKey text null, Signature text);
|
|
557
595
|
|
|
596
|
+
-- Each machine's own signed statement of the peer id it uses in one strand. That id derives from
|
|
597
|
+
-- the machine's private identity seed (cadre-core strandTransportKey), so no other machine can
|
|
598
|
+
-- compute it, and a machine removal needs it to tell the removed machine's Strand.MemberPeer
|
|
599
|
+
-- binding from its siblings'. A row is a permanent fact: the derivation is deterministic, and a
|
|
600
|
+
-- removed machine's rows are how its orphaned bindings stay attributed to it. So no stamp, no
|
|
601
|
+
-- tombstone and no delete, and no Revocation.RowIsGone branch.
|
|
602
|
+
-- The check defers (it has a subquery), so a CadrePeer row written in the same transaction
|
|
603
|
+
-- counts. A node that does not hold the machine's CadrePeer row yet refuses the insert, and the
|
|
604
|
+
-- writer tries again later. The check runs only on the node that takes the insert, and it cannot
|
|
605
|
+
-- tell whether PublicKey is really the key behind PeerId, so a reader re-verifies Sig against the
|
|
606
|
+
-- key derived from PeerId (ControlDatabase.queryStrandPeers) and judges PeerId against the
|
|
607
|
+
-- membership views.
|
|
608
|
+
table StrandPeer (
|
|
609
|
+
StrandId text, -- a Strand.Id or JoinedStrand.Id
|
|
610
|
+
PeerId text, -- the machine's control peer id (CadrePeer.PeerId)
|
|
611
|
+
StrandPeerId text, -- that machine's peer id in the strand's own network
|
|
612
|
+
Sig text, -- the machine's signature over the 'add' digest
|
|
613
|
+
primary key (StrandId, PeerId),
|
|
614
|
+
constraint Immutable check on update, delete (false),
|
|
615
|
+
constraint Authorized check on insert (
|
|
616
|
+
exists (select 1 from CadrePeer P where P.PeerId = new.PeerId and verify(digest('CadreControl.StrandPeer', 'add', party_id(), new.StrandId, new.PeerId, new.StrandPeerId), new.Sig, P.PublicKey, 'ed25519'))
|
|
617
|
+
)
|
|
618
|
+
);
|
|
619
|
+
|
|
558
620
|
-- An open invitation to form a strand with this party.
|
|
559
621
|
table FormationInvite (
|
|
560
622
|
Token text primary key, -- a random string
|
|
@@ -905,9 +967,10 @@ declare schema CadreControl {
|
|
|
905
967
|
-- TableName, and queryRevocations skips it. A 'CadreInvite' or 'OwnerGrant' row withdraws
|
|
906
968
|
-- an invitation or a grant whose row stays (the table comments).
|
|
907
969
|
table Revocation (
|
|
908
|
-
TableName text, -- 'OwnerKey' | 'ValidationKey' | 'Strand' | 'StrandPartyKey' |
|
|
909
|
-
-- '
|
|
910
|
-
-- 'Revocation' for an older
|
|
970
|
+
TableName text, -- 'OwnerKey' | 'ValidationKey' | 'Strand' | 'StrandPartyKey' |
|
|
971
|
+
-- 'PendingStrandPartyKey' | 'JoinedStrand' | 'JoinRequest' | 'CadrePeer' |
|
|
972
|
+
-- 'DeviceToken' | 'CadreInvite' | 'OwnerGrant', or 'Revocation' for an older
|
|
973
|
+
-- party's marker
|
|
911
974
|
RowKey text, -- primary key of the removed row
|
|
912
975
|
StampId text, -- the retired stamp
|
|
913
976
|
ReissuedAt integer default 0, -- bumped by an owner-signed re-issue so a tombstone committed while the
|
|
@@ -946,6 +1009,7 @@ declare schema CadreControl {
|
|
|
946
1009
|
or (new.TableName = 'ValidationKey' and not exists (select 1 from ValidationKey V where V.StampId = new.StampId))
|
|
947
1010
|
or (new.TableName = 'Strand' and not exists (select 1 from Strand S where S.StampId = new.StampId))
|
|
948
1011
|
or (new.TableName = 'StrandPartyKey' and not exists (select 1 from StrandPartyKey K where K.StampId = new.StampId))
|
|
1012
|
+
or (new.TableName = 'PendingStrandPartyKey' and not exists (select 1 from PendingStrandPartyKey K where K.StampId = new.StampId))
|
|
949
1013
|
or (new.TableName = 'JoinedStrand' and not exists (select 1 from JoinedStrand J where J.StampId = new.StampId))
|
|
950
1014
|
or (new.TableName = 'JoinRequest' and not exists (select 1 from JoinRequest J where J.StampId = new.StampId))
|
|
951
1015
|
or (new.TableName = 'DeviceToken' and not exists (select 1 from DeviceToken D where D.StampId = new.StampId))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-schema.js","sourceRoot":"","sources":["../src/control-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAEjD,6GAA6G;AAC7G,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG
|
|
1
|
+
{"version":3,"file":"control-schema.js","sourceRoot":"","sources":["../src/control-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAEjD,6GAA6G;AAC7G,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA6GtB,0BAA0B,OAAO,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC;IACxC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;WACvB,WAAW,CAAC,IAAI,KAAK,eAAe,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,UAAU,CAAC;WACpF,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC;WACtE,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI;WACvF,WAAW,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACd,4DAA4D,mBAAmB,WAAW;YAC1F,iBAAiB,oBAAoB,wCAAwC,CAC7E,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAwB;IACpD,OAAO,IAAI,EAAE,WAAW,EAAE,KAAK,mBAAmB,CAAC,WAAW,EAAE,CAAC;AAClE,CAAC"}
|
package/dist/ed25519-key.d.ts
CHANGED
|
@@ -40,6 +40,14 @@ export declare function ed25519KeyPairFromLibp2p(privateKey: PrivateKey): Ed2551
|
|
|
40
40
|
* @returns The base64url-encoded Ed25519 public key.
|
|
41
41
|
*/
|
|
42
42
|
export declare function ed25519PublicKeyFromPrivate(privateKeyB64: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* A signer over an in-memory Ed25519 seed, in the shape the control database's signing
|
|
45
|
+
* callbacks take (`ControlSign`, `OwnerSign`): raw message bytes in, a base64url signature out.
|
|
46
|
+
* The crypto plugin takes the bytes as they are (its input encoding applies to a string only).
|
|
47
|
+
*
|
|
48
|
+
* @param privateKeyB64 - The base64url-encoded 32-byte Ed25519 seed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function ed25519MessageSigner(privateKeyB64: string): (message: Uint8Array) => string;
|
|
43
51
|
/**
|
|
44
52
|
* Reject a value that isn't a base64url-encoded 32-byte Ed25519 seed, the private-key form
|
|
45
53
|
* {@link ed25519PublicKeyFromPrivate} and the crypto plugin's `sign` take. Unlike
|
package/dist/ed25519-key.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toString as uint8ArrayToString, fromString as uint8ArrayFromString } from 'uint8arrays';
|
|
2
|
-
import { getPublicKey } from '@optimystic/quereus-plugin-crypto';
|
|
2
|
+
import { getPublicKey, sign } from '@optimystic/quereus-plugin-crypto';
|
|
3
3
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
4
4
|
/**
|
|
5
5
|
* Bridge a libp2p Ed25519 private key into the base64url keypair used by the
|
|
@@ -49,6 +49,16 @@ export function ed25519KeyPairFromLibp2p(privateKey) {
|
|
|
49
49
|
export function ed25519PublicKeyFromPrivate(privateKeyB64) {
|
|
50
50
|
return getPublicKey(privateKeyB64, 'ed25519', 'base64url', 'base64url');
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* A signer over an in-memory Ed25519 seed, in the shape the control database's signing
|
|
54
|
+
* callbacks take (`ControlSign`, `OwnerSign`): raw message bytes in, a base64url signature out.
|
|
55
|
+
* The crypto plugin takes the bytes as they are (its input encoding applies to a string only).
|
|
56
|
+
*
|
|
57
|
+
* @param privateKeyB64 - The base64url-encoded 32-byte Ed25519 seed.
|
|
58
|
+
*/
|
|
59
|
+
export function ed25519MessageSigner(privateKeyB64) {
|
|
60
|
+
return (message) => sign(message, privateKeyB64, 'ed25519', 'base64url', 'base64url', 'base64url');
|
|
61
|
+
}
|
|
52
62
|
/**
|
|
53
63
|
* Reject a value that isn't a base64url-encoded 32-byte Ed25519 seed, the private-key form
|
|
54
64
|
* {@link ed25519PublicKeyFromPrivate} and the crypto plugin's `sign` take. Unlike
|
package/dist/ed25519-key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ed25519-key.js","sourceRoot":"","sources":["../src/ed25519-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"ed25519-key.js","sourceRoot":"","sources":["../src/ed25519-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAgBnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAsB;IAC7D,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,yDAAyD,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;IAC3B,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,kEAAkE,GAAG,CAAC,MAAM,QAAQ,CAAC,CAAC;IACxG,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjC,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC;IAC9C,IAAI,YAAY,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,8CAA8C,YAAY,CAAC,MAAM,QAAQ,CAAC,CAAC;IAC7F,CAA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AO,CAAC,MAAM,SAAS,CACxI,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { StrandDatabase, type StrandDatabaseConfig, type StrandDatabaseOffline }
|
|
|
31
31
|
export type { StrandCommitDurability, StrandCommitHeld } from './strand-commit-durability.js';
|
|
32
32
|
export { StrandOfflineUnavailableError, StrandQueueNotEmptyError, type StrandLeaveOptions, type StrandOfflineConfig, type StrandOfflineMode, type StrandOfflineQueue, type StrandOfflineListeners, type StrandOfflineStatus, type StrandQueueState } from './strand-offline.js';
|
|
33
33
|
export { type StrandAppSchemaState, type StrandAppSchemaDeferred, type StrandAppSchemaListeners } from './strand-app-schema-report.js';
|
|
34
|
+
export { AppSchemaRefusedError, appSchemaRefusalOf } from '@serfab/quereus-plugin-sereus';
|
|
34
35
|
export { EntryNotDiscardableError, UnknownEntryError } from '@optimystic/db-core';
|
|
35
36
|
export { StrandWatcher, type StrandWatcherCallbacks, type StrandQueryable, type SAppIdLookup, type StrandRowWithApp } from './strand-watcher.js';
|
|
36
37
|
export { StrandInstanceManager, type StartStrandConfig, type ResumeStrandOverrides, getStrandStoragePath, isAwaitingFirstSync, liveStrandStatus } from './strand-instance-manager.js';
|
|
@@ -39,6 +40,9 @@ export { PeerJoinBackfill, DEFAULT_PEER_JOIN_BACKFILL, PEER_JOIN_BACKFILL_WARN_A
|
|
|
39
40
|
export { strandCohortTopicOption, type StrandReactivityConfig } from './strand-reactivity.js';
|
|
40
41
|
export { StrandRevocationEnforcer, createRevocationConnectionGater, readStrandRevocationRows, DEFAULT_REVOCATION_BACKSTOP_MS, REVOCATION_REFRESH_RETRY_MS, REVOCATION_WIDE_STRAND_REFRESH_MS, type StrandRevocationEnforcementConfig, type StrandRevocationEnforcerDeps, type StrandRevocationRows, type StrandMemberPeerBinding, type StrandRevocationJudge, type StrandRevocationNetwork } from './strand-revocation-enforcer.js';
|
|
41
42
|
export { StrandMembershipReconciler, DEFAULT_MEMBERSHIP_RECONCILE_INTERVAL_MS, IDLE_PASSES_BEFORE_ESCALATION, INITIAL_JOIN_RETRY_INTERVAL_MS, type StrandMembershipReconcilerDeps, type StrandMembershipReconciliationConfig, type PendingMembershipInviteSource } from './strand-membership-reconciler.js';
|
|
43
|
+
export { partitionPartyStrandPeers, type PartyStrandPeer, type PartyStrandPeers, type PartyStrandPeerSource, type PendingPartyKeyState } from './strand-party-peers.js';
|
|
44
|
+
export { StrandPartyKeyRotationDriver, type OpenedPendingPartyKey, type StrandPartyKeyRotationDeps, type StrandPartyKeySwapEntry } from './strand-party-key-rotation.js';
|
|
45
|
+
export { sealPartyKey, openPartyKey, partyKeyRecipients, type PartyKeyRecipient, type PartyKeyOpener } from './sealed-party-key.js';
|
|
42
46
|
export { defaultTimeoutScheduler, type TimeoutScheduler } from './timeout-scheduler.js';
|
|
43
47
|
export { HibernationManager, type HibernationCallbacks } from './hibernation-manager.js';
|
|
44
48
|
export { ArachnodeStub, createArachnodeStub, type RingConfig } from './arachnode-stub.js';
|
|
@@ -47,7 +51,7 @@ export { StrandSolicitationService, createDefaultFormationResponseValidator, typ
|
|
|
47
51
|
export { createHttpFormationApprover, signFormationApproval, verifyFormationApproval, FormationApprovalError, type FormationApprovalRequest, type FormationVouchFields, type FormationApproval, type FormationApprover, type FormationApprovalFailure } from './formation-approval.js';
|
|
48
52
|
export { ControlFormationUsageRecorder } from './control-formation-recorder.js';
|
|
49
53
|
export { generateStrandMemberKey, strandMemberKeyPair } from './strand-member-key.js';
|
|
50
|
-
export { signStrandPayload, verifyStrandPayload, signStrandApproval, generateStrandStampId, bootstrapFounderMembership, PreSplitStrandIdentityError, issueInvite, consumeInvite, burnInvite, isStrandMember, cancelInvite, listOutstandingInvites, addMemberByManager, revokeMember, leaveStrand, registerMemberPeer, listMemberPeers, removeMemberPeer, addManager, admitManager, removeManager, sealStrand, isStrandSealed, StrandTransactionBusyError, StrandOfflineQueueBusyError, STRAND_ENGINE, STRAND_ENGINE_VERSION, type FounderBootstrapParams, type IssueInviteParams, type IssuedInvite, type ConsumeInviteParams, type CancelInviteParams, type OutstandingInvite, type AddMemberByManagerParams, type RevokeMemberParams, type LeaveStrandParams, type RegisterMemberPeerParams, type RemoveOwnPeerParams, type RemoveMemberPeerByManagerParams, type RemoveMemberPeerParams, type AddManagerParams, type AdmitManagerParams, type RemoveManagerParams, type SealStrandParams, type StrandWriteOptions } from './strand-membership-writer.js';
|
|
54
|
+
export { signStrandPayload, verifyStrandPayload, signStrandApproval, generateStrandStampId, bootstrapFounderMembership, PreSplitStrandIdentityError, issueInvite, consumeInvite, burnInvite, isStrandMember, isStrandManager, cancelInvite, listOutstandingInvites, addMemberByManager, revokeMember, leaveStrand, registerMemberPeer, listMemberPeers, removeMemberPeer, addManager, admitManager, removeManager, sealStrand, isStrandSealed, StrandTransactionBusyError, StrandOfflineQueueBusyError, STRAND_ENGINE, STRAND_ENGINE_VERSION, type FounderBootstrapParams, type IssueInviteParams, type IssuedInvite, type ConsumeInviteParams, type CancelInviteParams, type OutstandingInvite, type AddMemberByManagerParams, type RevokeMemberParams, type LeaveStrandParams, type RegisterMemberPeerParams, type RemoveOwnPeerParams, type RemoveMemberPeerByManagerParams, type RemoveMemberPeerParams, type AddManagerParams, type AdmitManagerParams, type RemoveManagerParams, type SealStrandParams, type StrandWriteOptions } from './strand-membership-writer.js';
|
|
51
55
|
export { canonicalDatetime } from './canonical-datetime.js';
|
|
52
56
|
export { StrandMemberRegistry, StrandMemberVerifier, memberRegistrationPayload, type StrandAdmission } from './strand-member-registry.js';
|
|
53
57
|
export { SeedBootstrapService, SEED_PROTOCOL, mergeSeedPeers, seedDialTargets, seedDigest, type SeedBootstrapConfig, type SeedEventCallbacks } from './seed-bootstrap.js';
|
package/dist/index.js
CHANGED
|
@@ -99,6 +99,9 @@ export { StrandDatabase } from './strand-database.js';
|
|
|
99
99
|
// Offline mode on strands (`CadreNodeConfig.strandOffline`, `CadreNode.setStrandOfflineMode`,
|
|
100
100
|
// `StrandDatabase.offline`): a commit resolves once the transaction is queued on this machine.
|
|
101
101
|
export { StrandOfflineUnavailableError, StrandQueueNotEmptyError } from './strand-offline.js';
|
|
102
|
+
// What a rejected `addStrand` and `strand:error` carry when the app's schema can never apply to the
|
|
103
|
+
// strand's tables, so an app need not depend on the plugin to recognise it.
|
|
104
|
+
export { AppSchemaRefusedError, appSchemaRefusalOf } from '@serfab/quereus-plugin-sereus';
|
|
102
105
|
// What `StrandOfflineQueue.discard` throws, so an app need not depend on Optimystic to tell them apart.
|
|
103
106
|
export { EntryNotDiscardableError, UnknownEntryError } from '@optimystic/db-core';
|
|
104
107
|
// Strand management
|
|
@@ -125,6 +128,15 @@ export { StrandRevocationEnforcer, createRevocationConnectionGater, readStrandRe
|
|
|
125
128
|
// write the durable machine→party MemberPeer binding — without ever blocking
|
|
126
129
|
// bring-up (see the module doc for the pass ladder and terminal states).
|
|
127
130
|
export { StrandMembershipReconciler, DEFAULT_MEMBERSHIP_RECONCILE_INTERVAL_MS, IDLE_PASSES_BEFORE_ESCALATION, INITIAL_JOIN_RETRY_INTERVAL_MS } from './strand-membership-reconciler.js';
|
|
131
|
+
// The party's machines as one strand sees them: the control-database seam the reconciler binds
|
|
132
|
+
// the party's other machines through and the offline queue waits for them through, and its
|
|
133
|
+
// pure projection.
|
|
134
|
+
export { partitionPartyStrandPeers } from './strand-party-peers.js';
|
|
135
|
+
// The driver that moves a party onto a fresh membership key in a closed strand after a machine
|
|
136
|
+
// removal, and the seams `CadreNode` hands it.
|
|
137
|
+
export { StrandPartyKeyRotationDriver } from './strand-party-key-rotation.js';
|
|
138
|
+
// The envelope a `PendingStrandPartyKey` row carries its key in, sealed to the machines that remain.
|
|
139
|
+
export { sealPartyKey, openPartyKey, partyKeyRecipients } from './sealed-party-key.js';
|
|
128
140
|
// The timer seam the self-rescheduling loops share (membership retry ladder, the table
|
|
129
141
|
// change schedule the first-sync gate probes on) — injected by tests as a hand-cranked clock.
|
|
130
142
|
export { defaultTimeoutScheduler } from './timeout-scheduler.js';
|
|
@@ -148,7 +160,7 @@ export { generateStrandMemberKey, strandMemberKeyPair } from './strand-member-ke
|
|
|
148
160
|
// manager-admit, member-peer registration, manager rotation, sealing — the sole
|
|
149
161
|
// manager permanently freezing admission — + shared signing primitives reused
|
|
150
162
|
// across the flows).
|
|
151
|
-
export { signStrandPayload, verifyStrandPayload, signStrandApproval, generateStrandStampId, bootstrapFounderMembership, PreSplitStrandIdentityError, issueInvite, consumeInvite, burnInvite, isStrandMember, cancelInvite, listOutstandingInvites, addMemberByManager, revokeMember, leaveStrand, registerMemberPeer, listMemberPeers, removeMemberPeer, addManager, admitManager, removeManager, sealStrand, isStrandSealed, StrandTransactionBusyError, StrandOfflineQueueBusyError, STRAND_ENGINE, STRAND_ENGINE_VERSION } from './strand-membership-writer.js';
|
|
163
|
+
export { signStrandPayload, verifyStrandPayload, signStrandApproval, generateStrandStampId, bootstrapFounderMembership, PreSplitStrandIdentityError, issueInvite, consumeInvite, burnInvite, isStrandMember, isStrandManager, cancelInvite, listOutstandingInvites, addMemberByManager, revokeMember, leaveStrand, registerMemberPeer, listMemberPeers, removeMemberPeer, addManager, admitManager, removeManager, sealStrand, isStrandSealed, StrandTransactionBusyError, StrandOfflineQueueBusyError, STRAND_ENGINE, STRAND_ENGINE_VERSION } from './strand-membership-writer.js';
|
|
152
164
|
// Engine-canonical datetime helper (shared by control + strand signed-write flows
|
|
153
165
|
// so a signed timestamp byte-matches the datetime-coerced column the CHECK sees).
|
|
154
166
|
export { canonicalDatetime } from './canonical-datetime.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,YAAY,CAAC;AAE3B,+DAA+D;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,gGAAgG;AAChG,uEAAuE;AACvE,O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4BAA4B,EAC5B,wBAAwB,EACxB,oCAAoC,EACpC,oCAAoC,EAKrC,MAAM,+BAA+B,CAAC;AAEvC,kFAAkF;AAClF,OAAO,EACL,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AAErC,wEAAwE;AACxE,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,sCAAsC,EACtC,mCAAmC,EACnC,6BAA6B,EAG9B,MAAM,kCAAkC,CAAC;AAE1C,iFAAiF;AACjF,iFAAiF;AACjF,mFAAmF;AACnF,sFAAsF;AACtF,uFAAuF;AACvF,yEAAyE;AACzE,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,uFAAuF;AACvF,wFAAwF;AACxF,wFAAwF;AACxF,YAAY;AACZ,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAwB,MAAM,4BAA4B,CAAC;AACnF,yFAAyF;AACzF,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAmB,MAAM,iBAAiB,CAAC;AACrG,2FAA2F;AAC3F,8FAA8F;AAC9F,+EAA+E;AAC/E,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,8BAA8B,EAG/B,MAAM,mBAAmB,CAAC;AAE3B,gFAAgF;AAChF,0EAA0E;AAC1E,6BAA6B;AAC7B,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAM7B,MAAM,wBAAwB,CAAC;AAEhC,2EAA2E;AAC3E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EAMzB,MAAM,kCAAkC,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* machine leaves every owner key standing, the one the machine's user signed with included
|
|
9
9
|
* (removing one is `CadreNode.removeOwner`, `owner-keys.ts`).
|
|
10
10
|
*/
|
|
11
|
-
import type { CadreInviteStatus, CadreInviteUsageRow, CadreMachine, CadrePeerRow, MachineRemovalPlan, MachineRemovalRefusal } from './types.js';
|
|
11
|
+
import type { CadreInviteStatus, CadreInviteUsageRow, CadreMachine, CadrePeerRow, MachineRemovalPlan, MachineRemovalRefusal, PendingPartyKeyRotation, StrandKeyRotationPlan } from './types.js';
|
|
12
12
|
/**
|
|
13
13
|
* `CadreNode.removeMachine` refused by name, before any write. `code` says which rule
|
|
14
14
|
* (`MachineRemovalRefusal`), for an app to switch on; the message is for a log.
|
|
@@ -43,6 +43,26 @@ export interface MachineRemovalPlanInput {
|
|
|
43
43
|
canSign: boolean;
|
|
44
44
|
invites: readonly CadreInviteStatus[];
|
|
45
45
|
usages: readonly CadreInviteUsageRow[];
|
|
46
|
+
/** Every closed strand the party holds a membership key for, as this node runs it ({@link ClosedStrandState}). */
|
|
47
|
+
strands: readonly ClosedStrandState[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One closed strand with a `StrandPartyKey` row, as `CadreNode.planMachineRemoval` reads it,
|
|
51
|
+
* for {@link planStrandKeyRotations}.
|
|
52
|
+
*/
|
|
53
|
+
export interface ClosedStrandState {
|
|
54
|
+
strandId: string;
|
|
55
|
+
/**
|
|
56
|
+
* `live`: a tracked instance with a database; `hibernating`: a tracked instance with its
|
|
57
|
+
* runtime released, which a removal wakes; `none`: not tracked here (never launched, excluded
|
|
58
|
+
* by the strand filter), or tracked without a database (still syncing, mid-build).
|
|
59
|
+
*/
|
|
60
|
+
runtime: 'live' | 'hibernating' | 'none';
|
|
61
|
+
/**
|
|
62
|
+
* Whether the party's current key holds a `Strand.Manager` row, read from the live database;
|
|
63
|
+
* `unknown` when there is none to read.
|
|
64
|
+
*/
|
|
65
|
+
managerSeat: boolean | 'unknown';
|
|
46
66
|
}
|
|
47
67
|
/**
|
|
48
68
|
* The plan for removing `peerId` from these rows. The refusals come first and by name: a node
|
|
@@ -54,5 +74,35 @@ export interface MachineRemovalPlanInput {
|
|
|
54
74
|
* or already redeemed by it and still redeemable (a multi-use invitation, or an open
|
|
55
75
|
* invitation inside its lifetime). The schema's rule: keeping a device out is removing
|
|
56
76
|
* its row and withdrawing the invitation.
|
|
77
|
+
*
|
|
78
|
+
* `strands` says where the party's key in each closed strand is replaced
|
|
79
|
+
* ({@link planStrandKeyRotations}); empty when no live row names the machine, since such a
|
|
80
|
+
* removal writes nothing.
|
|
57
81
|
*/
|
|
58
82
|
export declare function planMachineRemoval(input: MachineRemovalPlanInput): MachineRemovalPlan;
|
|
83
|
+
/**
|
|
84
|
+
* Where each closed strand's party key is replaced ({@link StrandKeyRotationPlan.rotation}):
|
|
85
|
+
* `here` when the strand runs here with a manager seat, or hibernates here (the removal wakes it
|
|
86
|
+
* and learns the seat then); `another-party` when it runs here without one, so the new key is
|
|
87
|
+
* seated by the strand's host re-inviting the party, or its manager admitting the key by hand
|
|
88
|
+
* (docs/strands.md → "Replacing the party's key"); `later` when it does not run here.
|
|
89
|
+
*/
|
|
90
|
+
export declare function planStrandKeyRotations(strands: readonly ClosedStrandState[]): StrandKeyRotationPlan[];
|
|
91
|
+
/**
|
|
92
|
+
* One closed strand with a pending party key, as `CadreNode.listPendingPartyKeyRotations` reads
|
|
93
|
+
* it, for {@link pendingRotationWaitingOn}. Both reads are `unknown` when there is no live
|
|
94
|
+
* database to read them from.
|
|
95
|
+
*/
|
|
96
|
+
export interface PendingRotationStrandState extends ClosedStrandState {
|
|
97
|
+
/** Whether the strand is closed with every manager gone for good (`isStrandSealed`). */
|
|
98
|
+
sealed: boolean | 'unknown';
|
|
99
|
+
/** Whether the pending key already holds a `Strand.Member` row (`isStrandMember`). */
|
|
100
|
+
pendingKeySeated: boolean | 'unknown';
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Who can move one pending replacement forward ({@link PendingPartyKeyRotation.waitingOn}). A seated
|
|
104
|
+
* key comes first, sealed strand included: members can still leave a sealed strand, so the driver
|
|
105
|
+
* finishes there, and only admitting a key is what the seal rules out. What is unknown answers
|
|
106
|
+
* `owner-machine`, the one state that sends the app to nobody outside the party.
|
|
107
|
+
*/
|
|
108
|
+
export declare function pendingRotationWaitingOn(strand: PendingRotationStrandState): PendingPartyKeyRotation['waitingOn'];
|
package/dist/machine-removal.js
CHANGED
|
@@ -66,14 +66,55 @@ function describeMemberRow(input, row) {
|
|
|
66
66
|
* or already redeemed by it and still redeemable (a multi-use invitation, or an open
|
|
67
67
|
* invitation inside its lifetime). The schema's rule: keeping a device out is removing
|
|
68
68
|
* its row and withdrawing the invitation.
|
|
69
|
+
*
|
|
70
|
+
* `strands` says where the party's key in each closed strand is replaced
|
|
71
|
+
* ({@link planStrandKeyRotations}); empty when no live row names the machine, since such a
|
|
72
|
+
* removal writes nothing.
|
|
69
73
|
*/
|
|
70
74
|
export function planMachineRemoval(input) {
|
|
75
|
+
const machine = input.machines.find((candidate) => candidate.peerId === input.peerId) ?? null;
|
|
71
76
|
return {
|
|
72
|
-
machine
|
|
77
|
+
machine,
|
|
73
78
|
refusal: refusalFor(input),
|
|
74
79
|
invitations: invitationsOpenTo(input),
|
|
80
|
+
strands: machine === null ? [] : planStrandKeyRotations(input.strands),
|
|
75
81
|
};
|
|
76
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Where each closed strand's party key is replaced ({@link StrandKeyRotationPlan.rotation}):
|
|
85
|
+
* `here` when the strand runs here with a manager seat, or hibernates here (the removal wakes it
|
|
86
|
+
* and learns the seat then); `another-party` when it runs here without one, so the new key is
|
|
87
|
+
* seated by the strand's host re-inviting the party, or its manager admitting the key by hand
|
|
88
|
+
* (docs/strands.md → "Replacing the party's key"); `later` when it does not run here.
|
|
89
|
+
*/
|
|
90
|
+
export function planStrandKeyRotations(strands) {
|
|
91
|
+
return strands.map((strand) => ({ strandId: strand.strandId, rotation: rotationSite(strand) }));
|
|
92
|
+
}
|
|
93
|
+
function rotationSite(strand) {
|
|
94
|
+
switch (strand.runtime) {
|
|
95
|
+
case 'none':
|
|
96
|
+
return 'later';
|
|
97
|
+
case 'hibernating':
|
|
98
|
+
return 'here';
|
|
99
|
+
case 'live':
|
|
100
|
+
return strand.managerSeat === false ? 'another-party' : 'here';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Who can move one pending replacement forward ({@link PendingPartyKeyRotation.waitingOn}). A seated
|
|
105
|
+
* key comes first, sealed strand included: members can still leave a sealed strand, so the driver
|
|
106
|
+
* finishes there, and only admitting a key is what the seal rules out. What is unknown answers
|
|
107
|
+
* `owner-machine`, the one state that sends the app to nobody outside the party.
|
|
108
|
+
*/
|
|
109
|
+
export function pendingRotationWaitingOn(strand) {
|
|
110
|
+
if (strand.runtime !== 'live' || strand.pendingKeySeated !== false) {
|
|
111
|
+
return 'owner-machine';
|
|
112
|
+
}
|
|
113
|
+
if (strand.sealed === true) {
|
|
114
|
+
return 'sealed';
|
|
115
|
+
}
|
|
116
|
+
return strand.managerSeat === false ? 'another-party' : 'owner-machine';
|
|
117
|
+
}
|
|
77
118
|
function refusalFor(input) {
|
|
78
119
|
if (!input.canSign) {
|
|
79
120
|
return 'not-an-owner';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine-removal.js","sourceRoot":"","sources":["../src/machine-removal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"machine-removal.js","sourceRoot":"","sources":["../src/machine-removal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAY7D;;;GAGG;AACH,MAAM,OAAO,0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AAC,CAAC,CAAC;SAC7G,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -347,6 +347,14 @@ export declare class UnauthorizedReservationBudget {
|
|
|
347
347
|
* (connection admitted outright / reservation admitted, see module doc); the
|
|
348
348
|
* base gater's verdict is still honored first.
|
|
349
349
|
*
|
|
350
|
+
* Whatever the verdict, a connection whose transport closed during the decision
|
|
351
|
+
* is denied. libp2p builds the muxer right after this hook, and yamux subscribes
|
|
352
|
+
* to the stream only then, so it misses the `close` event, stays `open`, and is
|
|
353
|
+
* handed the frames the dialer sent before hanging up. Replying to one throws, its
|
|
354
|
+
* abort throws again on the GoAway, and that second throw is an uncaught exception
|
|
355
|
+
* from an event listener. Only a decision spanning a macrotask opens this window,
|
|
356
|
+
* so the strand gate, whose verdict is a synchronous snapshot read, does not.
|
|
357
|
+
*
|
|
350
358
|
* An `'admit-provisionally'` verdict admits the connection and arms a
|
|
351
359
|
* `provisionalDeadlineMs` timer against it. When the timer fires the policy is
|
|
352
360
|
* asked again, and the underlying `MultiaddrConnection` is closed unless it now
|
|
@@ -330,6 +330,14 @@ export class UnauthorizedReservationBudget {
|
|
|
330
330
|
* (connection admitted outright / reservation admitted, see module doc); the
|
|
331
331
|
* base gater's verdict is still honored first.
|
|
332
332
|
*
|
|
333
|
+
* Whatever the verdict, a connection whose transport closed during the decision
|
|
334
|
+
* is denied. libp2p builds the muxer right after this hook, and yamux subscribes
|
|
335
|
+
* to the stream only then, so it misses the `close` event, stays `open`, and is
|
|
336
|
+
* handed the frames the dialer sent before hanging up. Replying to one throws, its
|
|
337
|
+
* abort throws again on the GoAway, and that second throw is an uncaught exception
|
|
338
|
+
* from an event listener. Only a decision spanning a macrotask opens this window,
|
|
339
|
+
* so the strand gate, whose verdict is a synchronous snapshot read, does not.
|
|
340
|
+
*
|
|
333
341
|
* An `'admit-provisionally'` verdict admits the connection and arms a
|
|
334
342
|
* `provisionalDeadlineMs` timer against it. When the timer fires the policy is
|
|
335
343
|
* asked again, and the underlying `MultiaddrConnection` is closed unless it now
|
|
@@ -387,7 +395,11 @@ export function createMembershipConnectionGater(policy, base, decisionTimeoutMs
|
|
|
387
395
|
}
|
|
388
396
|
catch (error) {
|
|
389
397
|
log('admitInbound threw for %s — admitting (fail-open; stream gates decide): %o', remotePeerId, error);
|
|
390
|
-
|
|
398
|
+
verdict = 'admit';
|
|
399
|
+
}
|
|
400
|
+
if (maConn.status !== 'open') {
|
|
401
|
+
log('%s hung up during its admission decision — refusing the closed connection', remotePeerId);
|
|
402
|
+
return true;
|
|
391
403
|
}
|
|
392
404
|
if (verdict === 'admit-provisionally') {
|
|
393
405
|
provisional.arm(remotePeerId, maConn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"membership-connection-gater.js","sourceRoot":"","sources":["../src/membership-connection-gater.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,MAAM,GAAG,GAAG,KAAK,CAAC,+BAA+B,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,sBAAsB,EAAE,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,uK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EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QAC5F,CAAC;IACH,CAAC;CACF"}
|
package/dist/owner-keys.js
CHANGED
|
@@ -38,7 +38,7 @@ const OWNER_KEY_REMOVAL_REFUSAL_REASON = {
|
|
|
38
38
|
'unknown': 'it is not a live owner key here',
|
|
39
39
|
'last-owner': 'it is the only live owner key',
|
|
40
40
|
'self': 'it is the owner key of this node, and an owner key cannot sign its own removal; ask another owner key',
|
|
41
|
-
'alone': 'this node has no connection to the rest of the cadre, and
|
|
41
|
+
'alone': 'this node has no connection to the rest of the cadre, and a device or owner key re-vouched now might not reach the other machines; try again once connected',
|
|
42
42
|
};
|
|
43
43
|
/** An owner key as an approval prompt names it: `"label" (key)`, or the key alone when it has no label. */
|
|
44
44
|
export function namedOwnerKey(key, label) {
|
|
@@ -125,6 +125,7 @@ export function revouchWithinPlan(plan, revouch, selfPeerId) {
|
|
|
125
125
|
const peers = [...new Set(revouch?.peers ?? [])];
|
|
126
126
|
const strayOwners = owners.filter((key) => !plan.dependents.owners.includes(key));
|
|
127
127
|
const strayPeers = peers.filter((peerId) => !plan.dependents.peers.includes(peerId));
|
|
128
|
+
// NOTE: a row that moved off the key between the app's plan and this check (another owner's re-vouch, or the first-growth sweep re-signing a row with no `Sig` once the node reconnects) throws this plain error, and the apps' next Remove re-reads the plan. If users report the wording, give it a refusal code.
|
|
128
129
|
if (strayOwners.length > 0 || strayPeers.length > 0) {
|
|
129
130
|
throw new Error(`removeOwner: re-vouch names rows the removed owner key did not vouch: ${[...strayOwners, ...strayPeers].join(', ')}`);
|
|
130
131
|
}
|
package/dist/owner-keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owner-keys.js","sourceRoot":"","sources":["../src/owner-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAIjD,YAAY,GAAW,EAAE,IAAwB;QAChD,KAAK,CAA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UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAClF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,oTAAoT;IACpT,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACd,yEAAyE,CAAC,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACrH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,IAAI,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AACxG,CAAC"}
|
package/dist/owner-signer.js
CHANGED
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
* Imports only `@optimystic/quereus-plugin-crypto` and `uint8arrays`, so it loads on React
|
|
10
10
|
* Native and in the browser.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
import { sign } from '@optimystic/quereus-plugin-crypto';
|
|
14
|
-
import { ed25519PublicKeyFromPrivate, requireEd25519PrivateKeyB64 } from './ed25519-key.js';
|
|
12
|
+
import { ed25519MessageSigner, ed25519PublicKeyFromPrivate, requireEd25519PrivateKeyB64 } from './ed25519-key.js';
|
|
15
13
|
/**
|
|
16
14
|
* Run `body` inside the caller's open approval when it passes `sign`, else inside one new
|
|
17
15
|
* approval of `signer` for `request`. An owner write that is sometimes a whole action and
|
|
@@ -40,7 +38,8 @@ export class OwnerSigningDeclinedError extends Error {
|
|
|
40
38
|
*/
|
|
41
39
|
export function softwareOwnerSigner(privateKeyB64) {
|
|
42
40
|
const privateKey = requireEd25519PrivateKeyB64(privateKeyB64, 'owner private key');
|
|
43
|
-
const
|
|
41
|
+
const signBytes = ed25519MessageSigner(privateKey);
|
|
42
|
+
const signMessage = async (message) => signBytes(message);
|
|
44
43
|
return {
|
|
45
44
|
publicKey: ed25519PublicKeyFromPrivate(privateKey),
|
|
46
45
|
async approve(_request, body) {
|