@ibgib/core-gib 0.1.62 → 0.1.63
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/dist/keystone/keystone-service-v1.d.mts +2 -1
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +3 -1
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +63 -45
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +5 -0
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/keystone/policy/keystone-profile-builder.d.mts +1 -1
- package/dist/keystone/policy/keystone-profile-builder.d.mts.map +1 -1
- package/dist/keystone/policy/keystone-profile-builder.mjs +8 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs.map +1 -1
- package/dist/keystone/policy/profiles/profile-domain.json +84 -0
- package/dist/keystone/policy/profiles/profile-sync.json +84 -0
- package/dist/keystone/strategy/hash-reveal-v1/hash-reveal-v1.d.mts +8 -0
- package/dist/keystone/strategy/hash-reveal-v1/hash-reveal-v1.d.mts.map +1 -1
- package/dist/keystone/strategy/hash-reveal-v1/hash-reveal-v1.mjs +15 -1
- package/dist/keystone/strategy/hash-reveal-v1/hash-reveal-v1.mjs.map +1 -1
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs +16 -4
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs +4 -1
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs +4 -1
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs +10 -4
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs +12 -3
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs +4 -1
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs +4 -1
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs +4 -1
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs +4 -1
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace.withid.respec.mjs +4 -1
- package/dist/sync/sync-innerspace.withid.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts +4 -0
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +4 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs +90 -22
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +7 -10
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +14 -5
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-types.d.mts +5 -0
- package/dist/sync/sync-types.d.mts.map +1 -1
- package/dist/sync/sync-types.mjs.map +1 -1
- package/dist/sync/sync-withid.connect.respec.mjs +4 -1
- package/dist/sync/sync-withid.connect.respec.mjs.map +1 -1
- package/dist/sync/sync-withid.establish.respec.mjs +4 -1
- package/dist/sync/sync-withid.establish.respec.mjs.map +1 -1
- package/dist/sync/sync-withid.pingpong.respec.mjs +4 -1
- package/dist/sync/sync-withid.pingpong.respec.mjs.map +1 -1
- package/package.json +1 -1
- package/src/keystone/keystone-service-v1.mts +5 -1
- package/src/keystone/keystone-service-v1.respec.mts +67 -46
- package/src/keystone/keystone-types.mts +5 -0
- package/src/keystone/policy/keystone-profile-builder.mts +9 -1
- package/src/keystone/policy/profiles/profile-domain.json +84 -0
- package/src/keystone/policy/profiles/profile-sync.json +84 -0
- package/src/keystone/strategy/hash-reveal-v1/hash-reveal-v1.mts +20 -1
- package/src/sync/sync-conflict-adv-multitimelines.withid.respec.mts +16 -4
- package/src/sync/sync-conflict-basic-divergence.withid.respec.mts +4 -1
- package/src/sync/sync-conflict-basic-multitimelines.withid.respec.mts +4 -1
- package/src/sync/sync-conflict-text-merge.withid.respec.mts +10 -4
- package/src/sync/sync-innerspace-constants.withid.respec.mts +12 -3
- package/src/sync/sync-innerspace-deep-updates.withid.respec.mts +4 -1
- package/src/sync/sync-innerspace-dest-ahead.withid.respec.mts +4 -1
- package/src/sync/sync-innerspace-multiple-timelines.withid.respec.mts +4 -1
- package/src/sync/sync-innerspace-partial-update.withid.respec.mts +4 -1
- package/src/sync/sync-innerspace.withid.respec.mts +4 -1
- package/src/sync/sync-peer/sync-peer-types.mts +4 -0
- package/src/sync/sync-peer/sync-peer-v1.mts +5 -1
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mts +96 -22
- package/src/sync/sync-saga-coordinator.mts +17 -12
- package/src/sync/sync-types.mts +6 -0
- package/src/sync/sync-withid.connect.respec.mts +5 -2
- package/src/sync/sync-withid.establish.respec.mts +4 -1
- package/src/sync/sync-withid.pingpong.respec.mts +4 -1
- package/src/sync/unused-identity-backup.mts.md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S,GAAG,MAAM,kBAAkB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YACjF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACrC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC,aAAa,EAAE,CAAC;QACvG,CAAC;IACL,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibgib/core-gib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.63",
|
|
4
4
|
"description": "ibgib core functionality, including base architecture for witnesses, spaces, apps, robbots, etc., as well as shared utility functions. Node v19+ needed for heavily-used isomorphic webcrypto hashing consumed in both node and browsers.",
|
|
5
5
|
"funding": {
|
|
6
6
|
"type": "individual",
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { KeystoneStrategyFactory } from './strategy/keystone-strategy-factory.mjs';
|
|
13
13
|
import {
|
|
14
14
|
POOL_ID_REVOKE, KEYSTONE_VERB_REVOKE, KEYSTONE_VERB_MANAGE,
|
|
15
|
-
KEYSTONE_CHECKPOINT_FREQUENCY, POOL_ID_MANAGE
|
|
15
|
+
KEYSTONE_CHECKPOINT_FREQUENCY, POOL_ID_MANAGE, KEYSTONE_VERB_SYNC
|
|
16
16
|
} from './keystone-constants.mjs';
|
|
17
17
|
import {
|
|
18
18
|
createKeystoneIbGibImpl, evolvePersistAndRegisterKeystone,
|
|
@@ -260,6 +260,7 @@ export class KeystoneService_V1 {
|
|
|
260
260
|
frameDetails,
|
|
261
261
|
metaspace,
|
|
262
262
|
space,
|
|
263
|
+
allowedVerbs,
|
|
263
264
|
}: {
|
|
264
265
|
parentKeystone: KeystoneIbGib_V1;
|
|
265
266
|
delegateKeystone: KeystoneIbGib_V1;
|
|
@@ -267,6 +268,7 @@ export class KeystoneService_V1 {
|
|
|
267
268
|
frameDetails?: any;
|
|
268
269
|
metaspace: MetaspaceService;
|
|
269
270
|
space: IbGibSpaceAny;
|
|
271
|
+
allowedVerbs: string[];
|
|
270
272
|
}): Promise<KeystoneIbGib_V1> {
|
|
271
273
|
const lc = `${this.lc}[${this.registerDelegate.name}]`;
|
|
272
274
|
try {
|
|
@@ -305,6 +307,8 @@ export class KeystoneService_V1 {
|
|
|
305
307
|
delegateTjpAddr,
|
|
306
308
|
delegateAddr: getIbGibAddr({ ibGib: delegateKeystone }),
|
|
307
309
|
thisAddr: getIbGibAddr({ ibGib: parentKeystone }),
|
|
310
|
+
// allowedVerbs: allowedVerbs ?? [KEYSTONE_VERB_SYNC], // NO! We cannot default to sync just to get things to work right now
|
|
311
|
+
allowedVerbs,
|
|
308
312
|
};
|
|
309
313
|
|
|
310
314
|
// 5. Sign & evolve parent keystone using the 'manage' pool
|
|
@@ -10,11 +10,12 @@ import { GLOBAL_LOG_A_LOT } from '../core-constants.mjs';
|
|
|
10
10
|
import { KeystoneStrategyFactory } from './strategy/keystone-strategy-factory.mjs';
|
|
11
11
|
import { KeystoneChallengePool, KeystoneClaim, KeystoneIbGib_V1, KeystonePoolConfig_HashV1 } from './keystone-types.mjs';
|
|
12
12
|
import { createRevocationPoolConfig, createStandardPoolConfig } from './keystone-config-builder.mjs';
|
|
13
|
-
import { POOL_ID_DEFAULT, POOL_ID_REVOKE, KEYSTONE_VERB_REVOKE, KEYSTONE_VERB_MANAGE, POOL_ID_MANAGE } from './keystone-constants.mjs';
|
|
13
|
+
import { POOL_ID_DEFAULT, POOL_ID_REVOKE, KEYSTONE_VERB_REVOKE, KEYSTONE_VERB_MANAGE, POOL_ID_MANAGE, KEYSTONE_VERB_SYNC } from './keystone-constants.mjs';
|
|
14
14
|
import { KeystoneService_V1, } from './keystone-service-v1.mjs';
|
|
15
15
|
import { selectChallengeIds, validateChallengePool, validateKeystoneIb, validateKeystoneTransition, validateGenesisKeystone } from './keystone-helpers.mjs';
|
|
16
16
|
import { KeystoneProfileBuilder } from './policy/keystone-profile-builder.mjs';
|
|
17
17
|
import { getTjpAddr } from '../common/other/ibgib-helper.mjs';
|
|
18
|
+
import { deriveDelegateSecret } from './strategy/hash-reveal-v1/hash-reveal-v1.mjs';
|
|
18
19
|
|
|
19
20
|
const logalot = GLOBAL_LOG_A_LOT;
|
|
20
21
|
|
|
@@ -181,7 +182,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
|
|
|
181
182
|
|
|
182
183
|
await respecfully(sir, 'Derivation Logic', async () => {
|
|
183
184
|
|
|
184
|
-
await
|
|
185
|
+
await ifWe(sir, 'derivePoolSecret with same inputs returns same output', async () => {
|
|
185
186
|
const strategy = KeystoneStrategyFactory.create({ config });
|
|
186
187
|
|
|
187
188
|
const secretA = await strategy.derivePoolSecret({ masterSecret });
|
|
@@ -191,7 +192,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
|
|
|
191
192
|
iReckon(sir, secretA).asTo('secret length').isGonnaBeTruthy();
|
|
192
193
|
});
|
|
193
194
|
|
|
194
|
-
await
|
|
195
|
+
await ifWe(sir, 'derivePoolSecret with different master secret returns different output', async () => {
|
|
195
196
|
const strategy = KeystoneStrategyFactory.create({ config });
|
|
196
197
|
|
|
197
198
|
const secretA = await strategy.derivePoolSecret({ masterSecret });
|
|
@@ -200,7 +201,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
|
|
|
200
201
|
iReckon(sir, secretA).asTo('secrets differ').not.willEqual(secretB);
|
|
201
202
|
});
|
|
202
203
|
|
|
203
|
-
await
|
|
204
|
+
await ifWe(sir, 'derivePoolSecret with different salt returns different output', async () => {
|
|
204
205
|
// Modify salt in a copy of config
|
|
205
206
|
const configB = { ...config, salt: "OtherPool" };
|
|
206
207
|
const strategyA = KeystoneStrategyFactory.create({ config });
|
|
@@ -211,11 +212,22 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
|
|
|
211
212
|
|
|
212
213
|
iReckon(sir, secretA).asTo('salt affects secret').not.willEqual(secretB);
|
|
213
214
|
});
|
|
215
|
+
|
|
216
|
+
await ifWe(sir, 'deriveDelegateSecret derives a consistent secret using KDF', async () => {
|
|
217
|
+
const secretA = await deriveDelegateSecret({ masterSecret });
|
|
218
|
+
const secretB = await deriveDelegateSecret({ masterSecret });
|
|
219
|
+
|
|
220
|
+
iReckon(sir, secretA).asTo('consistency').willEqual(secretB);
|
|
221
|
+
iReckon(sir, secretA).asTo('truthy').isGonnaBeTruthy();
|
|
222
|
+
|
|
223
|
+
const secretC = await deriveDelegateSecret({ masterSecret: masterSecret + '_other' });
|
|
224
|
+
iReckon(sir, secretA).asTo('differ').not.willEqual(secretC);
|
|
225
|
+
});
|
|
214
226
|
});
|
|
215
227
|
|
|
216
228
|
await respecfully(sir, 'Challenge/Solution Logic', async () => {
|
|
217
229
|
|
|
218
|
-
await
|
|
230
|
+
await ifWe(sir, 'generateSolution -> generateChallenge -> validateSolution loop works', async () => {
|
|
219
231
|
const strategy = KeystoneStrategyFactory.create({ config });
|
|
220
232
|
const poolSecret = await strategy.derivePoolSecret({ masterSecret });
|
|
221
233
|
const challengeId = "a3ff7843552870fc28bef2b"; // arbitrary random challengeId
|
|
@@ -234,7 +246,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
|
|
|
234
246
|
iReckon(sir, isValid).asTo('valid pair should pass').isGonnaBeTrue();
|
|
235
247
|
});
|
|
236
248
|
|
|
237
|
-
await
|
|
249
|
+
await ifWe(sir, 'validateSolution fails for mismatched values', async () => {
|
|
238
250
|
const strategy = KeystoneStrategyFactory.create({ config });
|
|
239
251
|
const poolSecret = await strategy.derivePoolSecret({ masterSecret });
|
|
240
252
|
const challengeId = "8c994f3ed598f150e25513"; // arbitrary random challengeId
|
|
@@ -250,7 +262,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
|
|
|
250
262
|
iReckon(sir, isValid).asTo('tampered solution should fail').isGonnaBeFalse();
|
|
251
263
|
});
|
|
252
264
|
|
|
253
|
-
await
|
|
265
|
+
await ifWe(sir, 'validateSolution fails for mismatched challenge hashes', async () => {
|
|
254
266
|
const strategy = KeystoneStrategyFactory.create({ config });
|
|
255
267
|
const poolSecret = await strategy.derivePoolSecret({ masterSecret });
|
|
256
268
|
|
|
@@ -291,7 +303,7 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
|
|
|
291
303
|
});
|
|
292
304
|
|
|
293
305
|
await respecfully(sir, 'Genesis', async () => {
|
|
294
|
-
await
|
|
306
|
+
await ifWe(sir, 'creates a valid genesis frame and persists it', async () => {
|
|
295
307
|
const salt = (await getUUID()).substring(0, 16);
|
|
296
308
|
const config = createStandardPoolConfig({
|
|
297
309
|
id: POOL_ID_DEFAULT,
|
|
@@ -323,7 +335,7 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
|
|
|
323
335
|
});
|
|
324
336
|
|
|
325
337
|
await respecfully(sir, 'Signing (Evolution)', async () => {
|
|
326
|
-
await
|
|
338
|
+
await ifWe(sir, 'evolves the keystone with a valid proof', async () => {
|
|
327
339
|
const claim: Partial<KeystoneClaim> = {
|
|
328
340
|
target: "comment 123^gib",
|
|
329
341
|
verb: "post"
|
|
@@ -353,7 +365,7 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
|
|
|
353
365
|
});
|
|
354
366
|
|
|
355
367
|
await respecfully(sir, 'Validation', async () => {
|
|
356
|
-
await
|
|
368
|
+
await ifWe(sir, 'validates the genesis->signed transition', async () => {
|
|
357
369
|
const errors = await service.validate({
|
|
358
370
|
prevIbGib: genesisKeystone,
|
|
359
371
|
currentIbGib: signedKeystone,
|
|
@@ -402,7 +414,7 @@ await respecfully(sir, 'Suite C: Security Vectors', async () => {
|
|
|
402
414
|
});
|
|
403
415
|
|
|
404
416
|
await respecfully(sir, 'Wrong Secret (Forgery)', async () => {
|
|
405
|
-
await
|
|
417
|
+
await ifWe(sir, 'prevents creation of forged frames', async () => {
|
|
406
418
|
const claim: Partial<KeystoneClaim> = { target: "comment 123^gib", verb: "post" };
|
|
407
419
|
|
|
408
420
|
let errorCaught = false;
|
|
@@ -431,7 +443,7 @@ await respecfully(sir, 'Suite C: Security Vectors', async () => {
|
|
|
431
443
|
});
|
|
432
444
|
|
|
433
445
|
await respecfully(sir, 'Policy Violation (Restricted Verbs)', async () => {
|
|
434
|
-
await
|
|
446
|
+
await ifWe(sir, 'throws error if signing forbidden verb with restricted pool', async () => {
|
|
435
447
|
// Create a specific restricted pool config manually
|
|
436
448
|
const restrictedPoolId = "read_only_pool";
|
|
437
449
|
const restrictedConfig = createStandardPoolConfig({
|
|
@@ -511,7 +523,7 @@ await respecfully(sir, 'Suite D: Revocation', async () => {
|
|
|
511
523
|
await respecfully(sir, 'Revoke Lifecycle', async () => {
|
|
512
524
|
let revokedKeystone: KeystoneIbGib_V1;
|
|
513
525
|
|
|
514
|
-
await
|
|
526
|
+
await ifWe(sir, 'successfully creates a revocation frame', async () => {
|
|
515
527
|
revokedKeystone = await service.revoke({
|
|
516
528
|
latestKeystone: genesisKeystone,
|
|
517
529
|
masterSecret,
|
|
@@ -529,7 +541,7 @@ await respecfully(sir, 'Suite D: Revocation', async () => {
|
|
|
529
541
|
iReckon(sir, data.revocationInfo!.proof.claim.verb).willEqual(KEYSTONE_VERB_REVOKE);
|
|
530
542
|
});
|
|
531
543
|
|
|
532
|
-
await
|
|
544
|
+
await ifWe(sir, 'validates the revocation frame', async () => {
|
|
533
545
|
const errors = await service.validate({
|
|
534
546
|
prevIbGib: genesisKeystone,
|
|
535
547
|
currentIbGib: revokedKeystone!,
|
|
@@ -540,7 +552,7 @@ await respecfully(sir, 'Suite D: Revocation', async () => {
|
|
|
540
552
|
iReckon(sir, errors.length).asTo('no validation errors').willEqual(0);
|
|
541
553
|
});
|
|
542
554
|
|
|
543
|
-
await
|
|
555
|
+
await ifWe(sir, 'consumed the revocation pool (Scorched Earth)', async () => {
|
|
544
556
|
const data = revokedKeystone!.data!;
|
|
545
557
|
const revokePool = data.challengePools.find(p => p.id === POOL_ID_REVOKE);
|
|
546
558
|
|
|
@@ -616,7 +628,7 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
|
|
|
616
628
|
});
|
|
617
629
|
|
|
618
630
|
await respecfully(sir, 'Happy Path', async () => {
|
|
619
|
-
await
|
|
631
|
+
await ifWe(sir, 'authorizes and adds a foreign pool', async () => {
|
|
620
632
|
const bobPool = await createForeignPool("pool_bob", ["post"]);
|
|
621
633
|
|
|
622
634
|
const updatedKeystone = await service.addPools({
|
|
@@ -655,7 +667,7 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
|
|
|
655
667
|
});
|
|
656
668
|
|
|
657
669
|
await respecfully(sir, 'Permissions & Logic', async () => {
|
|
658
|
-
await
|
|
670
|
+
await ifWe(sir, 'fails if no pool allows "manage" verb', async () => {
|
|
659
671
|
// 1. Create a restricted keystone
|
|
660
672
|
let id = "read_only";
|
|
661
673
|
const restrictedConfig = createStandardPoolConfig({ id, salt: id });
|
|
@@ -688,7 +700,7 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
|
|
|
688
700
|
iReckon(sir, errorCaught).asTo('permission denied').isGonnaBeTrue();
|
|
689
701
|
});
|
|
690
702
|
|
|
691
|
-
await
|
|
703
|
+
await ifWe(sir, 'fails on ID collision', async () => {
|
|
692
704
|
// Try to add "pool_bob" again (it was added in Happy Path)
|
|
693
705
|
const duplicatePool = await createForeignPool("pool_bob");
|
|
694
706
|
|
|
@@ -776,7 +788,7 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
|
|
|
776
788
|
});
|
|
777
789
|
|
|
778
790
|
await respecfully(sir, 'Happy Path', async () => {
|
|
779
|
-
await
|
|
791
|
+
await ifWe(sir, 'authorizes and adds a foreign pool', async () => {
|
|
780
792
|
const bobPool = await createForeignPool("pool_bob", ["post"]);
|
|
781
793
|
|
|
782
794
|
const updatedKeystone = await service.addPools({
|
|
@@ -815,7 +827,7 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
|
|
|
815
827
|
});
|
|
816
828
|
|
|
817
829
|
await respecfully(sir, 'Permissions & Logic', async () => {
|
|
818
|
-
await
|
|
830
|
+
await ifWe(sir, 'fails if no pool allows "manage" verb', async () => {
|
|
819
831
|
// 1. Create a restricted keystone (read-only)
|
|
820
832
|
let id = "read_only";
|
|
821
833
|
const restrictedConfig = createStandardPoolConfig({ id, salt: id });
|
|
@@ -848,7 +860,7 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
|
|
|
848
860
|
iReckon(sir, errorCaught).asTo('permission denied').isGonnaBeTrue();
|
|
849
861
|
});
|
|
850
862
|
|
|
851
|
-
await
|
|
863
|
+
await ifWe(sir, 'fails on ID collision', async () => {
|
|
852
864
|
// Try to add "pool_bob" again (it was added in Happy Path)
|
|
853
865
|
const duplicatePool = await createForeignPool("pool_bob");
|
|
854
866
|
|
|
@@ -910,7 +922,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
910
922
|
|
|
911
923
|
await respecfully(sir, 'Proof Granularity & Math', async () => {
|
|
912
924
|
|
|
913
|
-
await
|
|
925
|
+
await ifWe(sir, 'generates exactly the expected number of solutions', async () => {
|
|
914
926
|
signedKeystone = await service.sign({
|
|
915
927
|
latestKeystone: genesisKeystone,
|
|
916
928
|
masterSecret: aliceSecret,
|
|
@@ -927,7 +939,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
927
939
|
iReckon(sir, solutions.length).asTo('solution count').willEqual(4);
|
|
928
940
|
});
|
|
929
941
|
|
|
930
|
-
await
|
|
942
|
+
await ifWe(sir, 'verifies the math manually (White-box Crypto Check)', async () => {
|
|
931
943
|
const proof = signedKeystone.data!.proofs[0];
|
|
932
944
|
const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === poolId)!;
|
|
933
945
|
|
|
@@ -956,7 +968,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
956
968
|
}
|
|
957
969
|
});
|
|
958
970
|
|
|
959
|
-
await
|
|
971
|
+
await ifWe(sir, 'verifies FIFO logic (Deterministic Selection)', async () => {
|
|
960
972
|
const proof = signedKeystone.data!.proofs[0];
|
|
961
973
|
const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === poolId)!;
|
|
962
974
|
|
|
@@ -975,7 +987,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
975
987
|
iReckon(sir, hasSecond).asTo(`Solution includes 2nd FIFO ID (${expectedFifoIds[1]})`).isGonnaBeTrue();
|
|
976
988
|
});
|
|
977
989
|
|
|
978
|
-
await
|
|
990
|
+
await ifWe(sir, 'verifies Next-Gen Hash-Based Target Binding Selection', async () => {
|
|
979
991
|
const bindingConfig = createStandardPoolConfig({
|
|
980
992
|
id: "binding_pool",
|
|
981
993
|
salt: "binding_salt",
|
|
@@ -1023,7 +1035,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1023
1035
|
}
|
|
1024
1036
|
});
|
|
1025
1037
|
|
|
1026
|
-
await
|
|
1038
|
+
await ifWe(sir, 'fails validation if total requested challenges >= size', async () => {
|
|
1027
1039
|
const invalidConfig = createStandardPoolConfig({
|
|
1028
1040
|
id: "invalid_pool",
|
|
1029
1041
|
salt: "invalid_salt",
|
|
@@ -1042,7 +1054,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1042
1054
|
|
|
1043
1055
|
await respecfully(sir, 'DTO & Serialization', async () => {
|
|
1044
1056
|
|
|
1045
|
-
await
|
|
1057
|
+
await ifWe(sir, 'survives a clone/JSON-cycle without corruption', async () => {
|
|
1046
1058
|
// 1. Create a DTO (simulate network transmission/storage)
|
|
1047
1059
|
// 'clone' does a JSON stringify/parse under the hood (usually) or structured clone.
|
|
1048
1060
|
const dto = clone(signedKeystone);
|
|
@@ -1062,7 +1074,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1062
1074
|
iReckon(sir, errors.length).asTo('DTO validation errors').willEqual(0);
|
|
1063
1075
|
});
|
|
1064
1076
|
|
|
1065
|
-
await
|
|
1077
|
+
await ifWe(sir, 'ensures data contains no functions or circular refs', async () => {
|
|
1066
1078
|
// A crude but effective test: ensure JSON.stringify doesn't throw
|
|
1067
1079
|
// and the result is equal to the object (if we parsed it back).
|
|
1068
1080
|
|
|
@@ -1089,7 +1101,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1089
1101
|
|
|
1090
1102
|
await respecfully(sir, 'KeystoneProfileBuilder and Modular Schemas', async () => {
|
|
1091
1103
|
|
|
1092
|
-
await
|
|
1104
|
+
await ifWe(sir, 'compiles configs successfully with medium profile', async () => {
|
|
1093
1105
|
const builder = KeystoneProfileBuilder.buildKeystone('medium')
|
|
1094
1106
|
.withUsername('alice')
|
|
1095
1107
|
.withEmail('alice@example.com')
|
|
@@ -1112,7 +1124,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1112
1124
|
iReckon(sir, details.extraInfo).asTo('extraInfo').willEqual('abc');
|
|
1113
1125
|
});
|
|
1114
1126
|
|
|
1115
|
-
await
|
|
1127
|
+
await ifWe(sir, 'supports customized overrides', async () => {
|
|
1116
1128
|
const builder = KeystoneProfileBuilder.buildKeystone('test')
|
|
1117
1129
|
.customizePool('sync', {
|
|
1118
1130
|
behavior: {
|
|
@@ -1131,7 +1143,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1131
1143
|
|
|
1132
1144
|
await respecfully(sir, 'Keystone Metadata Validation', async () => {
|
|
1133
1145
|
|
|
1134
|
-
await
|
|
1146
|
+
await ifWe(sir, 'validates correct username and description', async () => {
|
|
1135
1147
|
const service = new KeystoneService_V1();
|
|
1136
1148
|
const space = new MockIbGibSpace();
|
|
1137
1149
|
const metaspace = new MockMetaspaceService(space);
|
|
@@ -1157,7 +1169,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1157
1169
|
iReckon(sir, errors.length).asTo('errors count').willEqual(0);
|
|
1158
1170
|
});
|
|
1159
1171
|
|
|
1160
|
-
await
|
|
1172
|
+
await ifWe(sir, 'fails validation for invalid username length or character', async () => {
|
|
1161
1173
|
const service = new KeystoneService_V1();
|
|
1162
1174
|
const space = new MockIbGibSpace();
|
|
1163
1175
|
const metaspace = new MockMetaspaceService(space);
|
|
@@ -1182,7 +1194,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
|
|
|
1182
1194
|
iReckon(sir, errors[0]).includes('invalid username');
|
|
1183
1195
|
});
|
|
1184
1196
|
|
|
1185
|
-
await
|
|
1197
|
+
await ifWe(sir, 'fails validation for invalid description characters', async () => {
|
|
1186
1198
|
const service = new KeystoneService_V1();
|
|
1187
1199
|
const space = new MockIbGibSpace();
|
|
1188
1200
|
const metaspace = new MockMetaspaceService(space);
|
|
@@ -1255,7 +1267,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1255
1267
|
});
|
|
1256
1268
|
});
|
|
1257
1269
|
|
|
1258
|
-
await
|
|
1270
|
+
await ifWe(sir, 'registers a delegate keystone and evolves parent using manage pool', async () => {
|
|
1259
1271
|
// Register the delegate
|
|
1260
1272
|
const evolvedParent = await service.registerDelegate({
|
|
1261
1273
|
parentKeystone,
|
|
@@ -1263,6 +1275,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1263
1275
|
masterSecret: parentSecret,
|
|
1264
1276
|
metaspace: mockMetaspace,
|
|
1265
1277
|
space: mockSpace as any,
|
|
1278
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1266
1279
|
});
|
|
1267
1280
|
|
|
1268
1281
|
iReckon(sir, evolvedParent).asTo('evolved parent exists').isGonnaBeTruthy();
|
|
@@ -1275,7 +1288,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1275
1288
|
iReckon(sir, delegateInfo?.delegateTjpAddr).asTo('delegate tjp matches').willEqual(delegateTjpAddr);
|
|
1276
1289
|
});
|
|
1277
1290
|
|
|
1278
|
-
await
|
|
1291
|
+
await ifWe(sir, 'gets correct delegate status via parent TJP address', async () => {
|
|
1279
1292
|
const parentTjpAddr = getTjpAddr({ ibGib: parentKeystone });
|
|
1280
1293
|
if (!parentTjpAddr) { throw new Error(`(UNEXPECTED) parentTjpAddr falsy? (E: b7ce2835ccd951d8c99257328be3b826)`); }
|
|
1281
1294
|
const delegateTjpAddr = getTjpAddr({ ibGib: delegateKeystone });
|
|
@@ -1297,6 +1310,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1297
1310
|
masterSecret: parentSecret,
|
|
1298
1311
|
metaspace: mockMetaspace,
|
|
1299
1312
|
space: mockSpace as any,
|
|
1313
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1300
1314
|
});
|
|
1301
1315
|
|
|
1302
1316
|
// After registration
|
|
@@ -1310,7 +1324,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1310
1324
|
iReckon(sir, statusAfter.delegateInfo?.delegateTjpAddr).asTo('status tjp matches').willEqual(delegateTjpAddr);
|
|
1311
1325
|
});
|
|
1312
1326
|
|
|
1313
|
-
await
|
|
1327
|
+
await ifWe(sir, 'unregisters a registered delegate keystone', async () => {
|
|
1314
1328
|
// Register first
|
|
1315
1329
|
const evolvedParent = await service.registerDelegate({
|
|
1316
1330
|
parentKeystone,
|
|
@@ -1318,6 +1332,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1318
1332
|
masterSecret: parentSecret,
|
|
1319
1333
|
metaspace: mockMetaspace,
|
|
1320
1334
|
space: mockSpace as any,
|
|
1335
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1321
1336
|
});
|
|
1322
1337
|
|
|
1323
1338
|
const delegateTjpAddr = getTjpAddr({ ibGib: delegateKeystone });
|
|
@@ -1337,7 +1352,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1337
1352
|
iReckon(sir, info).asTo('delegate info removed').isGonnaBeUndefined();
|
|
1338
1353
|
});
|
|
1339
1354
|
|
|
1340
|
-
await
|
|
1355
|
+
await ifWe(sir, 'throws if parent does not have a manage pool', async () => {
|
|
1341
1356
|
// Create a parent WITHOUT a manage pool
|
|
1342
1357
|
const salt = (await getUUID()).substring(0, 16);
|
|
1343
1358
|
const defaultConfig = createStandardPoolConfig({ id: POOL_ID_DEFAULT, salt });
|
|
@@ -1356,6 +1371,7 @@ await respecfully(sir, 'Suite E: Delegation (Register/Unregister)', async () =>
|
|
|
1356
1371
|
masterSecret: parentSecret,
|
|
1357
1372
|
metaspace: mockMetaspace,
|
|
1358
1373
|
space: mockSpace as any,
|
|
1374
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1359
1375
|
});
|
|
1360
1376
|
} catch (e: any) {
|
|
1361
1377
|
errorCaught = true;
|
|
@@ -1406,14 +1422,14 @@ await respecfully(sir, 'Suite G: Delegate & IB Validation', async () => {
|
|
|
1406
1422
|
});
|
|
1407
1423
|
});
|
|
1408
1424
|
|
|
1409
|
-
await
|
|
1425
|
+
await ifWe(sir, 'validateKeystoneIb returns true for valid keystone ib and false for others', async () => {
|
|
1410
1426
|
iReckon(sir, await validateKeystoneIb({ ib: 'keystone' })).isGonnaBeTrue();
|
|
1411
1427
|
iReckon(sir, await validateKeystoneIb({ ib: 'keystone user info' })).isGonnaBeTrue();
|
|
1412
1428
|
iReckon(sir, await validateKeystoneIb({ ib: 'invalidAtom' })).isGonnaBeFalse();
|
|
1413
1429
|
iReckon(sir, await validateKeystoneIb({ ib: 'not_keystone sub_atom' })).isGonnaBeFalse();
|
|
1414
1430
|
});
|
|
1415
1431
|
|
|
1416
|
-
await
|
|
1432
|
+
await ifWe(sir, 'validateGenesisKeystone fails validation if ib is invalid', async () => {
|
|
1417
1433
|
const invalidGenesis = {
|
|
1418
1434
|
...parentKeystone,
|
|
1419
1435
|
ib: 'not_a_keystone^' + parentKeystone.gib,
|
|
@@ -1423,13 +1439,14 @@ await respecfully(sir, 'Suite G: Delegate & IB Validation', async () => {
|
|
|
1423
1439
|
iReckon(sir, errors[0]).includes('invalid keystone ib');
|
|
1424
1440
|
});
|
|
1425
1441
|
|
|
1426
|
-
await
|
|
1442
|
+
await ifWe(sir, 'validateKeystoneTransition passes for valid delegate registration', async () => {
|
|
1427
1443
|
const evolvedParent = await service.registerDelegate({
|
|
1428
1444
|
parentKeystone,
|
|
1429
1445
|
delegateKeystone,
|
|
1430
1446
|
masterSecret: parentSecret,
|
|
1431
1447
|
metaspace: mockMetaspace,
|
|
1432
1448
|
space: mockSpace as any,
|
|
1449
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1433
1450
|
});
|
|
1434
1451
|
|
|
1435
1452
|
const errors = await validateKeystoneTransition({
|
|
@@ -1439,17 +1456,18 @@ await respecfully(sir, 'Suite G: Delegate & IB Validation', async () => {
|
|
|
1439
1456
|
iReckon(sir, errors.length).willEqual(0);
|
|
1440
1457
|
});
|
|
1441
1458
|
|
|
1442
|
-
await
|
|
1459
|
+
await ifWe(sir, 'validateKeystoneTransition fails if delegates map is mutated without manage proof', async () => {
|
|
1443
1460
|
const evolvedParent = await service.registerDelegate({
|
|
1444
1461
|
parentKeystone,
|
|
1445
1462
|
delegateKeystone,
|
|
1446
1463
|
masterSecret: parentSecret,
|
|
1447
1464
|
metaspace: mockMetaspace,
|
|
1448
1465
|
space: mockSpace as any,
|
|
1466
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1449
1467
|
});
|
|
1450
1468
|
|
|
1451
1469
|
const tamperedParent = JSON.parse(JSON.stringify(evolvedParent)) as KeystoneIbGib_V1;
|
|
1452
|
-
|
|
1470
|
+
|
|
1453
1471
|
// Remove the manage verb proof by converting it to sign
|
|
1454
1472
|
for (const proof of tamperedParent.data.proofs) {
|
|
1455
1473
|
if (proof.claim) {
|
|
@@ -1465,19 +1483,20 @@ await respecfully(sir, 'Suite G: Delegate & IB Validation', async () => {
|
|
|
1465
1483
|
iReckon(sir, errors.some(e => e.includes('Policy Violation: Delegates map was mutated'))).isGonnaBeTrue();
|
|
1466
1484
|
});
|
|
1467
1485
|
|
|
1468
|
-
await
|
|
1486
|
+
await ifWe(sir, 'validateKeystoneTransition fails if delegate key does not match delegateTjpAddr', async () => {
|
|
1469
1487
|
const evolvedParent = await service.registerDelegate({
|
|
1470
1488
|
parentKeystone,
|
|
1471
1489
|
delegateKeystone,
|
|
1472
1490
|
masterSecret: parentSecret,
|
|
1473
1491
|
metaspace: mockMetaspace,
|
|
1474
1492
|
space: mockSpace as any,
|
|
1493
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1475
1494
|
});
|
|
1476
1495
|
|
|
1477
1496
|
const tamperedParent = JSON.parse(JSON.stringify(evolvedParent)) as KeystoneIbGib_V1;
|
|
1478
1497
|
const delegateTjpAddr = getTjpAddr({ ibGib: delegateKeystone });
|
|
1479
1498
|
if (!delegateTjpAddr) { throw new Error(`delegateTjpAddr falsy?`); }
|
|
1480
|
-
|
|
1499
|
+
|
|
1481
1500
|
const info = tamperedParent.data.delegates![delegateTjpAddr];
|
|
1482
1501
|
delete tamperedParent.data.delegates![delegateTjpAddr];
|
|
1483
1502
|
tamperedParent.data.delegates!['mismatched_key'] = info;
|
|
@@ -1490,13 +1509,14 @@ await respecfully(sir, 'Suite G: Delegate & IB Validation', async () => {
|
|
|
1490
1509
|
iReckon(sir, errors.some(e => e.includes('does not match delegateTjpAddr'))).isGonnaBeTrue();
|
|
1491
1510
|
});
|
|
1492
1511
|
|
|
1493
|
-
await
|
|
1512
|
+
await ifWe(sir, 'validateKeystoneTransition fails if delegate addresses have invalid keystone ib', async () => {
|
|
1494
1513
|
const evolvedParent = await service.registerDelegate({
|
|
1495
1514
|
parentKeystone,
|
|
1496
1515
|
delegateKeystone,
|
|
1497
1516
|
masterSecret: parentSecret,
|
|
1498
1517
|
metaspace: mockMetaspace,
|
|
1499
1518
|
space: mockSpace as any,
|
|
1519
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1500
1520
|
});
|
|
1501
1521
|
|
|
1502
1522
|
const tamperedParent = JSON.parse(JSON.stringify(evolvedParent)) as KeystoneIbGib_V1;
|
|
@@ -1513,13 +1533,14 @@ await respecfully(sir, 'Suite G: Delegate & IB Validation', async () => {
|
|
|
1513
1533
|
iReckon(sir, errors.some(e => e.includes('not a valid keystone address'))).isGonnaBeTrue();
|
|
1514
1534
|
});
|
|
1515
1535
|
|
|
1516
|
-
await
|
|
1536
|
+
await ifWe(sir, 'validateKeystoneTransition fails if thisAddr is not in the parent timeline history', async () => {
|
|
1517
1537
|
const evolvedParent = await service.registerDelegate({
|
|
1518
1538
|
parentKeystone,
|
|
1519
1539
|
delegateKeystone,
|
|
1520
1540
|
masterSecret: parentSecret,
|
|
1521
1541
|
metaspace: mockMetaspace,
|
|
1522
1542
|
space: mockSpace as any,
|
|
1543
|
+
allowedVerbs: [KEYSTONE_VERB_SYNC],
|
|
1523
1544
|
});
|
|
1524
1545
|
|
|
1525
1546
|
const tamperedParent = JSON.parse(JSON.stringify(evolvedParent)) as KeystoneIbGib_V1;
|
|
@@ -342,6 +342,11 @@ export interface DelegateKeystoneInfo {
|
|
|
342
342
|
* `tjpGib` in its `GibInfo`.
|
|
343
343
|
*/
|
|
344
344
|
thisAddr: IbGibAddr;
|
|
345
|
+
/**
|
|
346
|
+
* Optional list of verbs allowed for this delegate.
|
|
347
|
+
* e.g. ["sync^gib"]
|
|
348
|
+
*/
|
|
349
|
+
allowedVerbs?: string[];
|
|
345
350
|
}
|
|
346
351
|
|
|
347
352
|
/**
|
|
@@ -8,6 +8,8 @@ import profileMedium from "./profiles/profile-medium.json" assert { type: "json"
|
|
|
8
8
|
import profileLow from "./profiles/profile-low.json" assert { type: "json" };
|
|
9
9
|
import profileSession from "./profiles/profile-session.json" assert { type: "json" };
|
|
10
10
|
import profileTest from "./profiles/profile-test.json" assert { type: "json" };
|
|
11
|
+
import profileDomain from "./profiles/profile-domain.json" assert { type: "json" };
|
|
12
|
+
import profileSync from "./profiles/profile-sync.json" assert { type: "json" };
|
|
11
13
|
|
|
12
14
|
export class KeystoneProfileBuilder {
|
|
13
15
|
private _template: KeystonePolicyConfigTemplate;
|
|
@@ -22,7 +24,7 @@ export class KeystoneProfileBuilder {
|
|
|
22
24
|
this._template = JSON.parse(JSON.stringify(template));
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
static buildKeystone(profileName: 'high' | 'medium' | 'low' | 'session' | 'test'): KeystoneProfileBuilder {
|
|
27
|
+
static buildKeystone(profileName: 'high' | 'medium' | 'low' | 'session' | 'test' | 'domain' | 'sync'): KeystoneProfileBuilder {
|
|
26
28
|
let selected: KeystonePolicyConfigTemplate;
|
|
27
29
|
switch (profileName) {
|
|
28
30
|
case 'high':
|
|
@@ -40,6 +42,12 @@ export class KeystoneProfileBuilder {
|
|
|
40
42
|
case 'test':
|
|
41
43
|
selected = profileTest as any;
|
|
42
44
|
break;
|
|
45
|
+
case 'domain':
|
|
46
|
+
selected = profileDomain as any;
|
|
47
|
+
break;
|
|
48
|
+
case 'sync':
|
|
49
|
+
selected = profileSync as any;
|
|
50
|
+
break;
|
|
43
51
|
default:
|
|
44
52
|
throw new Error(`Unknown profile name: ${profileName} (E: fc10a8ad482ef2bda871ac567d268d26)`);
|
|
45
53
|
}
|