@ibgib/core-gib 0.1.8 → 0.1.10
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/agent-helpers.d.mts +45 -0
- package/dist/agent-helpers.d.mts.map +1 -0
- package/dist/agent-helpers.mjs +36 -0
- package/dist/agent-helpers.mjs.map +1 -0
- package/dist/keystone/keystone-config-builder.respec.d.mts +2 -0
- package/dist/keystone/keystone-config-builder.respec.d.mts.map +1 -0
- package/dist/keystone/keystone-config-builder.respec.mjs +34 -0
- package/dist/keystone/keystone-config-builder.respec.mjs.map +1 -0
- package/dist/keystone/keystone-constants.d.mts +2 -0
- package/dist/keystone/keystone-constants.d.mts.map +1 -1
- package/dist/keystone/keystone-constants.mjs +2 -0
- package/dist/keystone/keystone-constants.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts +54 -1
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +185 -1
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.d.mts +49 -16
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +151 -328
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +401 -20
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +22 -0
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/sync/sync-constants.d.mts +17 -0
- package/dist/sync/sync-constants.d.mts.map +1 -0
- package/dist/sync/sync-constants.mjs +16 -0
- package/dist/sync/sync-constants.mjs.map +1 -0
- package/dist/sync/sync-helpers.d.mts +15 -0
- package/dist/sync/sync-helpers.d.mts.map +1 -0
- package/dist/sync/sync-helpers.mjs +46 -0
- package/dist/sync/sync-helpers.mjs.map +1 -0
- package/dist/sync/sync-local-spaces.respec.d.mts +2 -0
- package/dist/sync/sync-local-spaces.respec.d.mts.map +1 -0
- package/dist/sync/sync-local-spaces.respec.mjs +159 -0
- package/dist/sync/sync-local-spaces.respec.mjs.map +1 -0
- package/dist/sync/sync-saga-coordinator.d.mts +118 -0
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -0
- package/dist/sync/sync-saga-coordinator.mjs +399 -0
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -0
- package/dist/sync/sync-saga-coordinator.respec.d.mts +2 -0
- package/dist/sync/sync-saga-coordinator.respec.d.mts.map +1 -0
- package/dist/sync/sync-saga-coordinator.respec.mjs +40 -0
- package/dist/sync/sync-saga-coordinator.respec.mjs.map +1 -0
- package/dist/sync/sync-types.d.mts +103 -0
- package/dist/sync/sync-types.d.mts.map +1 -0
- package/dist/sync/sync-types.mjs +2 -0
- package/dist/sync/sync-types.mjs.map +1 -0
- package/dist/test/mock-space.d.mts +39 -0
- package/dist/test/mock-space.d.mts.map +1 -0
- package/dist/test/mock-space.mjs +79 -0
- package/dist/test/mock-space.mjs.map +1 -0
- package/dist/witness/space/inner-space/inner-space-v1.respec.mjs +163 -201
- package/dist/witness/space/inner-space/inner-space-v1.respec.mjs.map +1 -1
- package/dist/witness/space/space-helper.d.mts.map +1 -1
- package/dist/witness/space/space-helper.mjs +43 -4
- package/dist/witness/space/space-helper.mjs.map +1 -1
- package/dist/witness/space/space-helper.respec.d.mts +2 -0
- package/dist/witness/space/space-helper.respec.d.mts.map +1 -0
- package/dist/witness/space/space-helper.respec.mjs +30 -0
- package/dist/witness/space/space-helper.respec.mjs.map +1 -0
- package/package.json +2 -2
- package/src/agent-helpers.mts +58 -0
- package/src/keystone/keystone-config-builder.respec.mts +49 -0
- package/src/keystone/keystone-constants.mts +2 -0
- package/src/keystone/keystone-helpers.mts +211 -2
- package/src/keystone/keystone-service-v1.mts +183 -367
- package/src/keystone/keystone-service-v1.respec.mts +484 -21
- package/src/keystone/keystone-types.mts +24 -0
- package/src/sync/sync-constants.mts +24 -0
- package/src/sync/sync-helpers.mts +59 -0
- package/src/sync/sync-local-spaces.respec.mts +200 -0
- package/src/sync/sync-saga-coordinator.mts +477 -0
- package/src/sync/sync-saga-coordinator.respec.mts +52 -0
- package/src/sync/sync-types.mts +120 -0
- package/src/test/mock-space.mts +85 -0
- package/src/witness/space/inner-space/inner-space-v1.respec.mts +181 -228
- package/src/witness/space/space-helper.mts +42 -4
- package/src/witness/space/space-helper.respec.mts +42 -0
- package/tmp.md +11 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeystoneIbGib_V1, KeystonePoolConfig, KeystoneClaim } from './keystone-types.mjs';
|
|
1
|
+
import { KeystoneIbGib_V1, KeystonePoolConfig, KeystoneClaim, KeystoneChallengePool } from './keystone-types.mjs';
|
|
2
2
|
import { IbGibSpaceAny } from '../witness/space/space-base-v1.mjs';
|
|
3
3
|
import { MetaspaceService } from '../witness/space/metaspace/metaspace-types.mjs';
|
|
4
4
|
/**
|
|
@@ -18,14 +18,31 @@ export declare class KeystoneService_V1 {
|
|
|
18
18
|
space: IbGibSpaceAny;
|
|
19
19
|
}): Promise<KeystoneIbGib_V1>;
|
|
20
20
|
/**
|
|
21
|
-
* Signs a claim
|
|
22
|
-
*
|
|
21
|
+
* Signs a claim by solving challenges from a specific pool and evolving the Keystone timeline.
|
|
22
|
+
*
|
|
23
|
+
* Uses a hybrid selection strategy: Mandatory IDs (Alice) + Sequential (FIFO) + Random (Stochastic).
|
|
24
|
+
*
|
|
25
|
+
* Supports Delegation via `poolFilter` to find specific foreign pools.
|
|
23
26
|
*/
|
|
24
|
-
sign({ latestKeystone, masterSecret, claim, poolId, requiredChallengeIds, frameDetails, metaspace, space, }: {
|
|
27
|
+
sign({ latestKeystone, masterSecret, claim, poolId, poolFilter, requiredChallengeIds, frameDetails, metaspace, space, }: {
|
|
25
28
|
latestKeystone: KeystoneIbGib_V1;
|
|
29
|
+
/**
|
|
30
|
+
* The secret used to solve the challenges.
|
|
31
|
+
* If signing with a native pool, this is the User's Master Secret.
|
|
32
|
+
* If signing with a foreign/delegated pool, this is the Delegate's Secret.
|
|
33
|
+
*/
|
|
26
34
|
masterSecret: string;
|
|
27
35
|
claim: Partial<KeystoneClaim>;
|
|
36
|
+
/**
|
|
37
|
+
* Explicit ID of the pool to use.
|
|
38
|
+
*/
|
|
28
39
|
poolId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Optional predicate to find a pool.
|
|
42
|
+
* Useful for finding delegates via metadata without knowing the exact ID.
|
|
43
|
+
* e.g. (p) => p.metadata?.delegate === 'Bob'
|
|
44
|
+
*/
|
|
45
|
+
poolFilter?: (pool: KeystoneChallengePool) => boolean;
|
|
29
46
|
requiredChallengeIds?: string[];
|
|
30
47
|
frameDetails?: any;
|
|
31
48
|
metaspace: MetaspaceService;
|
|
@@ -51,8 +68,9 @@ export declare class KeystoneService_V1 {
|
|
|
51
68
|
*
|
|
52
69
|
* Logic:
|
|
53
70
|
* 1. Locates the 'revoke' pool.
|
|
54
|
-
* 2.
|
|
55
|
-
* 3.
|
|
71
|
+
* 2. Solves required challenges to prove ownership.
|
|
72
|
+
* 3. Wipes the pool (via 'scorched-earth' strategy in solveAndReplenish).
|
|
73
|
+
* 4. Sets the revocationInfo on the new frame.
|
|
56
74
|
*/
|
|
57
75
|
revoke({ latestKeystone, masterSecret, reason, frameDetails, metaspace, space, }: {
|
|
58
76
|
latestKeystone: KeystoneIbGib_V1;
|
|
@@ -60,18 +78,33 @@ export declare class KeystoneService_V1 {
|
|
|
60
78
|
reason?: string;
|
|
61
79
|
frameDetails?: any;
|
|
62
80
|
metaspace: MetaspaceService;
|
|
63
|
-
space
|
|
81
|
+
space: IbGibSpaceAny;
|
|
64
82
|
}): Promise<KeystoneIbGib_V1>;
|
|
65
83
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
84
|
+
* Structural evolution: Adds new challenge pools to the keystone.
|
|
85
|
+
*
|
|
86
|
+
* Use Case: Adding a delegate (Server) for SSO, adding a recovery key,
|
|
87
|
+
* or rotating to a new set of pools.
|
|
88
|
+
*
|
|
89
|
+
* Requires the Master Secret to authorize the change via a pool containing
|
|
90
|
+
* the 'manage' verb.
|
|
73
91
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
addPools({ latestKeystone, masterSecret, newPools, metaspace, space, }: {
|
|
93
|
+
latestKeystone: KeystoneIbGib_V1;
|
|
94
|
+
/**
|
|
95
|
+
* Alice's Master Secret.
|
|
96
|
+
* Required to solve challenges from the Admin/Manage pool to authorize this change.
|
|
97
|
+
*/
|
|
98
|
+
masterSecret: string;
|
|
99
|
+
/**
|
|
100
|
+
* The pools to add.
|
|
101
|
+
* NOTE: These are fully constructed Pool objects.
|
|
102
|
+
* If they are foreign (Bob's), Alice must have constructed them
|
|
103
|
+
* using Bob's challenges + Her config restrictions + isForeign=true.
|
|
104
|
+
*/
|
|
105
|
+
newPools: KeystoneChallengePool[];
|
|
106
|
+
metaspace: MetaspaceService;
|
|
107
|
+
space: IbGibSpaceAny;
|
|
108
|
+
}): Promise<KeystoneIbGib_V1>;
|
|
76
109
|
}
|
|
77
110
|
//# sourceMappingURL=keystone-service-v1.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keystone-service-v1.d.mts","sourceRoot":"","sources":["../../src/keystone/keystone-service-v1.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keystone-service-v1.d.mts","sourceRoot":"","sources":["../../src/keystone/keystone-service-v1.mts"],"names":[],"mappings":"AAIA,OAAO,EACc,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,EACpE,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAIlF;;;;GAIG;AACH,qBAAa,kBAAkB;IAC3B,SAA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