@serfab/cadre-core 0.8.1 → 0.9.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.
Files changed (93) hide show
  1. package/README.md +2 -2
  2. package/dist/cadre-node.d.ts +101 -61
  3. package/dist/cadre-node.js +165 -124
  4. package/dist/cadre-node.js.map +1 -1
  5. package/dist/control-cohort.d.ts +15 -15
  6. package/dist/control-cohort.js +14 -14
  7. package/dist/control-cohort.js.map +1 -1
  8. package/dist/control-database.d.ts +51 -34
  9. package/dist/control-database.js +72 -56
  10. package/dist/control-database.js.map +1 -1
  11. package/dist/control-formation-recorder.d.ts +2 -2
  12. package/dist/control-formation-recorder.js +2 -2
  13. package/dist/control-schema.d.ts +1 -1
  14. package/dist/control-schema.js +57 -33
  15. package/dist/control-schema.js.map +1 -1
  16. package/dist/device-token.d.ts +1 -1
  17. package/dist/device-token.js +1 -1
  18. package/dist/{authority-key.d.ts → ed25519-key.d.ts} +11 -10
  19. package/dist/{authority-key.js → ed25519-key.js} +9 -10
  20. package/dist/ed25519-key.js.map +1 -0
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +8 -8
  23. package/dist/index.js.map +1 -1
  24. package/dist/key-store.d.ts +1 -1
  25. package/dist/key-store.js +1 -1
  26. package/dist/peer-authorization.d.ts +28 -6
  27. package/dist/peer-authorization.js +33 -7
  28. package/dist/peer-authorization.js.map +1 -1
  29. package/dist/peer-record.d.ts +3 -3
  30. package/dist/peer-record.js +3 -3
  31. package/dist/push-node.d.ts +38 -0
  32. package/dist/push-node.js +48 -0
  33. package/dist/push-node.js.map +1 -0
  34. package/dist/push-notifier-apns.d.ts +10 -2
  35. package/dist/push-notifier-apns.js +14 -10
  36. package/dist/push-notifier-apns.js.map +1 -1
  37. package/dist/push-notifier-fcm.d.ts +7 -1
  38. package/dist/push-notifier-fcm.js +9 -10
  39. package/dist/push-notifier-fcm.js.map +1 -1
  40. package/dist/push-notifier.d.ts +16 -35
  41. package/dist/push-notifier.js +16 -44
  42. package/dist/push-notifier.js.map +1 -1
  43. package/dist/seed-bootstrap.d.ts +70 -51
  44. package/dist/seed-bootstrap.js +168 -106
  45. package/dist/seed-bootstrap.js.map +1 -1
  46. package/dist/seed-trust-policy.d.ts +11 -11
  47. package/dist/seed-trust-policy.js +11 -11
  48. package/dist/seed-trust-policy.js.map +1 -1
  49. package/dist/strand-database.d.ts +5 -5
  50. package/dist/strand-database.js +4 -4
  51. package/dist/strand-database.js.map +1 -1
  52. package/dist/strand-formation-protocol.d.ts +1 -1
  53. package/dist/strand-formation-protocol.js +1 -1
  54. package/dist/strand-instance-manager.d.ts +1 -1
  55. package/dist/strand-instance-manager.js +1 -1
  56. package/dist/strand-instance-manager.js.map +1 -1
  57. package/dist/strand-member-key.d.ts +6 -6
  58. package/dist/strand-member-key.js +6 -6
  59. package/dist/strand-member-key.js.map +1 -1
  60. package/dist/strand-member-registry.d.ts +7 -7
  61. package/dist/strand-member-registry.js +5 -5
  62. package/dist/strand-member-registry.js.map +1 -1
  63. package/dist/strand-membership-writer.d.ts +84 -84
  64. package/dist/strand-membership-writer.js +90 -90
  65. package/dist/strand-membership-writer.js.map +1 -1
  66. package/dist/types.d.ts +52 -32
  67. package/dist/types.js.map +1 -1
  68. package/package.json +7 -3
  69. package/src/cadre-node.ts +170 -126
  70. package/src/control-cohort.ts +17 -17
  71. package/src/control-database.ts +76 -59
  72. package/src/control-formation-recorder.ts +2 -2
  73. package/src/control-schema.ts +57 -33
  74. package/src/device-token.ts +1 -1
  75. package/src/{authority-key.ts → ed25519-key.ts} +12 -11
  76. package/src/index.ts +21 -19
  77. package/src/key-store.ts +1 -1
  78. package/src/peer-authorization.ts +35 -7
  79. package/src/peer-record.ts +3 -3
  80. package/src/push-node.ts +64 -0
  81. package/src/push-notifier-apns.ts +16 -12
  82. package/src/push-notifier-fcm.ts +9 -10
  83. package/src/push-notifier.ts +16 -57
  84. package/src/seed-bootstrap.ts +179 -115
  85. package/src/seed-trust-policy.ts +18 -18
  86. package/src/strand-database.ts +6 -6
  87. package/src/strand-formation-protocol.ts +1 -1
  88. package/src/strand-instance-manager.ts +2 -2
  89. package/src/strand-member-key.ts +7 -7
  90. package/src/strand-member-registry.ts +10 -10
  91. package/src/strand-membership-writer.ts +127 -127
  92. package/src/types.ts +52 -32
  93. package/dist/authority-key.js.map +0 -1
@@ -3,7 +3,14 @@ import type { Libp2p } from '@libp2p/interface';
3
3
  import type { IRepo } from '@optimystic/db-core';
4
4
  import type { StrandRow, PeerAddressRecord, DeviceTokenRecord } from './types.js';
5
5
  /**
6
- * Build the canonical authorization message that authority signatures are bound to.
6
+ * Generate a unique stamp ID for transaction authorization.
7
+ * Format: 32 bytes base64url encoded
8
+ * - First 16 bytes: SHA-256 hash of peer ID (for distributed uniqueness)
9
+ * - Last 16 bytes: Random bytes (for collision resistance)
10
+ */
11
+ export declare function generateStampId(peerId: string): string;
12
+ /**
13
+ * Build the canonical authorization message that owner signatures are bound to.
7
14
  *
8
15
  * The message is a SINGLE framed SHA-256 digest over the ordered tuple of fields (the
9
16
  * crypto plugin's injective multi-field encoding), in a fixed field order, with the
@@ -30,7 +37,7 @@ export declare function buildAuthorizationMessage(fields: string[]): Uint8Array;
30
37
  * SQL-injection surface and hands callers (e.g. the integration harness's
31
38
  * `waitForControlSync`) a typo-proof table argument.
32
39
  */
33
- export type ControlTable = 'AuthorityKey' | 'ValidationKey' | 'Strand' | 'CadrePeer' | 'DeviceToken' | 'FormationInvite' | 'FormationUsage';
40
+ export type ControlTable = 'OwnerKey' | 'ValidationKey' | 'Strand' | 'CadrePeer' | 'DeviceToken' | 'FormationInvite' | 'FormationUsage';
34
41
  export interface ControlDatabaseConfig {
35
42
  /** Party ID for the control network */
36
43
  partyId: string;
@@ -78,7 +85,7 @@ export declare class ControlDatabase {
78
85
  * into the `from` clause: the names are not user input, but the check keeps the
79
86
  * dynamic query off the injection surface and fails loudly on a typo instead of
80
87
  * emitting a malformed statement. The count reflects only the rows this node's
81
- * control DB has converged on — in the integration harness that is the authority
88
+ * control DB has converged on — in the integration harness that is the owner
82
89
  * node (one ControlDatabase per party), i.e. the authoritative control-network
83
90
  * view, not a per-drone convergence guarantee.
84
91
  */
@@ -88,32 +95,42 @@ export declare class ControlDatabase {
88
95
  */
89
96
  getDatabase(): Database;
90
97
  /**
91
- * Check whether any authority key exists in the control database.
98
+ * Check whether any owner key exists in the control database.
92
99
  * Used to decide whether a fresh-party genesis insert is required.
93
100
  */
94
- hasAuthorityKey(): Promise<boolean>;
101
+ hasOwnerKey(): Promise<boolean>;
95
102
  /**
96
- * Idempotent genesis: insert `key` as the founding authority key only when
97
- * the party has none yet. Returns true if it inserted, false if an authority
98
- * key already existed (so a repeat `--authority` start is a no-op).
103
+ * Idempotent genesis: insert `key` as the founding owner key only when
104
+ * the party has none yet. Returns true if it inserted, false if an owner
105
+ * key already existed (so a repeat `--owner` start is a no-op).
99
106
  */
100
- ensureAuthorityKey(key: string): Promise<boolean>;
107
+ ensureOwnerKey(key: string): Promise<boolean>;
101
108
  /**
102
- * Collect every authority key (`CadreControl.AuthorityKey.Key`) as a set.
109
+ * Collect every owner key (`CadreControl.OwnerKey.Key`) as a set.
103
110
  *
104
111
  * This is the steady-state trust anchor for seeds: a seed's signer key is
105
112
  * trusted only if it is already enrolled here (see `SeedTrustPolicy`). It is
106
- * also the authority-identity source for `queryPeers`, decoupling authority
113
+ * also the owner-identity source for `queryPeers`, decoupling owner
107
114
  * status from the libp2p transport peer ID.
108
115
  */
109
- getAuthorityKeys(): Promise<Set<string>>;
116
+ getOwnerKeys(): Promise<Set<string>>;
110
117
  /**
111
118
  * Enumerate the CadrePeer rows (cadre membership) for admin/membership reads.
112
119
  */
113
120
  queryCadrePeers(): Promise<Array<{
114
121
  peerId: string;
115
122
  multiaddr: string | null;
123
+ stampId: string | null;
124
+ vouchOwner: string | null;
125
+ vouchSig: string | null;
116
126
  }>>;
127
+ /**
128
+ * Read a single `CadrePeer` row's single-use `StampId` nonce (null when the row
129
+ * does not exist). Used by the owner delete / re-touch paths, which must bind
130
+ * their signature to the row's CURRENT nonce ({@link cadrePeerRemoveDigest} /
131
+ * {@link cadrePeerVoucherDigest}).
132
+ */
133
+ queryCadrePeerStampId(peerId: string): Promise<string | null>;
117
134
  /**
118
135
  * Read a single peer's address record (the full `CadrePeer` row) by PeerId.
119
136
  *
@@ -130,8 +147,8 @@ export declare class ControlDatabase {
130
147
  *
131
148
  * Authorization is carried entirely by the record: the `Sig` column (verified
132
149
  * by the `AuthorizedUpdate` self-branch against the stored `PublicKey`) plus
133
- * the strictly-increasing `UpdatedAt`. No authority key is involved, so this
134
- * is the refresh path for any member — authority or drone — once its row
150
+ * the strictly-increasing `UpdatedAt`. No owner key is involved, so this
151
+ * is the refresh path for any member — owner or drone — once its row
135
152
  * exists. `PublicKey` is intentionally not in the SET list (it is immutable on
136
153
  * self-update and the constraint enforces `new.PublicKey = old.PublicKey`).
137
154
  */
@@ -151,7 +168,7 @@ export declare class ControlDatabase {
151
168
  *
152
169
  * Authorization is carried entirely by the record: the `Sig` column (verified by
153
170
  * the `DeviceToken.AuthorizedUpdate` self-branch against the stored
154
- * `CadrePeer.PublicKey`) plus the strictly-increasing `UpdatedAt`. No authority key
171
+ * `CadrePeer.PublicKey`) plus the strictly-increasing `UpdatedAt`. No owner key
155
172
  * is involved, so this is the refresh / rotation path for any member once both its
156
173
  * `CadrePeer` row (for the PublicKey) and its `DeviceToken` row exist. `PeerId` is
157
174
  * intentionally not in the SET list (immutable; the constraint enforces
@@ -159,48 +176,48 @@ export declare class ControlDatabase {
159
176
  */
160
177
  updateSelfDeviceToken(record: DeviceTokenRecord): Promise<void>;
161
178
  /**
162
- * Insert the initial authority key (bootstrap - no existing authorities required)
179
+ * Insert the initial owner key (bootstrap - no existing owners required)
163
180
  */
164
- insertAuthorityKey(key: string): Promise<void>;
181
+ insertOwnerKey(key: string): Promise<void>;
165
182
  /**
166
- * Insert a strand into the control database using an authority signature.
183
+ * Insert a strand into the control database using an owner signature.
167
184
  *
168
- * The authority signs the canonical row-bound authorization message (see
185
+ * The owner signs the canonical row-bound authorization message (see
169
186
  * {@link buildAuthorizationMessage}) — NOT a bare stamp — so the signature is bound to
170
187
  * this strand's contents and cannot be transplanted onto an attacker-chosen row. The
171
188
  * StampId is persisted as a unique column for single-use anti-replay.
172
189
  *
173
190
  * @param strandId - Unique identifier for the strand
174
191
  * @param type - Strand type: 'o' for open, 'c' for closed
175
- * @param authorityKey - Public key of the authorizing authority
192
+ * @param ownerKey - Public key of the authorizing owner
176
193
  * @param signMessage - Function that ed25519-signs the raw message bytes (no pre-hash)
177
- * with the authority's private key, returning a base64url signature
194
+ * with the owner's private key, returning a base64url signature
178
195
  * @param memberPrivateKey - Optional private key for membership in closed strands
179
196
  */
180
- insertStrand(strandId: string, type: 'o' | 'c', authorityKey: string, signMessage: (message: Uint8Array) => string, memberPrivateKey?: string): Promise<void>;
197
+ insertStrand(strandId: string, type: 'o' | 'c', ownerKey: string, signMessage: (message: Uint8Array) => string, memberPrivateKey?: string): Promise<void>;
181
198
  /**
182
- * Insert a validation key into the control database using an authority signature.
199
+ * Insert a validation key into the control database using an owner signature.
183
200
  *
184
- * Mirrors {@link insertStrand}: the authority signs the canonical row-bound
201
+ * Mirrors {@link insertStrand}: the owner signs the canonical row-bound
185
202
  * authorization message over (Key, StampId), and the StampId is persisted as a unique
186
203
  * column for single-use anti-replay. A `ValidationKey` authorizes verifying strand
187
204
  * formation disclosures.
188
205
  *
189
206
  * @param key - The validation public key to enroll
190
- * @param authorityKey - Public key of the authorizing authority
207
+ * @param ownerKey - Public key of the authorizing owner
191
208
  * @param signMessage - Function that ed25519-signs the raw message bytes (no pre-hash)
192
- * with the authority's private key, returning a base64url signature
209
+ * with the owner's private key, returning a base64url signature
193
210
  */
194
- insertValidationKey(key: string, authorityKey: string, signMessage: (message: Uint8Array) => string): Promise<void>;
211
+ insertValidationKey(key: string, ownerKey: string, signMessage: (message: Uint8Array) => string): Promise<void>;
195
212
  /**
196
- * Insert an authority-signed `FormationInvite` (open invitation token).
213
+ * Insert an owner-signed `FormationInvite` (open invitation token).
197
214
  *
198
215
  * The invite is the on-network record that later authorizes an
199
- * authority-signature-FREE `Strand` creation: an invited cadre peer redeems it
216
+ * owner-signature-FREE `Strand` creation: an invited cadre peer redeems it
200
217
  * by inserting a matching `FormationUsage` row (see {@link redeemInvitation}),
201
218
  * which satisfies the consent branch of `Strand.Authorized`.
202
219
  *
203
- * Like {@link insertStrand}/{@link insertValidationKey}, the authority signs the
220
+ * Like {@link insertStrand}/{@link insertValidationKey}, the owner signs the
204
221
  * canonical row-bound authorization message (see {@link buildAuthorizationMessage})
205
222
  * over (Token, sAppId, ExpiresAt, TotalUses, ValidationUrl, StrandId, StampId) — NOT a
206
223
  * bare stamp — so the signature is bound to this invite's contents and cannot be
@@ -225,13 +242,13 @@ export declare class ControlDatabase {
225
242
  *
226
243
  * @param token - Invitation token (the `FormationInvite` primary key)
227
244
  * @param sAppId - The sApp a redeemed strand will use
228
- * @param authorityKey - Public key of the authorizing authority
245
+ * @param ownerKey - Public key of the authorizing owner
229
246
  * @param signMessage - ed25519-signs the raw message bytes (no pre-hash),
230
247
  * returning a base64url signature — the same callback shape {@link insertStrand} uses
231
248
  * @param options - Optional `expiresAtMs` (epoch ms), `totalUses`, `validationUrl`,
232
249
  * `strandId` (bind to a pre-existing host strand for provision-then-record)
233
250
  */
234
- insertFormationInvite(token: string, sAppId: string, authorityKey: string, signMessage: (message: Uint8Array) => string, options?: {
251
+ insertFormationInvite(token: string, sAppId: string, ownerKey: string, signMessage: (message: Uint8Array) => string, options?: {
235
252
  expiresAtMs?: number;
236
253
  totalUses?: number;
237
254
  validationUrl?: string;
@@ -246,7 +263,7 @@ export declare class ControlDatabase {
246
263
  * `FormationUsage.StrandExists` requires the `Strand` row. Both CHECKs contain
247
264
  * subqueries, so Quereus auto-defers them to transaction commit — wrapping both
248
265
  * inserts in a single explicit `begin … commit` lets both deferred CHECKs see
249
- * both rows at commit. The strand is authorised WITHOUT an authority signature
266
+ * both rows at commit. The strand is authorised WITHOUT an owner signature
250
267
  * (the `FormationUsage` branch of `Strand.Authorized`) but still gets a fresh,
251
268
  * unique `StampId` column to satisfy the not-null/unique anti-replay column.
252
269
  *
@@ -269,7 +286,7 @@ export declare class ControlDatabase {
269
286
  /**
270
287
  * Record a `FormationUsage` against an **already-existing** `Strand` (no strand
271
288
  * insert). This is the redemption path when the strand was provisioned
272
- * separately (e.g. authority-signed) and the consent record is added after the
289
+ * separately (e.g. owner-signed) and the consent record is added after the
273
290
  * fact: the single insert auto-commits, and the deferred `StrandExists` CHECK
274
291
  * is satisfied by the pre-existing committed strand row. Returns the assigned
275
292
  * `UseNumber`.
@@ -14,7 +14,7 @@ const timing = debug('sereus:cadre:timing');
14
14
  * - First 16 bytes: SHA-256 hash of peer ID (for distributed uniqueness)
15
15
  * - Last 16 bytes: Random bytes (for collision resistance)
16
16
  */
17
- function generateStampId(peerId) {
17
+ export function generateStampId(peerId) {
18
18
  // Hash the peer ID and get first 16 bytes (128 bits). A purely local ID
19
19
  // generator: never signed/verified against SQL, so the framed single-field
20
20
  // digest is fine (the changed framing is not cross-checked anywhere).
@@ -44,7 +44,7 @@ function parseStoredDatetimeMs(value) {
44
44
  return new Date(hasZone ? value : `${value}Z`).getTime();
45
45
  }
46
46
  /**
47
- * Build the canonical authorization message that authority signatures are bound to.
47
+ * Build the canonical authorization message that owner signatures are bound to.
48
48
  *
49
49
  * The message is a SINGLE framed SHA-256 digest over the ordered tuple of fields (the
50
50
  * crypto plugin's injective multi-field encoding), in a fixed field order, with the
@@ -69,7 +69,7 @@ export function buildAuthorizationMessage(fields) {
69
69
  }
70
70
  /** Runtime guard mirroring {@link ControlTable} for the dynamic-`from` count. */
71
71
  const CONTROL_TABLES = new Set([
72
- 'AuthorityKey',
72
+ 'OwnerKey',
73
73
  'ValidationKey',
74
74
  'Strand',
75
75
  'CadrePeer',
@@ -230,7 +230,7 @@ export class ControlDatabase {
230
230
  * into the `from` clause: the names are not user input, but the check keeps the
231
231
  * dynamic query off the injection surface and fails loudly on a typo instead of
232
232
  * emitting a malformed statement. The count reflects only the rows this node's
233
- * control DB has converged on — in the integration harness that is the authority
233
+ * control DB has converged on — in the integration harness that is the owner
234
234
  * node (one ControlDatabase per party), i.e. the authoritative control-network
235
235
  * view, not a per-drone convergence guarantee.
236
236
  */
@@ -252,42 +252,42 @@ export class ControlDatabase {
252
252
  return this.db;
253
253
  }
254
254
  /**
255
- * Check whether any authority key exists in the control database.
255
+ * Check whether any owner key exists in the control database.
256
256
  * Used to decide whether a fresh-party genesis insert is required.
257
257
  */
258
- async hasAuthorityKey() {
258
+ async hasOwnerKey() {
259
259
  this.ensureInitialized();
260
- for await (const row of this.db.eval('select count(1) as Count from CadreControl.AuthorityKey')) {
260
+ for await (const row of this.db.eval('select count(1) as Count from CadreControl.OwnerKey')) {
261
261
  return row.Count > 0;
262
262
  }
263
263
  return false;
264
264
  }
265
265
  /**
266
- * Idempotent genesis: insert `key` as the founding authority key only when
267
- * the party has none yet. Returns true if it inserted, false if an authority
268
- * key already existed (so a repeat `--authority` start is a no-op).
266
+ * Idempotent genesis: insert `key` as the founding owner key only when
267
+ * the party has none yet. Returns true if it inserted, false if an owner
268
+ * key already existed (so a repeat `--owner` start is a no-op).
269
269
  */
270
- async ensureAuthorityKey(key) {
270
+ async ensureOwnerKey(key) {
271
271
  this.ensureInitialized();
272
- if (await this.hasAuthorityKey()) {
273
- log('Authority key already present; skipping genesis insert');
272
+ if (await this.hasOwnerKey()) {
273
+ log('Owner key already present; skipping genesis insert');
274
274
  return false;
275
275
  }
276
- await this.insertAuthorityKey(key);
276
+ await this.insertOwnerKey(key);
277
277
  return true;
278
278
  }
279
279
  /**
280
- * Collect every authority key (`CadreControl.AuthorityKey.Key`) as a set.
280
+ * Collect every owner key (`CadreControl.OwnerKey.Key`) as a set.
281
281
  *
282
282
  * This is the steady-state trust anchor for seeds: a seed's signer key is
283
283
  * trusted only if it is already enrolled here (see `SeedTrustPolicy`). It is
284
- * also the authority-identity source for `queryPeers`, decoupling authority
284
+ * also the owner-identity source for `queryPeers`, decoupling owner
285
285
  * status from the libp2p transport peer ID.
286
286
  */
287
- async getAuthorityKeys() {
287
+ async getOwnerKeys() {
288
288
  this.ensureInitialized();
289
289
  const keys = new Set();
290
- for await (const row of this.db.eval('select Key from CadreControl.AuthorityKey')) {
290
+ for await (const row of this.db.eval('select Key from CadreControl.OwnerKey')) {
291
291
  keys.add(row.Key);
292
292
  }
293
293
  return keys;
@@ -298,14 +298,30 @@ export class ControlDatabase {
298
298
  async queryCadrePeers() {
299
299
  this.ensureInitialized();
300
300
  const rows = [];
301
- for await (const row of this.db.eval('select PeerId, Multiaddr from CadreControl.CadrePeer')) {
301
+ for await (const row of this.db.eval('select PeerId, Multiaddr, StampId, VouchOwner, VouchSig from CadreControl.CadrePeer')) {
302
302
  rows.push({
303
303
  peerId: row.PeerId,
304
304
  multiaddr: row.Multiaddr ?? null,
305
+ stampId: row.StampId ?? null,
306
+ vouchOwner: row.VouchOwner ?? null,
307
+ vouchSig: row.VouchSig ?? null,
305
308
  });
306
309
  }
307
310
  return rows;
308
311
  }
312
+ /**
313
+ * Read a single `CadrePeer` row's single-use `StampId` nonce (null when the row
314
+ * does not exist). Used by the owner delete / re-touch paths, which must bind
315
+ * their signature to the row's CURRENT nonce ({@link cadrePeerRemoveDigest} /
316
+ * {@link cadrePeerVoucherDigest}).
317
+ */
318
+ async queryCadrePeerStampId(peerId) {
319
+ this.ensureInitialized();
320
+ for await (const row of this.db.eval('select StampId from CadreControl.CadrePeer where PeerId = ?', [peerId])) {
321
+ return row.StampId ?? null;
322
+ }
323
+ return null;
324
+ }
309
325
  /**
310
326
  * Read a single peer's address record (the full `CadrePeer` row) by PeerId.
311
327
  *
@@ -335,8 +351,8 @@ export class ControlDatabase {
335
351
  *
336
352
  * Authorization is carried entirely by the record: the `Sig` column (verified
337
353
  * by the `AuthorizedUpdate` self-branch against the stored `PublicKey`) plus
338
- * the strictly-increasing `UpdatedAt`. No authority key is involved, so this
339
- * is the refresh path for any member — authority or drone — once its row
354
+ * the strictly-increasing `UpdatedAt`. No owner key is involved, so this
355
+ * is the refresh path for any member — owner or drone — once its row
340
356
  * exists. `PublicKey` is intentionally not in the SET list (it is immutable on
341
357
  * self-update and the constraint enforces `new.PublicKey = old.PublicKey`).
342
358
  */
@@ -345,7 +361,7 @@ export class ControlDatabase {
345
361
  const multiaddr = record.addrs.join(',');
346
362
  await this.db.exec(`
347
363
  update CadreControl.CadrePeer
348
- with context AuthorityKey = null, Signature = ?
364
+ with context OwnerKey = null, Signature = ?
349
365
  set Multiaddr = ?, UpdatedAt = ?, Sig = ?
350
366
  where PeerId = ?
351
367
  `, [record.sig, multiaddr, record.updatedAt, record.sig, record.peerId]);
@@ -378,7 +394,7 @@ export class ControlDatabase {
378
394
  *
379
395
  * Authorization is carried entirely by the record: the `Sig` column (verified by
380
396
  * the `DeviceToken.AuthorizedUpdate` self-branch against the stored
381
- * `CadrePeer.PublicKey`) plus the strictly-increasing `UpdatedAt`. No authority key
397
+ * `CadrePeer.PublicKey`) plus the strictly-increasing `UpdatedAt`. No owner key
382
398
  * is involved, so this is the refresh / rotation path for any member once both its
383
399
  * `CadrePeer` row (for the PublicKey) and its `DeviceToken` row exist. `PeerId` is
384
400
  * intentionally not in the SET list (immutable; the constraint enforces
@@ -388,46 +404,46 @@ export class ControlDatabase {
388
404
  this.ensureInitialized();
389
405
  await this.db.exec(`
390
406
  update CadreControl.DeviceToken
391
- with context AuthorityKey = null, Signature = ?
407
+ with context OwnerKey = null, Signature = ?
392
408
  set Platform = ?, Token = ?, UpdatedAt = ?, Sig = ?
393
409
  where PeerId = ?
394
410
  `, [record.sig, record.platform, record.token, record.updatedAt, record.sig, record.peerId]);
395
411
  log('Self device token updated: %s (platform=%s, updatedAt=%d)', record.peerId, record.platform, record.updatedAt);
396
412
  }
397
413
  /**
398
- * Insert the initial authority key (bootstrap - no existing authorities required)
414
+ * Insert the initial owner key (bootstrap - no existing owners required)
399
415
  */
400
- async insertAuthorityKey(key) {
416
+ async insertOwnerKey(key) {
401
417
  this.ensureInitialized();
402
- log('Inserting authority key: %s', key);
403
- // Bootstrap is authorized by the schema's `(select count(1) from AuthorityKey) <= 1`
418
+ log('Inserting owner key: %s', key);
419
+ // Bootstrap is authorized by the schema's `(select count(1) from OwnerKey) <= 1`
404
420
  // branch, so no signature is needed. We still persist a fresh, unique StampId in the
405
421
  // row's own column to satisfy the not-null/unique anti-replay constraint — the StampId
406
422
  // is now a real column value, not the optimystic `StampId()` SQL function.
407
423
  const stampId = generateStampId(this.config.libp2pNode.peerId.toString());
408
424
  await this.db.exec(`
409
- insert into CadreControl.AuthorityKey (Key, StampId)
410
- with context AuthorityKey = null, Signature = null
425
+ insert into CadreControl.OwnerKey (Key, StampId)
426
+ with context OwnerKey = null, Signature = null
411
427
  values (?, ?)
412
428
  `, [key, stampId]);
413
- log('Authority key inserted');
429
+ log('Owner key inserted');
414
430
  }
415
431
  /**
416
- * Insert a strand into the control database using an authority signature.
432
+ * Insert a strand into the control database using an owner signature.
417
433
  *
418
- * The authority signs the canonical row-bound authorization message (see
434
+ * The owner signs the canonical row-bound authorization message (see
419
435
  * {@link buildAuthorizationMessage}) — NOT a bare stamp — so the signature is bound to
420
436
  * this strand's contents and cannot be transplanted onto an attacker-chosen row. The
421
437
  * StampId is persisted as a unique column for single-use anti-replay.
422
438
  *
423
439
  * @param strandId - Unique identifier for the strand
424
440
  * @param type - Strand type: 'o' for open, 'c' for closed
425
- * @param authorityKey - Public key of the authorizing authority
441
+ * @param ownerKey - Public key of the authorizing owner
426
442
  * @param signMessage - Function that ed25519-signs the raw message bytes (no pre-hash)
427
- * with the authority's private key, returning a base64url signature
443
+ * with the owner's private key, returning a base64url signature
428
444
  * @param memberPrivateKey - Optional private key for membership in closed strands
429
445
  */
430
- async insertStrand(strandId, type, authorityKey, signMessage, memberPrivateKey) {
446
+ async insertStrand(strandId, type, ownerKey, signMessage, memberPrivateKey) {
431
447
  this.ensureInitialized();
432
448
  log('Inserting strand: %s (type: %s)', strandId, type);
433
449
  // Generate a unique stamp ID using the peer ID for distributed uniqueness
@@ -440,25 +456,25 @@ export class ControlDatabase {
440
456
  // StampId is a real, unique column (single-use anti-replay), no longer a context value.
441
457
  await this.db.exec(`
442
458
  insert into CadreControl.Strand (Id, Type, MemberPrivateKey, StampId)
443
- with context AuthorityKey = ?, Signature = ?
459
+ with context OwnerKey = ?, Signature = ?
444
460
  values (?, ?, ?, ?)
445
- `, [authorityKey, signature, strandId, type, memberPrivateKey ?? null, stampId]);
461
+ `, [ownerKey, signature, strandId, type, memberPrivateKey ?? null, stampId]);
446
462
  log('Strand inserted: %s', strandId);
447
463
  }
448
464
  /**
449
- * Insert a validation key into the control database using an authority signature.
465
+ * Insert a validation key into the control database using an owner signature.
450
466
  *
451
- * Mirrors {@link insertStrand}: the authority signs the canonical row-bound
467
+ * Mirrors {@link insertStrand}: the owner signs the canonical row-bound
452
468
  * authorization message over (Key, StampId), and the StampId is persisted as a unique
453
469
  * column for single-use anti-replay. A `ValidationKey` authorizes verifying strand
454
470
  * formation disclosures.
455
471
  *
456
472
  * @param key - The validation public key to enroll
457
- * @param authorityKey - Public key of the authorizing authority
473
+ * @param ownerKey - Public key of the authorizing owner
458
474
  * @param signMessage - Function that ed25519-signs the raw message bytes (no pre-hash)
459
- * with the authority's private key, returning a base64url signature
475
+ * with the owner's private key, returning a base64url signature
460
476
  */
461
- async insertValidationKey(key, authorityKey, signMessage) {
477
+ async insertValidationKey(key, ownerKey, signMessage) {
462
478
  this.ensureInitialized();
463
479
  log('Inserting validation key: %s', key);
464
480
  const peerId = this.config.libp2pNode.peerId.toString();
@@ -468,20 +484,20 @@ export class ControlDatabase {
468
484
  const signature = signMessage(message);
469
485
  await this.db.exec(`
470
486
  insert into CadreControl.ValidationKey (Key, StampId)
471
- with context AuthorityKey = ?, Signature = ?
487
+ with context OwnerKey = ?, Signature = ?
472
488
  values (?, ?)
473
- `, [authorityKey, signature, key, stampId]);
489
+ `, [ownerKey, signature, key, stampId]);
474
490
  log('Validation key inserted: %s', key);
475
491
  }
476
492
  /**
477
- * Insert an authority-signed `FormationInvite` (open invitation token).
493
+ * Insert an owner-signed `FormationInvite` (open invitation token).
478
494
  *
479
495
  * The invite is the on-network record that later authorizes an
480
- * authority-signature-FREE `Strand` creation: an invited cadre peer redeems it
496
+ * owner-signature-FREE `Strand` creation: an invited cadre peer redeems it
481
497
  * by inserting a matching `FormationUsage` row (see {@link redeemInvitation}),
482
498
  * which satisfies the consent branch of `Strand.Authorized`.
483
499
  *
484
- * Like {@link insertStrand}/{@link insertValidationKey}, the authority signs the
500
+ * Like {@link insertStrand}/{@link insertValidationKey}, the owner signs the
485
501
  * canonical row-bound authorization message (see {@link buildAuthorizationMessage})
486
502
  * over (Token, sAppId, ExpiresAt, TotalUses, ValidationUrl, StrandId, StampId) — NOT a
487
503
  * bare stamp — so the signature is bound to this invite's contents and cannot be
@@ -506,13 +522,13 @@ export class ControlDatabase {
506
522
  *
507
523
  * @param token - Invitation token (the `FormationInvite` primary key)
508
524
  * @param sAppId - The sApp a redeemed strand will use
509
- * @param authorityKey - Public key of the authorizing authority
525
+ * @param ownerKey - Public key of the authorizing owner
510
526
  * @param signMessage - ed25519-signs the raw message bytes (no pre-hash),
511
527
  * returning a base64url signature — the same callback shape {@link insertStrand} uses
512
528
  * @param options - Optional `expiresAtMs` (epoch ms), `totalUses`, `validationUrl`,
513
529
  * `strandId` (bind to a pre-existing host strand for provision-then-record)
514
530
  */
515
- async insertFormationInvite(token, sAppId, authorityKey, signMessage, options = {}) {
531
+ async insertFormationInvite(token, sAppId, ownerKey, signMessage, options = {}) {
516
532
  this.ensureInitialized();
517
533
  log('Inserting formation invite: %s', token);
518
534
  const stampId = generateStampId(this.config.libp2pNode.peerId.toString());
@@ -540,10 +556,10 @@ export class ControlDatabase {
540
556
  // unique column (single-use anti-replay), no longer a context value.
541
557
  await this.db.exec(`
542
558
  insert into CadreControl.FormationInvite (Token, sAppId, ExpiresAt, TotalUses, ValidationUrl, StrandId, StampId)
543
- with context AuthorityKey = ?, Signature = ?
559
+ with context OwnerKey = ?, Signature = ?
544
560
  values (?, ?, ?, ?, ?, ?, ?)
545
561
  `, [
546
- authorityKey, signature,
562
+ ownerKey, signature,
547
563
  token, sAppId,
548
564
  expiresAtCanonical,
549
565
  options.totalUses ?? null,
@@ -562,7 +578,7 @@ export class ControlDatabase {
562
578
  * `FormationUsage.StrandExists` requires the `Strand` row. Both CHECKs contain
563
579
  * subqueries, so Quereus auto-defers them to transaction commit — wrapping both
564
580
  * inserts in a single explicit `begin … commit` lets both deferred CHECKs see
565
- * both rows at commit. The strand is authorised WITHOUT an authority signature
581
+ * both rows at commit. The strand is authorised WITHOUT an owner signature
566
582
  * (the `FormationUsage` branch of `Strand.Authorized`) but still gets a fresh,
567
583
  * unique `StampId` column to satisfy the not-null/unique anti-replay column.
568
584
  *
@@ -579,11 +595,11 @@ export class ControlDatabase {
579
595
  const useNumber = await this.nextUseNumber(token);
580
596
  await this.db.beginTransaction();
581
597
  try {
582
- // 1. Strand row — authorised by the FormationUsage branch (no authority sig),
598
+ // 1. Strand row — authorised by the FormationUsage branch (no owner sig),
583
599
  // still carrying a fresh unique StampId for the anti-replay column.
584
600
  await this.db.exec(`
585
601
  insert into CadreControl.Strand (Id, Type, MemberPrivateKey, StampId)
586
- with context AuthorityKey = null, Signature = null
602
+ with context OwnerKey = null, Signature = null
587
603
  values (?, ?, ?, ?)
588
604
  `, [strandId, type, memberPrivateKey ?? null, strandStampId]);
589
605
  // 2. FormationUsage row — authorised by the matching FormationInvite.
@@ -610,7 +626,7 @@ export class ControlDatabase {
610
626
  /**
611
627
  * Record a `FormationUsage` against an **already-existing** `Strand` (no strand
612
628
  * insert). This is the redemption path when the strand was provisioned
613
- * separately (e.g. authority-signed) and the consent record is added after the
629
+ * separately (e.g. owner-signed) and the consent record is added after the
614
630
  * fact: the single insert auto-commits, and the deferred `StrandExists` CHECK
615
631
  * is satisfied by the pre-existing committed strand row. Returns the assigned
616
632
  * `UseNumber`.
@@ -1 +1 @@
1
- {"version":3,"file":"control-database.js","sourceRoot":"","sources":["../src/control-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,YAAY,MAAM,0CAA0C,CAAC;AACpE,OAAO,gBAAgB,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAIxE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,GAAG,GAAG,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAE5C;;;;;GAKG;AACH,SAAS,eAAe,CAAC,MAAc;IACrC,wEAAwE;IACxE,2EAA2E;IAC3E,sEAAsE;IACtE,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAe,CAAC;IACrE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE/C,2BAA2B;IAC3B,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,OAAO,CAAe,CAAC;IAE3D,wCAAwC;IACxC,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAE7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;QACzB,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAChC,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;CACF"}
@@ -8,7 +8,7 @@ import type { OpenInvitation } from './types.js';
8
8
  * usage questions, and writes the consent row that records a redemption. Two
9
9
  * provisioning shapes are supported, keyed on whether the invite binds a host strand:
10
10
  *
11
- * - **Bound (provision-then-record):** the host strand already exists (authority-signed
11
+ * - **Bound (provision-then-record):** the host strand already exists (owner-signed
12
12
  * up front and named by the invite's `StrandId`), so {@link resolveStrand} reports it
13
13
  * and {@link recordUsage} writes the consent row against that pre-existing strand
14
14
  * (record-only) rather than inserting a new `Strand`.
@@ -42,7 +42,7 @@ export declare class ControlFormationUsageRecorder implements FormationUsageReco
42
42
  * Record consent against an **already-existing** host strand (record-only): the
43
43
  * single `FormationUsage` insert auto-commits and the deferred `StrandExists`
44
44
  * CHECK is satisfied by the pre-existing strand. This is the provision-then-record
45
- * commitment — the strand was minted authority-signed up front, so we do NOT
45
+ * commitment — the strand was minted owner-signed up front, so we do NOT
46
46
  * re-insert it (which would double-insert the same PK). `initiatorKey` is carried
47
47
  * as the usage `PeerId` (advisory). Use {@link ControlDatabase.redeemInvitation}
48
48
  * for the consent-creates-strand path instead.