@ibgib/core-gib 0.1.62 → 0.1.64
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-constants.d.mts +1 -0
- package/dist/keystone/keystone-constants.d.mts.map +1 -1
- package/dist/keystone/keystone-constants.mjs +1 -0
- package/dist/keystone/keystone-constants.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts +19 -1
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +191 -16
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.d.mts +84 -2
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +324 -28
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +447 -2
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +31 -2
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/keystone/keystone-types.mjs +13 -0
- package/dist/keystone/keystone-types.mjs.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 +69 -0
- package/dist/keystone/policy/profiles/profile-sync.json +84 -0
- package/dist/keystone/policy/schemas/keystone.high.schema.json +1 -1
- package/dist/keystone/policy/schemas/keystone.medium.schema.json +1 -1
- 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 +2 -2
- package/src/keystone/keystone-constants.mts +1 -0
- package/src/keystone/keystone-helpers.mts +223 -15
- package/src/keystone/keystone-service-v1.mts +391 -28
- package/src/keystone/keystone-service-v1.respec.mts +1990 -1479
- package/src/keystone/keystone-types.mts +48 -2
- package/src/keystone/policy/keystone-profile-builder.mts +9 -1
- package/src/keystone/policy/profiles/profile-domain.json +69 -0
- package/src/keystone/policy/profiles/profile-sync.json +84 -0
- package/src/keystone/policy/schemas/keystone.high.schema.json +1 -1
- package/src/keystone/policy/schemas/keystone.medium.schema.json +1 -1
- 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 +0 -311
|
@@ -256,6 +256,47 @@ export interface KeystoneChallengePool {
|
|
|
256
256
|
metadata?: any;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
// #region KeystoneClaimType enum
|
|
260
|
+
export const KEYSTONE_CLAIM_TYPE_ADD_POOL = 'add-pool';
|
|
261
|
+
export const KEYSTONE_CLAIM_TYPE_REPLACE_POOL = 'replace-pool';
|
|
262
|
+
export const KEYSTONE_CLAIM_TYPE_CHANGE_PASSWORD = 'change-password';
|
|
263
|
+
|
|
264
|
+
export type KeystoneClaimType =
|
|
265
|
+
| typeof KEYSTONE_CLAIM_TYPE_ADD_POOL
|
|
266
|
+
| typeof KEYSTONE_CLAIM_TYPE_REPLACE_POOL
|
|
267
|
+
| typeof KEYSTONE_CLAIM_TYPE_CHANGE_PASSWORD
|
|
268
|
+
;
|
|
269
|
+
|
|
270
|
+
export const KeystoneClaimType = {
|
|
271
|
+
add_pool: KEYSTONE_CLAIM_TYPE_ADD_POOL,
|
|
272
|
+
replace_pool: KEYSTONE_CLAIM_TYPE_REPLACE_POOL,
|
|
273
|
+
change_password: KEYSTONE_CLAIM_TYPE_CHANGE_PASSWORD,
|
|
274
|
+
} satisfies { readonly [key: string]: KeystoneClaimType };
|
|
275
|
+
|
|
276
|
+
export const KEYSTONE_CLAIM_TYPE_VALID_VALUES: KeystoneClaimType[] = Object.values(KeystoneClaimType);
|
|
277
|
+
|
|
278
|
+
export function isKeystoneClaimType(value: any): value is KeystoneClaimType {
|
|
279
|
+
return typeof value === 'string' && KEYSTONE_CLAIM_TYPE_VALID_VALUES.includes(value as any);
|
|
280
|
+
}
|
|
281
|
+
// #endregion KeystoneClaimType enum
|
|
282
|
+
|
|
283
|
+
export interface ClaimDetails {
|
|
284
|
+
type: KeystoneClaimType;
|
|
285
|
+
info: any;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface ClaimDetails_AddPool {
|
|
289
|
+
add: string[];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface ClaimDetails_ReplacePool {
|
|
293
|
+
replace: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface ClaimDetails_ChangePassword {
|
|
297
|
+
change: string[];
|
|
298
|
+
}
|
|
299
|
+
|
|
259
300
|
/**
|
|
260
301
|
* Describes the specific privilege that the evolution of the keystone
|
|
261
302
|
* authorizes.
|
|
@@ -277,9 +318,9 @@ export interface KeystoneClaim {
|
|
|
277
318
|
*/
|
|
278
319
|
target: IbGibAddr;
|
|
279
320
|
/**
|
|
280
|
-
*
|
|
321
|
+
* Detailed information describing the nature of the keystone evolution/transition.
|
|
281
322
|
*/
|
|
282
|
-
|
|
323
|
+
details?: ClaimDetails;
|
|
283
324
|
}
|
|
284
325
|
|
|
285
326
|
/**
|
|
@@ -342,6 +383,11 @@ export interface DelegateKeystoneInfo {
|
|
|
342
383
|
* `tjpGib` in its `GibInfo`.
|
|
343
384
|
*/
|
|
344
385
|
thisAddr: IbGibAddr;
|
|
386
|
+
/**
|
|
387
|
+
* Optional list of verbs allowed for this delegate.
|
|
388
|
+
* e.g. ["sync^gib"]
|
|
389
|
+
*/
|
|
390
|
+
allowedVerbs?: string[];
|
|
345
391
|
}
|
|
346
392
|
|
|
347
393
|
/**
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schemas/keystone.high.schema.json",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "Domain Identity Profile",
|
|
5
|
+
"securityLevel": "high"
|
|
6
|
+
},
|
|
7
|
+
"pools": {
|
|
8
|
+
"sync": {
|
|
9
|
+
"id": "sync",
|
|
10
|
+
"allowedVerbs": [
|
|
11
|
+
"sync"
|
|
12
|
+
],
|
|
13
|
+
"algo": "SHA-512",
|
|
14
|
+
"rounds": 4,
|
|
15
|
+
"behavior": {
|
|
16
|
+
"size": 2000,
|
|
17
|
+
"replenish": "top-up",
|
|
18
|
+
"selectSequentially": 10,
|
|
19
|
+
"selectRandomly": 10,
|
|
20
|
+
"targetBindingCount": 16
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"manage": {
|
|
24
|
+
"id": "manage",
|
|
25
|
+
"allowedVerbs": [
|
|
26
|
+
"manage"
|
|
27
|
+
],
|
|
28
|
+
"algo": "SHA-512",
|
|
29
|
+
"rounds": 6,
|
|
30
|
+
"behavior": {
|
|
31
|
+
"size": 2000,
|
|
32
|
+
"replenish": "replace-all",
|
|
33
|
+
"selectSequentially": 12,
|
|
34
|
+
"selectRandomly": 12,
|
|
35
|
+
"targetBindingCount": 16
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"revoke": {
|
|
39
|
+
"id": "revoke",
|
|
40
|
+
"allowedVerbs": [
|
|
41
|
+
"revoke"
|
|
42
|
+
],
|
|
43
|
+
"algo": "SHA-512",
|
|
44
|
+
"rounds": 20,
|
|
45
|
+
"behavior": {
|
|
46
|
+
"size": 2000,
|
|
47
|
+
"replenish": "delete-all",
|
|
48
|
+
"selectSequentially": 50,
|
|
49
|
+
"selectRandomly": 50,
|
|
50
|
+
"targetBindingCount": 0
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"sign": {
|
|
54
|
+
"id": "default",
|
|
55
|
+
"allowedVerbs": [
|
|
56
|
+
"sign"
|
|
57
|
+
],
|
|
58
|
+
"algo": "SHA-512",
|
|
59
|
+
"rounds": 4,
|
|
60
|
+
"behavior": {
|
|
61
|
+
"size": 2000,
|
|
62
|
+
"replenish": "top-up",
|
|
63
|
+
"selectSequentially": 10,
|
|
64
|
+
"selectRandomly": 10,
|
|
65
|
+
"targetBindingCount": 16
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schemas/keystone.low.schema.json",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "Sync Delegate Profile",
|
|
5
|
+
"securityLevel": "low"
|
|
6
|
+
},
|
|
7
|
+
"pools": {
|
|
8
|
+
"sync": {
|
|
9
|
+
"id": "sync",
|
|
10
|
+
"allowedVerbs": [
|
|
11
|
+
"sync"
|
|
12
|
+
],
|
|
13
|
+
"algo": "SHA-256",
|
|
14
|
+
"rounds": 1,
|
|
15
|
+
"behavior": {
|
|
16
|
+
"size": 100,
|
|
17
|
+
"replenish": "top-up",
|
|
18
|
+
"selectSequentially": 3,
|
|
19
|
+
"selectRandomly": 3,
|
|
20
|
+
"targetBindingCount": 8
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"manage": {
|
|
24
|
+
"id": "manage",
|
|
25
|
+
"allowedVerbs": [
|
|
26
|
+
"manage"
|
|
27
|
+
],
|
|
28
|
+
"algo": "SHA-256",
|
|
29
|
+
"rounds": 2,
|
|
30
|
+
"behavior": {
|
|
31
|
+
"size": 100,
|
|
32
|
+
"replenish": "replace-all",
|
|
33
|
+
"selectSequentially": 3,
|
|
34
|
+
"selectRandomly": 3,
|
|
35
|
+
"targetBindingCount": 8
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"revoke": {
|
|
39
|
+
"id": "revoke",
|
|
40
|
+
"allowedVerbs": [
|
|
41
|
+
"revoke"
|
|
42
|
+
],
|
|
43
|
+
"algo": "SHA-256",
|
|
44
|
+
"rounds": 5,
|
|
45
|
+
"behavior": {
|
|
46
|
+
"size": 100,
|
|
47
|
+
"replenish": "delete-all",
|
|
48
|
+
"selectSequentially": 3,
|
|
49
|
+
"selectRandomly": 3,
|
|
50
|
+
"targetBindingCount": 0
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"connect": {
|
|
54
|
+
"id": "connect",
|
|
55
|
+
"allowedVerbs": [
|
|
56
|
+
"connect"
|
|
57
|
+
],
|
|
58
|
+
"algo": "SHA-256",
|
|
59
|
+
"rounds": 1,
|
|
60
|
+
"behavior": {
|
|
61
|
+
"size": 100,
|
|
62
|
+
"replenish": "top-up",
|
|
63
|
+
"selectSequentially": 3,
|
|
64
|
+
"selectRandomly": 3,
|
|
65
|
+
"targetBindingCount": 8
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"sign": {
|
|
69
|
+
"id": "default",
|
|
70
|
+
"allowedVerbs": [
|
|
71
|
+
"sign"
|
|
72
|
+
],
|
|
73
|
+
"algo": "SHA-256",
|
|
74
|
+
"rounds": 2,
|
|
75
|
+
"behavior": {
|
|
76
|
+
"size": 100,
|
|
77
|
+
"replenish": "top-up",
|
|
78
|
+
"selectSequentially": 3,
|
|
79
|
+
"selectRandomly": 3,
|
|
80
|
+
"targetBindingCount": 8
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"connect": { "$ref": "./connect-pool.high.schema.json" },
|
|
20
20
|
"sign": { "$ref": "./sign-pool.high.schema.json" }
|
|
21
21
|
},
|
|
22
|
-
"required": ["
|
|
22
|
+
"required": ["manage", "revoke", "sign"]
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"required": ["pools"]
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"connect": { "$ref": "./connect-pool.medium.schema.json" },
|
|
20
20
|
"sign": { "$ref": "./sign-pool.medium.schema.json" }
|
|
21
21
|
},
|
|
22
|
-
"required": ["
|
|
22
|
+
"required": ["manage", "revoke", "sign"]
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"required": ["pools"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hash } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
1
|
+
import { hash, HashAlgorithm } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
2
2
|
|
|
3
3
|
import { KeystoneStrategy } from '../keystone-strategy.mjs';
|
|
4
4
|
import {
|
|
@@ -140,3 +140,22 @@ export class KeystoneStrategy_HashRevealV1 extends KeystoneStrategy<
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Derives a delegate secret from the parent's masterSecret using KDF.
|
|
146
|
+
* Salt is the sha512 hash of the masterSecret.
|
|
147
|
+
* Number of rounds is hardcoded to 1000.
|
|
148
|
+
*/
|
|
149
|
+
export async function deriveDelegateSecret({
|
|
150
|
+
masterSecret,
|
|
151
|
+
}: {
|
|
152
|
+
masterSecret: string;
|
|
153
|
+
}): Promise<string> {
|
|
154
|
+
const salt = await hash({ s: masterSecret, algorithm: HashAlgorithm.sha_512 });
|
|
155
|
+
return await kdf_recursiveSaltWrap({
|
|
156
|
+
masterSecret,
|
|
157
|
+
salt,
|
|
158
|
+
rounds: 1000,
|
|
159
|
+
algorithm: HashAlgorithm.sha_512
|
|
160
|
+
});
|
|
161
|
+
}
|
|
@@ -178,7 +178,10 @@ await respecfully(sir, `Multi-round/timeline permutations with Identity`, async
|
|
|
178
178
|
metaspace,
|
|
179
179
|
domainIbGibs: [r1_alpha_v1_source_common.ibGib],
|
|
180
180
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
181
|
-
|
|
181
|
+
senderIdentityInfo: {
|
|
182
|
+
senderIdentity: senderIdentityLatestSource,
|
|
183
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
184
|
+
},
|
|
182
185
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
183
186
|
});
|
|
184
187
|
|
|
@@ -300,7 +303,10 @@ await respecfully(sir, `Multi-round/timeline permutations with Identity`, async
|
|
|
300
303
|
metaspace,
|
|
301
304
|
domainIbGibs: [r2_alpha_v3_source_rel8dBeta.ibGib],
|
|
302
305
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
303
|
-
|
|
306
|
+
senderIdentityInfo: {
|
|
307
|
+
senderIdentity: senderIdentityLatestSource,
|
|
308
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
309
|
+
},
|
|
304
310
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
305
311
|
});
|
|
306
312
|
await r2_syncSaga.done;
|
|
@@ -449,7 +455,10 @@ await respecfully(sir, `Multi-round/timeline permutations with Identity`, async
|
|
|
449
455
|
metaspace,
|
|
450
456
|
domainIbGibs: [r3_alpha_v4_source_mut8fieldC.ibGib, r3_beta_v1_source.ibGib],
|
|
451
457
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
452
|
-
|
|
458
|
+
senderIdentityInfo: {
|
|
459
|
+
senderIdentity: senderIdentityLatestSource,
|
|
460
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
461
|
+
},
|
|
453
462
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
454
463
|
});
|
|
455
464
|
await r3_syncSaga.done;
|
|
@@ -625,7 +634,10 @@ await respecfully(sir, `Multi-round/timeline permutations with Identity`, async
|
|
|
625
634
|
metaspace,
|
|
626
635
|
domainIbGibs: [r4_alpha_v7_source.ibGib, r4_gamma_v0_source.ibGib, r4_beta_v2_source.ibGib],
|
|
627
636
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
628
|
-
|
|
637
|
+
senderIdentityInfo: {
|
|
638
|
+
senderIdentity: senderIdentityLatestSource,
|
|
639
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
640
|
+
},
|
|
629
641
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
630
642
|
});
|
|
631
643
|
await r4_syncSaga.done;
|
|
@@ -221,7 +221,10 @@ await respecfully(sir, `Sync Conflict Basic Divergence with Identity`, async ()
|
|
|
221
221
|
metaspace,
|
|
222
222
|
domainIbGibs: [v2a],
|
|
223
223
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
224
|
-
|
|
224
|
+
senderIdentityInfo: {
|
|
225
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
226
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
227
|
+
},
|
|
225
228
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
226
229
|
});
|
|
227
230
|
await resSync.done;
|
|
@@ -254,7 +254,10 @@ await respecfully(sir, `Sync Conflict Basic Multitimelines with Identity`, async
|
|
|
254
254
|
metaspace,
|
|
255
255
|
domainIbGibs: [alpha_v3_source_rel8beta],
|
|
256
256
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
257
|
-
|
|
257
|
+
senderIdentityInfo: {
|
|
258
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
259
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
260
|
+
},
|
|
258
261
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
259
262
|
});
|
|
260
263
|
await resSync.done;
|
|
@@ -150,9 +150,12 @@ await respecfully(sir, `Text merge (LCS) conflict resolution with Identity`, asy
|
|
|
150
150
|
localSpace: sourceSpace,
|
|
151
151
|
metaspace,
|
|
152
152
|
domainIbGibs: [r1_alpha_v0_source.ibGib],
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
senderIdentityInfo: {
|
|
154
|
+
senderIdentity: senderIdentityLatestSource,
|
|
155
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
156
|
+
},
|
|
155
157
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
158
|
+
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
156
159
|
});
|
|
157
160
|
await r1_syncSaga.done;
|
|
158
161
|
if (logalot) { console.log(`${lc} R1 Sync Complete.`); }
|
|
@@ -286,9 +289,12 @@ await respecfully(sir, `Text merge (LCS) conflict resolution with Identity`, asy
|
|
|
286
289
|
localSpace: sourceSpace,
|
|
287
290
|
metaspace,
|
|
288
291
|
domainIbGibs: [r2_alpha_v1_source_appendedText.ibGib],
|
|
289
|
-
|
|
290
|
-
|
|
292
|
+
senderIdentityInfo: {
|
|
293
|
+
senderIdentity: senderIdentityLatestSource,
|
|
294
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
295
|
+
},
|
|
291
296
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
297
|
+
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
292
298
|
});
|
|
293
299
|
await r2_syncSaga.done;
|
|
294
300
|
} catch (e) {
|
|
@@ -134,7 +134,10 @@ await respecfully(sir, `Sync Constants (No TJP) with Identity`, async () => {
|
|
|
134
134
|
localSpace: sourceSpace,
|
|
135
135
|
metaspace: metaspace,
|
|
136
136
|
domainIbGibs: [r1_c1_v0_source],
|
|
137
|
-
|
|
137
|
+
senderIdentityInfo: {
|
|
138
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
139
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
140
|
+
},
|
|
138
141
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
139
142
|
});
|
|
140
143
|
await resSync.done;
|
|
@@ -153,7 +156,10 @@ await respecfully(sir, `Sync Constants (No TJP) with Identity`, async () => {
|
|
|
153
156
|
localSpace: sourceSpace,
|
|
154
157
|
metaspace: metaspace,
|
|
155
158
|
domainIbGibs: [r1_c1_v0_source],
|
|
156
|
-
|
|
159
|
+
senderIdentityInfo: {
|
|
160
|
+
senderIdentity: r1_senderIdentity_v1_source_postSync1,
|
|
161
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
162
|
+
},
|
|
157
163
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
158
164
|
});
|
|
159
165
|
await resSync.done;
|
|
@@ -183,7 +189,10 @@ await respecfully(sir, `Sync Constants (No TJP) with Identity`, async () => {
|
|
|
183
189
|
localSpace: sourceSpace,
|
|
184
190
|
metaspace: metaspace,
|
|
185
191
|
domainIbGibs: [r1_c2_v0_source_rel8C1],
|
|
186
|
-
|
|
192
|
+
senderIdentityInfo: {
|
|
193
|
+
senderIdentity: r1_senderIdentity_v2_source_postSync2,
|
|
194
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
195
|
+
},
|
|
187
196
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
188
197
|
});
|
|
189
198
|
await resSync.done;
|
|
@@ -162,7 +162,10 @@ await respecfully(sir, `Sync InnerSpaces (Deep Updates) with Identity`, async ()
|
|
|
162
162
|
localSpace: sourceSpace,
|
|
163
163
|
metaspace: metaspace,
|
|
164
164
|
domainIbGibs: [r1_alpha_v2_source],
|
|
165
|
-
|
|
165
|
+
senderIdentityInfo: {
|
|
166
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
167
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
168
|
+
},
|
|
166
169
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
167
170
|
});
|
|
168
171
|
await resSync.done;
|
|
@@ -184,7 +184,10 @@ await respecfully(sir, `Sync InnerSpaces (Dest Ahead) with Identity`, async () =
|
|
|
184
184
|
localSpace: sourceSpace,
|
|
185
185
|
metaspace: metaspace,
|
|
186
186
|
domainIbGibs: [r1_alpha_v1_source],
|
|
187
|
-
|
|
187
|
+
senderIdentityInfo: {
|
|
188
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
189
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
190
|
+
},
|
|
188
191
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
189
192
|
});
|
|
190
193
|
await resSync.done;
|
|
@@ -175,7 +175,10 @@ await respecfully(sir, `Sync InnerSpaces (Multiple Timelines) with Identity`, as
|
|
|
175
175
|
localSpace: sourceSpace,
|
|
176
176
|
metaspace: metaspace,
|
|
177
177
|
domainIbGibs: [r1_alpha_v1_source, r1_beta_v2_source],
|
|
178
|
-
|
|
178
|
+
senderIdentityInfo: {
|
|
179
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
180
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
181
|
+
},
|
|
179
182
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
180
183
|
});
|
|
181
184
|
await resSync.done;
|
|
@@ -163,7 +163,10 @@ await respecfully(sir, `Sync InnerSpaces (Partial Update) with Identity`, async
|
|
|
163
163
|
localSpace: sourceSpace,
|
|
164
164
|
metaspace: metaspace,
|
|
165
165
|
domainIbGibs: [r1_alpha_v2_source],
|
|
166
|
-
|
|
166
|
+
senderIdentityInfo: {
|
|
167
|
+
senderIdentity: r1_senderIdentity_v0_source,
|
|
168
|
+
senderDomainAddr: getIbGibAddr({ ibGib: r1_senderIdentity_v0_source }),
|
|
169
|
+
},
|
|
167
170
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
168
171
|
});
|
|
169
172
|
await resSync.done;
|
|
@@ -152,7 +152,10 @@ await respecfully(sir, `Sync InnerSpaces with Identity`, async () => {
|
|
|
152
152
|
localSpace: sourceSpace,
|
|
153
153
|
metaspace: metaspace,
|
|
154
154
|
domainIbGibs: [r1_alpha_v1_source], // Sync the child
|
|
155
|
-
|
|
155
|
+
senderIdentityInfo: {
|
|
156
|
+
senderIdentity,
|
|
157
|
+
senderDomainAddr: getIbGibAddr({ ibGib: senderIdentity }),
|
|
158
|
+
},
|
|
156
159
|
fnSenderSecret: async () => SENDER_SECRET,
|
|
157
160
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
158
161
|
});
|
|
@@ -89,6 +89,10 @@ export interface InitializeSyncPeerOpts {
|
|
|
89
89
|
* together or omitted together.
|
|
90
90
|
*/
|
|
91
91
|
senderIdentity?: KeystoneIbGib_V1;
|
|
92
|
+
/**
|
|
93
|
+
* The root Domain Identity address associated with the senderIdentity delegate.
|
|
94
|
+
*/
|
|
95
|
+
senderDomainAddr?: string;
|
|
92
96
|
/**
|
|
93
97
|
* Returns the plaintext secret corresponding to {@link senderIdentity}.
|
|
94
98
|
* Wrapped in a function to avoid holding the secret in memory longer than needed.
|
|
@@ -224,13 +224,17 @@ export abstract class SyncPeer_V1<
|
|
|
224
224
|
|
|
225
225
|
if (!this.opts) { throw new Error(`(UNEXPECTED) this.opts falsy? Call initializeOpts first. (E: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c526)`); }
|
|
226
226
|
|
|
227
|
-
const { senderIdentity, fnSenderSecret, sagaId, localMetaspace, localSpace } = this.opts;
|
|
227
|
+
const { senderIdentity, fnSenderSecret, senderDomainAddr, sagaId, localMetaspace, localSpace } = this.opts;
|
|
228
228
|
|
|
229
229
|
// No identity provided — anonymous sync, nothing to establish.
|
|
230
230
|
if (!senderIdentity || !fnSenderSecret) {
|
|
231
231
|
if (logalot) { console.log(`${lc} no senderIdentity/fnSenderSecret — skipping establish (I: f29348a77d1542326d14043ea4b69126)`); }
|
|
232
232
|
return undefined;
|
|
233
233
|
}
|
|
234
|
+
|
|
235
|
+
if (!senderDomainAddr) {
|
|
236
|
+
throw new Error(`(UNEXPECTED) senderDomainAddr falsy but senderIdentity/fnSenderSecret truthy? if identity is used, senderDomainAddr must be provided. (E: c288fa8e9d3d82fc)`);
|
|
237
|
+
}
|
|
234
238
|
const senderIdentityAddr = getIbGibAddr({ ibGib: senderIdentity });
|
|
235
239
|
const senderIdentityTjpAddr = getTjpAddr({ ibGib: senderIdentity });
|
|
236
240
|
if (!senderIdentityTjpAddr) { throw new Error(`(UNEXPECTED) senderIdentityTjpAddr falsy? (E: d5d8c3ab25a83a2c127904fe96de1526)`); }
|