@interop/wallet-core 0.107.1 → 0.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -24
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +3 -3
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +3 -3
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +10 -9
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +23 -19
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +5 -5
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +1 -1
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +10 -10
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +4 -4
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +6 -6
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +13 -10
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +21 -19
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +25 -22
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +40 -32
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +33 -44
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +62 -61
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +68 -67
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +22 -16
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +4 -3
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +3 -3
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +6 -7
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clientAnnex/spaceCapability.d.ts +6 -6
- package/dist/clientAnnex/spaceCapability.d.ts.map +1 -1
- package/dist/clientAnnex/spaceCapability.js +9 -12
- package/dist/clientAnnex/spaceCapability.js.map +1 -1
- package/dist/clients/index.d.ts +1 -1
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/listing.d.ts +12 -18
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +17 -13
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +2 -2
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +4 -4
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +5 -4
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/connections/entry.d.ts +100 -9
- package/dist/connections/entry.d.ts.map +1 -1
- package/dist/connections/entry.js +104 -12
- package/dist/connections/entry.js.map +1 -1
- package/dist/connections/grantProof.d.ts.map +1 -1
- package/dist/connections/grantProof.js +4 -5
- package/dist/connections/grantProof.js.map +1 -1
- package/dist/connections/grants.d.ts.map +1 -1
- package/dist/connections/grants.js +3 -5
- package/dist/connections/grants.js.map +1 -1
- package/dist/connections/index.d.ts +9 -5
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +7 -4
- package/dist/connections/index.js.map +1 -1
- package/dist/connections/replicas.d.ts +227 -0
- package/dist/connections/replicas.d.ts.map +1 -0
- package/dist/connections/replicas.js +539 -0
- package/dist/connections/replicas.js.map +1 -0
- package/dist/connections/upsert.d.ts +75 -1
- package/dist/connections/upsert.d.ts.map +1 -1
- package/dist/connections/upsert.js +62 -34
- package/dist/connections/upsert.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +4 -5
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +4 -4
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +4 -4
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/keyring/fetch.d.ts +3 -3
- package/dist/keyring/fetch.d.ts.map +1 -1
- package/dist/keyring/fetch.js +3 -3
- package/dist/keyring/fetch.js.map +1 -1
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +1 -2
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/recordEnvelope.d.ts +8 -6
- package/dist/keyring/recordEnvelope.d.ts.map +1 -1
- package/dist/keyring/recordEnvelope.js +12 -6
- package/dist/keyring/recordEnvelope.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +15 -15
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +18 -19
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/collectionLogStore.d.ts +3 -3
- package/dist/keys/collectionLogStore.d.ts.map +1 -1
- package/dist/keys/collectionLogStore.js +5 -7
- package/dist/keys/collectionLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -3
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +3 -4
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/recovery/continuation.d.ts +3 -9
- package/dist/recovery/continuation.d.ts.map +1 -1
- package/dist/recovery/continuation.js +1 -3
- package/dist/recovery/continuation.js.map +1 -1
- package/dist/recovery/index.d.ts +2 -1
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +2 -21
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +21 -15
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +12 -7
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/space/collections.d.ts +2 -2
- package/dist/space/collections.js +2 -2
- package/dist/space/deleteSpace.d.ts +3 -3
- package/dist/space/deleteSpace.d.ts.map +1 -1
- package/dist/space/deleteSpace.js +3 -4
- package/dist/space/deleteSpace.js.map +1 -1
- package/dist/space/errors.d.ts +1 -1
- package/dist/space/errors.js +1 -1
- package/dist/space/index.d.ts +4 -4
- package/dist/space/index.js +3 -3
- package/dist/space/provisioning.d.ts.map +1 -1
- package/dist/space/provisioning.js +6 -5
- package/dist/space/provisioning.js.map +1 -1
- package/dist/space/publicLink.d.ts +4 -4
- package/dist/space/publicLink.d.ts.map +1 -1
- package/dist/space/publicLink.js +9 -8
- package/dist/space/publicLink.js.map +1 -1
- package/dist/space/pwsLink.d.ts +58 -0
- package/dist/space/pwsLink.d.ts.map +1 -0
- package/dist/space/{wasLink.js → pwsLink.js} +42 -37
- package/dist/space/pwsLink.js.map +1 -0
- package/dist/testing/accountBuilder.d.ts +19 -19
- package/dist/testing/accountBuilder.d.ts.map +1 -1
- package/dist/testing/accountBuilder.js +45 -43
- package/dist/testing/accountBuilder.js.map +1 -1
- package/dist/unlock/index.d.ts +2 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/retire.d.ts +7 -5
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +5 -4
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +24 -15
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +32 -19
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +7 -7
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +39 -50
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +133 -55
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/clientAnnexDid.d.ts +21 -14
- package/dist/webvh/clientAnnexDid.d.ts.map +1 -1
- package/dist/webvh/clientAnnexDid.js +19 -14
- package/dist/webvh/clientAnnexDid.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +7 -14
- package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
- package/dist/webvh/delegatedLogStore.js +10 -9
- package/dist/webvh/delegatedLogStore.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +30 -49
- package/dist/webvh/didWebProjection.d.ts.map +1 -1
- package/dist/webvh/didWebProjection.js +9 -56
- package/dist/webvh/didWebProjection.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +19 -33
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +30 -41
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +5 -3
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +12 -10
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +2 -2
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +1 -1
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/logLocation.d.ts +75 -0
- package/dist/webvh/logLocation.d.ts.map +1 -0
- package/dist/webvh/logLocation.js +102 -0
- package/dist/webvh/logLocation.js.map +1 -0
- package/dist/webvh/revokeClient.d.ts +10 -4
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +22 -22
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +9 -18
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +43 -50
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +7 -7
- package/dist/space/wasLink.d.ts +0 -57
- package/dist/space/wasLink.d.ts.map +0 -1
- package/dist/space/wasLink.js.map +0 -1
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
* the write.
|
|
14
14
|
*
|
|
15
15
|
* The ensure exists because the projection is NOT republished by every entry.
|
|
16
|
-
*
|
|
17
|
-
* `did.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* The account-entry seam writes `did.jsonl` through the log store alone and
|
|
17
|
+
* PUTs `did.json` only through a projection store its caller hands in, and a
|
|
18
|
+
* caller holding a standing unlock credential's bridge delegation (a PUT on
|
|
19
|
+
* exactly `did.jsonl`) has none to hand. So after a ladder-signed removal or
|
|
20
|
+
* retirement (the last-client transition, a transient recovery) the served
|
|
20
21
|
* projection can still publish a verification method the log has struck, and
|
|
21
22
|
* a `did:web` resolver reading it accepts a key the account revoked. The
|
|
22
23
|
* account's own WAS authorization is unaffected -- the server resolves the
|
|
@@ -46,63 +47,44 @@
|
|
|
46
47
|
* No wire artifact of its own: the resource id, the content type, and the
|
|
47
48
|
* document shape are the ones `publishWebvhLog` already writes.
|
|
48
49
|
*/
|
|
49
|
-
import type { DIDDoc
|
|
50
|
+
import type { DIDDoc } from '@interop/did-method-webvh';
|
|
50
51
|
import type { WebvhIdStore } from './didWebvh.js';
|
|
52
|
+
/**
|
|
53
|
+
* The store a `did:web` projection is read and written through: the raw
|
|
54
|
+
* `id`-collection read plus the `did.json` PUT. A subset of
|
|
55
|
+
* {@link WebvhIdStore}. The shape alone cannot tell a store that may write
|
|
56
|
+
* `did.json` from one whose delegation covers `did.jsonl` alone, so naming
|
|
57
|
+
* it at a parameter states the requirement: a caller hands one in only when
|
|
58
|
+
* its authority reaches the projection. An enrolled client passes its own
|
|
59
|
+
* controller-invoking store (`wasWebvhIdStore`); the establishment's root
|
|
60
|
+
* window passes its root-invoking store; a transient visit under a
|
|
61
|
+
* generation delegation passes that `delegatedWebvhLogStore`; a writer
|
|
62
|
+
* holding only the account log's bridge delegation omits it.
|
|
63
|
+
*/
|
|
64
|
+
export type DidWebProjectionStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
51
65
|
/**
|
|
52
66
|
* Writes the `did:web` projection into the `id` collection: `did.json`, under
|
|
53
67
|
* the `application/did+json` content type. The single PUT site, so the
|
|
54
68
|
* resource id and content type cannot drift between the publish tails and the
|
|
55
69
|
* freshness ensure.
|
|
56
70
|
*
|
|
57
|
-
* Unconditional by design at every publish-tail caller: the
|
|
58
|
-
* serialized behind a won `did.jsonl`
|
|
59
|
-
*
|
|
71
|
+
* Unconditional by design at every publish-tail caller: on the seam's
|
|
72
|
+
* `'after'` timing the write is serialized behind a won `did.jsonl`
|
|
73
|
+
* compare-and-swap, and on its `'before'` timing a losing attempt's PUT is
|
|
74
|
+
* overwritten by the retry's own. The projection is a derived cache of a log
|
|
75
|
+
* that is itself the source of truth.
|
|
60
76
|
*
|
|
61
77
|
* @param options {object}
|
|
62
|
-
* @param options.store {
|
|
78
|
+
* @param options.store {DidWebProjectionStore}
|
|
63
79
|
* @param options.webDoc {object} the projection to publish, from
|
|
64
80
|
* `generateParallelDidWeb` (or `updateDID`'s `webDoc`, which is the same
|
|
65
81
|
* document)
|
|
66
82
|
* @returns {Promise<void>}
|
|
67
83
|
*/
|
|
68
84
|
export declare function putDidWebProjection({ store, webDoc }: {
|
|
69
|
-
store:
|
|
85
|
+
store: DidWebProjectionStore;
|
|
70
86
|
webDoc: object;
|
|
71
87
|
}): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* The pre-entry projection publisher: a `beforePublish` hook for
|
|
74
|
-
* `signAccountEntry`, which PUTs the post-entry `did:web` projection through
|
|
75
|
-
* the caller's store immediately before the entry itself publishes.
|
|
76
|
-
*
|
|
77
|
-
* A strike entry (a client revocation, a credential retirement, a recovery
|
|
78
|
-
* code's removal) signed by a standing credential's ladder writes `did.jsonl`
|
|
79
|
-
* alone, the bridge delegation's whole reach, so nothing in that ceremony
|
|
80
|
-
* republishes `did.json` and the served projection keeps naming the struck
|
|
81
|
-
* client or credential. A caller holding a store that may write the `id`
|
|
82
|
-
* collection -- a transient session under its generation delegation, an
|
|
83
|
-
* enrolled client under its own root authority -- hands one in and the
|
|
84
|
-
* projection lands with the entry.
|
|
85
|
-
*
|
|
86
|
-
* BEST-EFFORT, and the direction is deliberate. A failed PUT is warned and
|
|
87
|
-
* the entry publishes anyway: the residue is a projection this account's next
|
|
88
|
-
* visit mends through {@link ensureDidWebProjection}, where withholding the
|
|
89
|
-
* strike would leave the struck key standing in the log itself. Between the
|
|
90
|
-
* two write orders the same reasoning picks this one: a projection published
|
|
91
|
-
* before an entry that then fails under-lists a key the log still carries,
|
|
92
|
-
* which a `did:web` verifier reads as less authority rather than more.
|
|
93
|
-
*
|
|
94
|
-
* @param options {object}
|
|
95
|
-
* @param options.store {object} the narrow id-collection seam
|
|
96
|
-
* (`Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>`), the type
|
|
97
|
-
* the forget ceremony's `clientLogStore` already takes
|
|
98
|
-
* @returns {Function} `({ updated }) => Promise<void>`, the
|
|
99
|
-
* `signAccountEntry` hook
|
|
100
|
-
*/
|
|
101
|
-
export declare function preEntryProjectionPublisher({ store }: {
|
|
102
|
-
store: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
103
|
-
}): (built: {
|
|
104
|
-
updated: UpdateDIDResult;
|
|
105
|
-
}) => Promise<void>;
|
|
106
88
|
/**
|
|
107
89
|
* THE PROJECTION FRESHNESS ENSURE: re-derives `did.json` from a resolved log's
|
|
108
90
|
* DID and document, compares it against what the host serves, and republishes
|
|
@@ -137,10 +119,9 @@ export declare function preEntryProjectionPublisher({ store }: {
|
|
|
137
119
|
* not this function's -- every caller today treats it as best-effort.
|
|
138
120
|
*
|
|
139
121
|
* @param options {object}
|
|
140
|
-
* @param options.store {
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* read may be unauthenticated, the `id` collection being world-readable
|
|
122
|
+
* @param options.store {DidWebProjectionStore} the raw read plus the
|
|
123
|
+
* write, which `wasWebvhIdStore` and `delegatedWebvhLogStore` both satisfy.
|
|
124
|
+
* The read may be unauthenticated, the `id` collection being world-readable
|
|
144
125
|
* @param options.did {string} the account's did:webvh, from the resolved log
|
|
145
126
|
* @param options.doc {DIDDoc} the resolved did:webvh document
|
|
146
127
|
* @param [options.refresh] {Function} `() => Promise<{ did, doc }>`, a fresh
|
|
@@ -154,7 +135,7 @@ export declare function preEntryProjectionPublisher({ store }: {
|
|
|
154
135
|
* projection stands and whose successor visit is the mender
|
|
155
136
|
*/
|
|
156
137
|
export declare function ensureDidWebProjection({ store, did, doc, refresh }: {
|
|
157
|
-
store:
|
|
138
|
+
store: DidWebProjectionStore;
|
|
158
139
|
did: string;
|
|
159
140
|
doc: DIDDoc;
|
|
160
141
|
refresh?: () => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didWebProjection.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"didWebProjection.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAGvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,YAAY,EACZ,kBAAkB,GAAG,eAAe,CACrC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,MAAM,EACP,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,GAAG,EACH,OAAO,EACR,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAA;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACtD,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAA;CAAE,CAAC,CAqC/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,GAAG,EACH,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,OAAO,CAcV"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { generateParallelDidWeb } from '@interop/did-method-webvh';
|
|
2
|
-
import { log } from '../log.js';
|
|
3
2
|
import { DID_DOCUMENT_RESOURCE } from '../space/collections.js';
|
|
4
3
|
/**
|
|
5
4
|
* Writes the `did:web` projection into the `id` collection: `did.json`, under
|
|
@@ -7,12 +6,14 @@ import { DID_DOCUMENT_RESOURCE } from '../space/collections.js';
|
|
|
7
6
|
* resource id and content type cannot drift between the publish tails and the
|
|
8
7
|
* freshness ensure.
|
|
9
8
|
*
|
|
10
|
-
* Unconditional by design at every publish-tail caller: the
|
|
11
|
-
* serialized behind a won `did.jsonl`
|
|
12
|
-
*
|
|
9
|
+
* Unconditional by design at every publish-tail caller: on the seam's
|
|
10
|
+
* `'after'` timing the write is serialized behind a won `did.jsonl`
|
|
11
|
+
* compare-and-swap, and on its `'before'` timing a losing attempt's PUT is
|
|
12
|
+
* overwritten by the retry's own. The projection is a derived cache of a log
|
|
13
|
+
* that is itself the source of truth.
|
|
13
14
|
*
|
|
14
15
|
* @param options {object}
|
|
15
|
-
* @param options.store {
|
|
16
|
+
* @param options.store {DidWebProjectionStore}
|
|
16
17
|
* @param options.webDoc {object} the projection to publish, from
|
|
17
18
|
* `generateParallelDidWeb` (or `updateDID`'s `webDoc`, which is the same
|
|
18
19
|
* document)
|
|
@@ -25,53 +26,6 @@ export async function putDidWebProjection({ store, webDoc }) {
|
|
|
25
26
|
contentType: 'application/did+json'
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
-
* The pre-entry projection publisher: a `beforePublish` hook for
|
|
30
|
-
* `signAccountEntry`, which PUTs the post-entry `did:web` projection through
|
|
31
|
-
* the caller's store immediately before the entry itself publishes.
|
|
32
|
-
*
|
|
33
|
-
* A strike entry (a client revocation, a credential retirement, a recovery
|
|
34
|
-
* code's removal) signed by a standing credential's ladder writes `did.jsonl`
|
|
35
|
-
* alone, the bridge delegation's whole reach, so nothing in that ceremony
|
|
36
|
-
* republishes `did.json` and the served projection keeps naming the struck
|
|
37
|
-
* client or credential. A caller holding a store that may write the `id`
|
|
38
|
-
* collection -- a transient session under its generation delegation, an
|
|
39
|
-
* enrolled client under its own root authority -- hands one in and the
|
|
40
|
-
* projection lands with the entry.
|
|
41
|
-
*
|
|
42
|
-
* BEST-EFFORT, and the direction is deliberate. A failed PUT is warned and
|
|
43
|
-
* the entry publishes anyway: the residue is a projection this account's next
|
|
44
|
-
* visit mends through {@link ensureDidWebProjection}, where withholding the
|
|
45
|
-
* strike would leave the struck key standing in the log itself. Between the
|
|
46
|
-
* two write orders the same reasoning picks this one: a projection published
|
|
47
|
-
* before an entry that then fails under-lists a key the log still carries,
|
|
48
|
-
* which a `did:web` verifier reads as less authority rather than more.
|
|
49
|
-
*
|
|
50
|
-
* @param options {object}
|
|
51
|
-
* @param options.store {object} the narrow id-collection seam
|
|
52
|
-
* (`Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>`), the type
|
|
53
|
-
* the forget ceremony's `clientLogStore` already takes
|
|
54
|
-
* @returns {Function} `({ updated }) => Promise<void>`, the
|
|
55
|
-
* `signAccountEntry` hook
|
|
56
|
-
*/
|
|
57
|
-
export function preEntryProjectionPublisher({ store }) {
|
|
58
|
-
return async ({ updated }) => {
|
|
59
|
-
try {
|
|
60
|
-
if (!updated.webDoc) {
|
|
61
|
-
// Every entry is built with `alsoKnownAsWeb`, so this is a defect
|
|
62
|
-
// rather than a state -- reported, and the entry still publishes.
|
|
63
|
-
log.warn('did:webvh: no did:web projection to publish before an entry.');
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
await putDidWebProjection({ store, webDoc: updated.webDoc });
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
log.warn('did:webvh: the pre-entry did:web projection PUT failed.', {
|
|
70
|
-
err
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
29
|
/**
|
|
76
30
|
* The error name a lost write precondition surfaces as -- was-client's
|
|
77
31
|
* `PreconditionFailedError`, and whatever an alternative store implementation
|
|
@@ -112,10 +66,9 @@ const PRECONDITION_FAILED_ERROR_NAME = 'PreconditionFailedError';
|
|
|
112
66
|
* not this function's -- every caller today treats it as best-effort.
|
|
113
67
|
*
|
|
114
68
|
* @param options {object}
|
|
115
|
-
* @param options.store {
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* read may be unauthenticated, the `id` collection being world-readable
|
|
69
|
+
* @param options.store {DidWebProjectionStore} the raw read plus the
|
|
70
|
+
* write, which `wasWebvhIdStore` and `delegatedWebvhLogStore` both satisfy.
|
|
71
|
+
* The read may be unauthenticated, the `id` collection being world-readable
|
|
119
72
|
* @param options.did {string} the account's did:webvh, from the resolved log
|
|
120
73
|
* @param options.doc {DIDDoc} the resolved did:webvh document
|
|
121
74
|
* @param [options.refresh] {Function} `() => Promise<{ did, doc }>`, a fresh
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didWebProjection.js","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"didWebProjection.js","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAoB/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,KAAK,EACL,MAAM,EAIP;IACC,MAAM,KAAK,CAAC,aAAa,CAAC;QACxB,UAAU,EAAE,qBAAqB;QACjC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,sBAAsB;KACpC,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,8BAA8B,GAAG,yBAAyB,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,GAAG,EACH,OAAO,EAMR;IACC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC;QAC1C,UAAU,EAAE,qBAAqB;KAClC,CAAC,CAAA;IACF,IAAI,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IAC3B,IAAI,uBAAuB,CAAC,EAAE,IAAI,EAA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AAG,MAAM,CAAC,OAAO,CAAC,IAA+B,CAAC,CAAA;IACnE,MAAM,WAAW,GAAG,KAAgC,CAAA;IACpD,OAAO,CACL,WAAW,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM;QACtD,WAAW,CAAC,KAAK,CACf,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CACf,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC;YACtD,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CACzC,CACF,CAAA;AACH,CAAC"}
|
package/dist/webvh/didWebvh.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DIDDoc, DIDLog, DIDResolutionMeta, Signer, VerificationMethod } from '@interop/did-method-webvh';
|
|
2
2
|
import { type ResourceLogHeadPin, type ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
3
|
+
import type { DidWebProjectionStore } from './didWebProjection.js';
|
|
3
4
|
import type { RelationMembership } from './mergeMethods.js';
|
|
4
5
|
import type { DidWebKeyMap } from './didWeb.js';
|
|
5
6
|
export { assertPublishedLogDid } from './verifyLog.js';
|
|
@@ -400,26 +401,7 @@ export interface KmsAuthenticationBinding {
|
|
|
400
401
|
keys: DidWebKeyMapV2;
|
|
401
402
|
etag?: string;
|
|
402
403
|
}
|
|
403
|
-
|
|
404
|
-
* The `did:webvh:{SCID}:<host>:space:<spaceId>:<collectionId>` controller
|
|
405
|
-
* template, with the literal `{SCID}` placeholder the library replaces at
|
|
406
|
-
* creation. The host segment percent-encodes a port (`localhost:8080` becomes
|
|
407
|
-
* `localhost%3A8080`), matching the library's `toDidDomainComponent`. The
|
|
408
|
-
* collection defaults to the account log's `id` collection; a client-annex
|
|
409
|
-
* generation's log passes its own `gen-` generation id.
|
|
410
|
-
*
|
|
411
|
-
* @param options {object}
|
|
412
|
-
* @param options.wasServerUrl {string}
|
|
413
|
-
* @param options.spaceId {string}
|
|
414
|
-
* @param [options.collectionId] {string} the collection holding `did.jsonl`
|
|
415
|
-
* (defaults to the `id` collection)
|
|
416
|
-
* @returns {string}
|
|
417
|
-
*/
|
|
418
|
-
export declare function didWebvhControllerTemplate({ wasServerUrl, spaceId, collectionId }: {
|
|
419
|
-
wasServerUrl: string;
|
|
420
|
-
spaceId: string;
|
|
421
|
-
collectionId?: string;
|
|
422
|
-
}): string;
|
|
404
|
+
export { didWebvhControllerTemplate, didWebvhLogLocation, didWebvhLogPaths } from './logLocation.js';
|
|
423
405
|
/**
|
|
424
406
|
* Mints a fresh pair of client-held update-key seeds (active + staged) for a
|
|
425
407
|
* brand-new did:webvh log. The caller owns persistence: these seeds are the
|
|
@@ -512,7 +494,7 @@ export declare function genesisNextKeyHashes({ activeKeyMultibase, stagedKeyMult
|
|
|
512
494
|
* export is the document machinery.
|
|
513
495
|
*
|
|
514
496
|
* @param options {object}
|
|
515
|
-
* @param options.
|
|
497
|
+
* @param options.baseServerUrl {string}
|
|
516
498
|
* @param options.spaceId {string}
|
|
517
499
|
* @param [options.didWebKeys] {DidWebKeyMap} absent on a KMS-less genesis
|
|
518
500
|
* @param options.ladderVmKeyMultibase {string} the credential's ladder VM
|
|
@@ -524,8 +506,8 @@ export declare function genesisNextKeyHashes({ activeKeyMultibase, stagedKeyMult
|
|
|
524
506
|
* @param options.signer {Signer} ladder rung 0's signer
|
|
525
507
|
* @returns {Promise<CreatedWebvhLog>}
|
|
526
508
|
*/
|
|
527
|
-
export declare function createLadderAnchoredWebvhLog({
|
|
528
|
-
|
|
509
|
+
export declare function createLadderAnchoredWebvhLog({ baseServerUrl, spaceId, didWebKeys, ladderVmKeyMultibase, credentialKeyAgreementMethod, updateKeyPublicKeyMultibase, nextKeyHashes, signer }: {
|
|
510
|
+
baseServerUrl: string;
|
|
529
511
|
spaceId: string;
|
|
530
512
|
didWebKeys?: DidWebKeyMap;
|
|
531
513
|
ladderVmKeyMultibase: string;
|
|
@@ -902,21 +884,25 @@ export declare function servedHead(log: DIDLog): BuiltOnHead;
|
|
|
902
884
|
* unconditional here too: healing it is the whole point, and the log it was
|
|
903
885
|
* derived from is the state this call just read and resolved.
|
|
904
886
|
*
|
|
905
|
-
* The reach is what to hold on to:
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
*
|
|
887
|
+
* The reach is what to hold on to: `idStore` is whatever store the caller's
|
|
888
|
+
* authority reaches `did.json` through, the account-entry seam's
|
|
889
|
+
* `projectionStore` (the seam's `concludeUnchanged` is this call on every
|
|
890
|
+
* entry but a ladder-signed removal, on either signer arm). A caller holding a standing
|
|
891
|
+
* credential's bridge delegation alone has no such store, and a ladder-signed
|
|
892
|
+
* removal's idempotent path hands none even when it was given one, since the
|
|
893
|
+
* entry an earlier run landed may have ended that store's authority. Those
|
|
894
|
+
* lags are mended by `ensureDidWebProjection` at the next visit that holds an
|
|
895
|
+
* `id`-collection writer.
|
|
911
896
|
*
|
|
912
897
|
* @param options {object}
|
|
913
|
-
* @param options.idStore {
|
|
898
|
+
* @param options.idStore {DidWebProjectionStore} a store whose authority
|
|
899
|
+
* reaches the `did.json` projection
|
|
914
900
|
* @param options.published {PublishedWebvhLog} the resolved published log
|
|
915
901
|
* @returns {Promise<{ did: string; doc: DIDDoc }>} the published DID and its
|
|
916
902
|
* resolved document
|
|
917
903
|
*/
|
|
918
904
|
export declare function concludeWithPublishedLog({ idStore, published }: {
|
|
919
|
-
idStore:
|
|
905
|
+
idStore: DidWebProjectionStore;
|
|
920
906
|
published: PublishedWebvhLog;
|
|
921
907
|
}): Promise<{
|
|
922
908
|
did: string;
|
|
@@ -995,7 +981,7 @@ export declare function currentLogParameters(published: {
|
|
|
995
981
|
*
|
|
996
982
|
* @param options {object}
|
|
997
983
|
* @param options.idStore {WebvhIdStore}
|
|
998
|
-
* @param options.
|
|
984
|
+
* @param options.baseServerUrl {string}
|
|
999
985
|
* @param options.spaceId {string}
|
|
1000
986
|
* @param [options.didWebKeys] {DidWebKeyMapV2} the parsed keys.json (with any
|
|
1001
987
|
* webvh block) returned by the KMS-authentication stage; absent on a
|
|
@@ -1011,7 +997,7 @@ export declare function currentLogParameters(published: {
|
|
|
1011
997
|
*/
|
|
1012
998
|
export declare function ensureDidWebvh(options: {
|
|
1013
999
|
idStore: WebvhIdStore;
|
|
1014
|
-
|
|
1000
|
+
baseServerUrl: string;
|
|
1015
1001
|
spaceId: string;
|
|
1016
1002
|
didWebKeys?: DidWebKeyMapV2;
|
|
1017
1003
|
keysJsonEtag?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didWebvh.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebvh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"didWebvh.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebvh.ts"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAelC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAS/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,gBAAgB,CAAC,OAAO,EAAE;QACxB,UAAU,EAAE,MAAM,CAAA;KACnB,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MAAM,CAAA;CACrB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAE3B;AA6HD;;;;;;;;;;GAUG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,SAAS,EACV,EAAE;IACD,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,kBAAkB,EAAE,MAAM,CAAA;IAC1B,wBAAwB,EAAE,MAAM,CAAA;CACjC"}
|
package/dist/webvh/didWebvh.js
CHANGED
|
@@ -10,8 +10,11 @@
|
|
|
10
10
|
* The log (`did.jsonl`) is one more WAS Resource in the world-readable `id`
|
|
11
11
|
* collection (which carries a collection-level `PublicCanRead` policy), so
|
|
12
12
|
* hosting needs zero server changes:
|
|
13
|
-
* `did:webvh:<scid>:<host
|
|
14
|
-
* `https://<host>/space/<spaceId>/id/did.jsonl
|
|
13
|
+
* `did:webvh:<scid>:<host>:<prefix...>:space:<spaceId>:id` resolves to
|
|
14
|
+
* `https://<host>/<prefix>/space/<spaceId>/id/did.jsonl`, where the prefix
|
|
15
|
+
* segments are the base server URL's path (none for an origin-root base),
|
|
16
|
+
* so the DID locates its own log and its own server
|
|
17
|
+
* ({@link didWebvhLogLocation}). Adopting the parallel
|
|
15
18
|
* `webDoc` (`did:web:` projection with `alsoKnownAs` cross-links) as the new
|
|
16
19
|
* `did.json` makes the log the single source of truth.
|
|
17
20
|
*
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
* entries, where the original single-key convention forced every entry to
|
|
63
66
|
* reveal the staged key.
|
|
64
67
|
*/
|
|
65
|
-
import { createDID, deriveNextKeyHash, generateParallelDidWeb, logToJsonlString, readLogFromString, resolveDIDFromLog,
|
|
68
|
+
import { createDID, deriveNextKeyHash, generateParallelDidWeb, logToJsonlString, readLogFromString, resolveDIDFromLog, signerFromExternalKey, updateDID } from '@interop/did-method-webvh';
|
|
66
69
|
import { createMultihash, decodeMultihash, decodeMultikey, MultihashAlgorithm, MultikeyCodec } from '@interop/data-integrity-core/multihash';
|
|
67
70
|
import { Ed25519VerificationKey } from '@interop/ed25519-verification-key';
|
|
68
71
|
import { x25519RecipientFromDidKey } from '@interop/was-client/edv/core';
|
|
@@ -73,6 +76,7 @@ import { VOCAB_CONTEXT_URL } from 'byoe-context';
|
|
|
73
76
|
import { DID_LOG_RESOURCE, ID_COLLECTION } from '../space/collections.js';
|
|
74
77
|
import { ResourceLogContinuityError } from '@interop/vh-resource-log';
|
|
75
78
|
import { putDidWebProjection } from './didWebProjection.js';
|
|
79
|
+
import { didWebvhControllerTemplate, didWebvhLogPaths } from './logLocation.js';
|
|
76
80
|
import { multibaseOf } from './didWeb.js';
|
|
77
81
|
import { assertPublishedLogDid, checkAccountLogContinuity, checkAndAdvanceAccountLogPin } from './verifyLog.js';
|
|
78
82
|
// The substituted-account refusal's home is `verifyLog.ts`, beside the
|
|
@@ -411,25 +415,7 @@ export function ladderVerificationMethod({ controller, publicKeyMultibase }) {
|
|
|
411
415
|
publicKeyMultibase
|
|
412
416
|
};
|
|
413
417
|
}
|
|
414
|
-
|
|
415
|
-
* The `did:webvh:{SCID}:<host>:space:<spaceId>:<collectionId>` controller
|
|
416
|
-
* template, with the literal `{SCID}` placeholder the library replaces at
|
|
417
|
-
* creation. The host segment percent-encodes a port (`localhost:8080` becomes
|
|
418
|
-
* `localhost%3A8080`), matching the library's `toDidDomainComponent`. The
|
|
419
|
-
* collection defaults to the account log's `id` collection; a client-annex
|
|
420
|
-
* generation's log passes its own `gen-` generation id.
|
|
421
|
-
*
|
|
422
|
-
* @param options {object}
|
|
423
|
-
* @param options.wasServerUrl {string}
|
|
424
|
-
* @param options.spaceId {string}
|
|
425
|
-
* @param [options.collectionId] {string} the collection holding `did.jsonl`
|
|
426
|
-
* (defaults to the `id` collection)
|
|
427
|
-
* @returns {string}
|
|
428
|
-
*/
|
|
429
|
-
export function didWebvhControllerTemplate({ wasServerUrl, spaceId, collectionId = ID_COLLECTION.id }) {
|
|
430
|
-
const { host } = new URL(wasServerUrl);
|
|
431
|
-
return `did:webvh:${SCID_PLACEHOLDER}:${encodeURIComponent(host)}:space:${spaceId}:${collectionId}`;
|
|
432
|
-
}
|
|
418
|
+
export { didWebvhControllerTemplate, didWebvhLogLocation, didWebvhLogPaths } from './logLocation.js';
|
|
433
419
|
/**
|
|
434
420
|
* Mints a fresh pair of client-held update-key seeds (active + staged) for a
|
|
435
421
|
* brand-new did:webvh log. The caller owns persistence: these seeds are the
|
|
@@ -617,7 +603,7 @@ function assembleWebvhVerificationMethods({ controllerTemplate, didWebKeys, clie
|
|
|
617
603
|
* the staged key.
|
|
618
604
|
*
|
|
619
605
|
* @param options {object}
|
|
620
|
-
* @param options.
|
|
606
|
+
* @param options.baseServerUrl {string}
|
|
621
607
|
* @param options.spaceId {string}
|
|
622
608
|
* @param [options.didWebKeys] {DidWebKeyMap} absent on a client-keys-only
|
|
623
609
|
* genesis
|
|
@@ -629,10 +615,9 @@ function assembleWebvhVerificationMethods({ controllerTemplate, didWebKeys, clie
|
|
|
629
615
|
* @param options.signer {Signer}
|
|
630
616
|
* @returns {Promise<CreatedWebvhLog>}
|
|
631
617
|
*/
|
|
632
|
-
async function createWebvhLog({
|
|
633
|
-
const { host } = new URL(wasServerUrl);
|
|
618
|
+
async function createWebvhLog({ baseServerUrl, spaceId, didWebKeys, clientKeys, ladderVm, updateKeyPublicKeyMultibase, nextKeyHashes, signer }) {
|
|
634
619
|
const controllerTemplate = didWebvhControllerTemplate({
|
|
635
|
-
|
|
620
|
+
baseServerUrl,
|
|
636
621
|
spaceId
|
|
637
622
|
});
|
|
638
623
|
const { verificationMethods, authentication, assertionMethod, keyAgreement, capabilityInvocation, capabilityDelegation } = assembleWebvhVerificationMethods({
|
|
@@ -642,8 +627,8 @@ async function createWebvhLog({ wasServerUrl, spaceId, didWebKeys, clientKeys, l
|
|
|
642
627
|
ladderVm
|
|
643
628
|
});
|
|
644
629
|
const result = await createDID({
|
|
645
|
-
address:
|
|
646
|
-
paths:
|
|
630
|
+
address: baseServerUrl,
|
|
631
|
+
paths: didWebvhLogPaths({ spaceId, collectionId: ID_COLLECTION.id }),
|
|
647
632
|
additionalContext: [BYOE_CONTEXT_URL],
|
|
648
633
|
signer,
|
|
649
634
|
updateKeys: [updateKeyPublicKeyMultibase],
|
|
@@ -721,7 +706,7 @@ export async function genesisNextKeyHashes({ activeKeyMultibase, stagedKeyMultib
|
|
|
721
706
|
* export is the document machinery.
|
|
722
707
|
*
|
|
723
708
|
* @param options {object}
|
|
724
|
-
* @param options.
|
|
709
|
+
* @param options.baseServerUrl {string}
|
|
725
710
|
* @param options.spaceId {string}
|
|
726
711
|
* @param [options.didWebKeys] {DidWebKeyMap} absent on a KMS-less genesis
|
|
727
712
|
* @param options.ladderVmKeyMultibase {string} the credential's ladder VM
|
|
@@ -733,9 +718,9 @@ export async function genesisNextKeyHashes({ activeKeyMultibase, stagedKeyMultib
|
|
|
733
718
|
* @param options.signer {Signer} ladder rung 0's signer
|
|
734
719
|
* @returns {Promise<CreatedWebvhLog>}
|
|
735
720
|
*/
|
|
736
|
-
export async function createLadderAnchoredWebvhLog({
|
|
721
|
+
export async function createLadderAnchoredWebvhLog({ baseServerUrl, spaceId, didWebKeys, ladderVmKeyMultibase, credentialKeyAgreementMethod, updateKeyPublicKeyMultibase, nextKeyHashes, signer }) {
|
|
737
722
|
return createWebvhLog({
|
|
738
|
-
|
|
723
|
+
baseServerUrl,
|
|
739
724
|
spaceId,
|
|
740
725
|
...(didWebKeys ? { didWebKeys } : {}),
|
|
741
726
|
ladderVm: {
|
|
@@ -1221,15 +1206,19 @@ export function servedHead(log) {
|
|
|
1221
1206
|
* unconditional here too: healing it is the whole point, and the log it was
|
|
1222
1207
|
* derived from is the state this call just read and resolved.
|
|
1223
1208
|
*
|
|
1224
|
-
* The reach is what to hold on to:
|
|
1225
|
-
*
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1209
|
+
* The reach is what to hold on to: `idStore` is whatever store the caller's
|
|
1210
|
+
* authority reaches `did.json` through, the account-entry seam's
|
|
1211
|
+
* `projectionStore` (the seam's `concludeUnchanged` is this call on every
|
|
1212
|
+
* entry but a ladder-signed removal, on either signer arm). A caller holding a standing
|
|
1213
|
+
* credential's bridge delegation alone has no such store, and a ladder-signed
|
|
1214
|
+
* removal's idempotent path hands none even when it was given one, since the
|
|
1215
|
+
* entry an earlier run landed may have ended that store's authority. Those
|
|
1216
|
+
* lags are mended by `ensureDidWebProjection` at the next visit that holds an
|
|
1217
|
+
* `id`-collection writer.
|
|
1230
1218
|
*
|
|
1231
1219
|
* @param options {object}
|
|
1232
|
-
* @param options.idStore {
|
|
1220
|
+
* @param options.idStore {DidWebProjectionStore} a store whose authority
|
|
1221
|
+
* reaches the `did.json` projection
|
|
1233
1222
|
* @param options.published {PublishedWebvhLog} the resolved published log
|
|
1234
1223
|
* @returns {Promise<{ did: string; doc: DIDDoc }>} the published DID and its
|
|
1235
1224
|
* resolved document
|
|
@@ -1366,7 +1355,7 @@ function advancedSeeds({ published, multibases, updateKeys }) {
|
|
|
1366
1355
|
*
|
|
1367
1356
|
* @param options {object}
|
|
1368
1357
|
* @param options.idStore {WebvhIdStore}
|
|
1369
|
-
* @param options.
|
|
1358
|
+
* @param options.baseServerUrl {string}
|
|
1370
1359
|
* @param options.spaceId {string}
|
|
1371
1360
|
* @param [options.didWebKeys] {DidWebKeyMapV2} the parsed keys.json (with any
|
|
1372
1361
|
* webvh block) returned by the KMS-authentication stage; absent on a
|
|
@@ -1389,7 +1378,7 @@ export async function ensureDidWebvh(options) {
|
|
|
1389
1378
|
* @param options {object} see {@link ensureDidWebvh}
|
|
1390
1379
|
* @returns {Promise<{ did: string }>}
|
|
1391
1380
|
*/
|
|
1392
|
-
async function ensureDidWebvhOnce({ idStore,
|
|
1381
|
+
async function ensureDidWebvhOnce({ idStore, baseServerUrl, spaceId, didWebKeys, keysJsonEtag, clientKeys, updateKeys, expectedDid }) {
|
|
1393
1382
|
// The DID this run expects the published log to resolve to: the caller's,
|
|
1394
1383
|
// else the one keys.json already records. Undefined only on the documented
|
|
1395
1384
|
// first-contact adoption, which discovers the DID from the log itself.
|
|
@@ -1431,7 +1420,7 @@ async function ensureDidWebvhOnce({ idStore, wasServerUrl, spaceId, didWebKeys,
|
|
|
1431
1420
|
}
|
|
1432
1421
|
const signer = await updateKeySigner({ seed: updateKeys.updateSeed });
|
|
1433
1422
|
const created = await createWebvhLog({
|
|
1434
|
-
|
|
1423
|
+
baseServerUrl,
|
|
1435
1424
|
spaceId,
|
|
1436
1425
|
didWebKeys,
|
|
1437
1426
|
clientKeys,
|