@interop/wallet-core 0.62.0 → 0.66.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 +41 -16
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +119 -35
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +227 -160
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +18 -8
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +37 -64
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +85 -38
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +155 -98
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -2
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +16 -7
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +65 -14
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +397 -298
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +23 -7
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +26 -7
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +58 -0
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +249 -41
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +391 -346
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +237 -53
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +533 -198
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +12 -6
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +44 -72
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/spaceCapability.d.ts +123 -0
- package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
- package/dist/clientAnnex/spaceCapability.js +152 -0
- package/dist/clientAnnex/spaceCapability.js.map +1 -0
- package/dist/clientAnnex/stages.d.ts +63 -0
- package/dist/clientAnnex/stages.d.ts.map +1 -0
- package/dist/clientAnnex/stages.js +64 -0
- package/dist/clientAnnex/stages.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +1 -1
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +42 -35
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/policy.d.ts +15 -1
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +12 -6
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -10
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +13 -5
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +10 -2
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +41 -24
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.d.ts.map +1 -1
- package/dist/descriptors/acquire.js +6 -23
- package/dist/descriptors/acquire.js.map +1 -1
- package/dist/descriptors/cipher.d.ts.map +1 -1
- package/dist/descriptors/cipher.js +5 -0
- package/dist/descriptors/cipher.js.map +1 -1
- package/dist/descriptors/errors.d.ts +43 -0
- package/dist/descriptors/errors.d.ts.map +1 -0
- package/dist/descriptors/errors.js +45 -0
- package/dist/descriptors/errors.js.map +1 -0
- package/dist/descriptors/index.d.ts +5 -0
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +5 -0
- package/dist/descriptors/index.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +37 -10
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +52 -15
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +42 -11
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +80 -22
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +3 -1
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +3 -1
- package/dist/genesis/index.js.map +1 -1
- package/dist/identity/agents.d.ts +17 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +23 -7
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +3 -1
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/index.d.ts +2 -1
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +2 -1
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +3 -6
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +14 -5
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +31 -36
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/index.d.ts +22 -8
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +20 -6
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +15 -12
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +21 -16
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -6
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +10 -9
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +2 -3
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +8 -5
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +7 -6
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +95 -8
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +278 -35
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +117 -16
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +184 -43
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/keys/wasLabelsStore.d.ts +9 -2
- package/dist/keys/wasLabelsStore.d.ts.map +1 -1
- package/dist/keys/wasLabelsStore.js +14 -6
- package/dist/keys/wasLabelsStore.js.map +1 -1
- package/dist/log.d.ts +7 -2
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +6 -1
- package/dist/log.js.map +1 -1
- package/dist/recovery/index.d.ts +13 -9
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +12 -8
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +27 -7
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +18 -6
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +23 -0
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +66 -46
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +75 -63
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +127 -116
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/appKey.d.ts +35 -1
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +29 -10
- package/dist/request/appKey.js.map +1 -1
- package/dist/request/classify.d.ts +32 -8
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +39 -14
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +1 -6
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +2 -2
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +2 -3
- package/dist/request/parse.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +34 -12
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +79 -86
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +182 -0
- package/dist/resourceLog/document.d.ts.map +1 -0
- package/dist/resourceLog/document.js +159 -0
- package/dist/resourceLog/document.js.map +1 -0
- package/dist/resourceLog/errors.d.ts +47 -8
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +54 -8
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +7 -3
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +7 -3
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts +35 -0
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
- package/dist/resourceLog/ladderRungs.js +352 -0
- package/dist/resourceLog/ladderRungs.js.map +1 -0
- package/dist/resourceLog/license.d.ts +42 -17
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +38 -24
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +15 -15
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +15 -15
- package/dist/space/activity.js.map +1 -1
- package/dist/space/collections.d.ts +11 -0
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +13 -0
- package/dist/space/collections.js.map +1 -1
- package/dist/space/deleteSpace.d.ts +28 -0
- package/dist/space/deleteSpace.d.ts.map +1 -0
- package/dist/space/deleteSpace.js +44 -0
- package/dist/space/deleteSpace.js.map +1 -0
- package/dist/space/errors.d.ts.map +1 -1
- package/dist/space/errors.js +0 -1
- package/dist/space/errors.js.map +1 -1
- package/dist/space/index.d.ts +6 -0
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +6 -0
- package/dist/space/index.js.map +1 -1
- package/dist/space/plaintextCollection.d.ts +43 -0
- package/dist/space/plaintextCollection.d.ts.map +1 -0
- package/dist/space/plaintextCollection.js +17 -0
- package/dist/space/plaintextCollection.js.map +1 -0
- package/dist/stages.d.ts +23 -0
- package/dist/stages.d.ts.map +1 -0
- package/dist/stages.js +23 -0
- package/dist/stages.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +7 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.js +4 -4
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.js +2 -2
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +41 -1
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +47 -1
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +5 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +5 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +35 -7
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +52 -14
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts.map +1 -1
- package/dist/unlock/standingClient.js +5 -1
- package/dist/unlock/standingClient.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +217 -35
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +469 -210
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +146 -0
- package/dist/webvh/accountEntry.d.ts.map +1 -0
- package/dist/webvh/accountEntry.js +239 -0
- package/dist/webvh/accountEntry.js.map +1 -0
- package/dist/webvh/didWeb.d.ts +12 -7
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js +2 -2
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +164 -0
- package/dist/webvh/didWebProjection.d.ts.map +1 -0
- package/dist/webvh/didWebProjection.js +230 -0
- package/dist/webvh/didWebProjection.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +275 -136
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +307 -340
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +65 -0
- package/dist/webvh/enrollClient.d.ts.map +1 -0
- package/dist/webvh/enrollClient.js +172 -0
- package/dist/webvh/enrollClient.js.map +1 -0
- package/dist/webvh/index.d.ts +37 -12
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +33 -10
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +1 -35
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +2 -30
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +41 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +99 -48
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +61 -14
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +91 -0
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +59 -5
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +76 -11
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +8 -8
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +39 -14
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +14 -1
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +3 -27
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +2 -2
- package/dist/webvh/keyAgreement.d.ts +0 -97
- package/dist/webvh/keyAgreement.d.ts.map +0 -1
- package/dist/webvh/keyAgreement.js +0 -71
- package/dist/webvh/keyAgreement.js.map +0 -1
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
* `recovery/recoveryWebvh.ts`.
|
|
13
13
|
*/
|
|
14
14
|
import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
|
|
15
|
-
import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE,
|
|
16
|
-
import { ladderVmIds } from '../
|
|
17
|
-
import { credentialKeyAgreementMethods } from '../webvh/keyAgreement.js';
|
|
15
|
+
import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, publishEntryPinned, readPublishedLogOrThrow, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
16
|
+
import { credentialKeyAgreementMethods, ladderVmIds, relationIds } from '../resourceLog/document.js';
|
|
18
17
|
import { unlockKeyVerificationMethod, unlockKeyVmId } from '../unlock/standingWebvh.js';
|
|
19
|
-
import {
|
|
18
|
+
import { RecoveryKeyNotCommittedError, recoveryVmId, retiredCredentialVmIdsFromLog } from '../recovery/recoveryWebvh.js';
|
|
20
19
|
import { assertNextKeyHashesRemain, attributeRetiredCredentialRungs, ladderRung, ladderVmKeyMultibase, retiredCredentialRungsBeforeKey } from './ladder.js';
|
|
21
20
|
import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
|
|
22
21
|
/**
|
|
@@ -102,8 +101,10 @@ import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
|
|
|
102
101
|
* @param options.credentialKeyAgreement {UnlockKeyAgreementPublication} the
|
|
103
102
|
* fresh credential's key-agreement publication (a commitment for a
|
|
104
103
|
* passphrase-derived key)
|
|
105
|
-
* @param options.replacement {
|
|
106
|
-
* public halves
|
|
104
|
+
* @param options.replacement {ReplacementRecoveryPublicKeys} the
|
|
105
|
+
* replacement code's public halves -- its key-agreement key, its rung-0
|
|
106
|
+
* update key, and its ladder VM key -- committed and published in the same
|
|
107
|
+
* continuation
|
|
107
108
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
108
109
|
* to, where the recovering flow already knows it
|
|
109
110
|
* @param options.onCommitted {function}
|
|
@@ -153,14 +154,12 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
153
154
|
// Each attempt's own read is what the CAS publish is built on, so the
|
|
154
155
|
// continuity check runs here -- and again on a conflict-retry re-run -- not
|
|
155
156
|
// only on the verify that follows both entries.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
163
|
-
...pinned
|
|
157
|
+
let published = await readPublishedLogOrThrow({
|
|
158
|
+
idStore: store,
|
|
159
|
+
expectedDid,
|
|
160
|
+
pinStore,
|
|
161
|
+
logId,
|
|
162
|
+
missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
|
|
164
163
|
});
|
|
165
164
|
const rung0 = await ladderRung({ ladderSeed, index: 0 });
|
|
166
165
|
const rung1 = await ladderRung({ ladderSeed, index: 1 });
|
|
@@ -237,22 +236,23 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
237
236
|
])
|
|
238
237
|
]
|
|
239
238
|
});
|
|
240
|
-
|
|
239
|
+
// The publish advances the pin to what the reveal entry just published,
|
|
240
|
+
// so the re-read below (and any read after a tear here) refuses a host
|
|
241
|
+
// that rolls the log back behind it.
|
|
242
|
+
await publishEntryPinned({
|
|
241
243
|
store,
|
|
242
244
|
log: updated.log,
|
|
243
|
-
ifMatch: published.etag
|
|
245
|
+
ifMatch: published.etag,
|
|
246
|
+
pinStore,
|
|
247
|
+
logId
|
|
244
248
|
});
|
|
245
|
-
// Advance the pin to what the reveal entry just published, so the re-read
|
|
246
|
-
// below (and any read after a tear here) refuses a host that rolls the
|
|
247
|
-
// log back behind it.
|
|
248
|
-
if (pinStore && logId !== undefined) {
|
|
249
|
-
await pinStore.write({ logId, pin: pinOfLog(updated.log) });
|
|
250
|
-
}
|
|
251
249
|
// The same account the reveal entry just extended, under the same pin.
|
|
252
|
-
published = await
|
|
253
|
-
store,
|
|
250
|
+
published = await readPublishedLogOrThrow({
|
|
251
|
+
idStore: store,
|
|
254
252
|
expectedDid: published.did,
|
|
255
|
-
|
|
253
|
+
pinStore,
|
|
254
|
+
logId,
|
|
255
|
+
missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
// The persist-before-publish seam: the replacement code's record and the
|
|
@@ -293,7 +293,19 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
293
293
|
// controller (an enrolled client's carries the client marker instead), less
|
|
294
294
|
// the ids this entry itself adds. The spent code's own id is reported
|
|
295
295
|
// separately: the caller already retires that one by name.
|
|
296
|
-
|
|
296
|
+
// The replacement code's ladder VM, published beside its key-agreement
|
|
297
|
+
// member: a code is a standing credential with a ladder, and its own bridge
|
|
298
|
+
// delegation is signed by this VM, so a replacement without it could never
|
|
299
|
+
// spend (`decisions/0019`, `decisions/0020`). Its rung-0 hash is already
|
|
300
|
+
// committed by the reveal-and-commit entry, which this entry carries
|
|
301
|
+
// through.
|
|
302
|
+
const replacementLadderVmId = `${did}#${replacement.ladderVmKeyMultibase}`;
|
|
303
|
+
const addedVmIds = [
|
|
304
|
+
ladderVmId,
|
|
305
|
+
credentialVmId,
|
|
306
|
+
replacementVmId,
|
|
307
|
+
replacementLadderVmId
|
|
308
|
+
];
|
|
297
309
|
const struckCredentialVmIds = credentialKeyAgreementMethods({ doc, did })
|
|
298
310
|
.map(method => method.id)
|
|
299
311
|
.filter((id) => typeof id === 'string')
|
|
@@ -320,7 +332,11 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
320
332
|
type: MULTIKEY_VM_TYPE,
|
|
321
333
|
controller: did,
|
|
322
334
|
publicKeyMultibase: replacement.keyAgreementKeyMultibase
|
|
323
|
-
}
|
|
335
|
+
},
|
|
336
|
+
ladderVerificationMethod({
|
|
337
|
+
controller: did,
|
|
338
|
+
publicKeyMultibase: replacement.ladderVmKeyMultibase
|
|
339
|
+
})
|
|
324
340
|
];
|
|
325
341
|
const existingMethods = (doc.verificationMethod ?? []);
|
|
326
342
|
const verificationMethods = [
|
|
@@ -365,14 +381,18 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
365
381
|
// `capabilityInvocation` -- which is also what keeps it out of every
|
|
366
382
|
// client listing.
|
|
367
383
|
authentication: withoutRemoved(doc.authentication),
|
|
368
|
-
assertionMethod: withoutRemoved(doc.assertionMethod, [
|
|
384
|
+
assertionMethod: withoutRemoved(doc.assertionMethod, [
|
|
385
|
+
ladderVmId,
|
|
386
|
+
replacementLadderVmId
|
|
387
|
+
]),
|
|
369
388
|
keyAgreement: withoutRemoved(doc.keyAgreement, [
|
|
370
389
|
credentialVmId,
|
|
371
390
|
replacementVmId
|
|
372
391
|
]),
|
|
373
392
|
capabilityInvocation: withoutRemoved(doc.capabilityInvocation),
|
|
374
393
|
capabilityDelegation: withoutRemoved(doc.capabilityDelegation, [
|
|
375
|
-
ladderVmId
|
|
394
|
+
ladderVmId,
|
|
395
|
+
replacementLadderVmId
|
|
376
396
|
]),
|
|
377
397
|
// Atomic with the retirement above: the pointer and the ladder-VM set
|
|
378
398
|
// change in one entry, so no window exists in which the document points
|
|
@@ -385,12 +405,13 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
385
405
|
});
|
|
386
406
|
// Conditional on the read this entry was built on: the re-read above when
|
|
387
407
|
// the commit entry ran here, the first read when it was skipped.
|
|
388
|
-
await
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
408
|
+
await publishEntryPinned({
|
|
409
|
+
store,
|
|
410
|
+
log: updated.log,
|
|
411
|
+
ifMatch: published.etag,
|
|
412
|
+
pinStore,
|
|
413
|
+
logId
|
|
414
|
+
});
|
|
394
415
|
return {
|
|
395
416
|
did: updated.did,
|
|
396
417
|
doc: updated.doc,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,6BAA6B,EAC7B,WAAW,EACX,WAAW,EACZ,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,4BAA4B,EAC5B,YAAY,EACZ,6BAA6B,EAI9B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,UAAU,EACV,oBAAoB,EACpB,+BAA+B,EAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,OAUhD;IASC,uEAAuE;IACvE,wEAAwE;IACxE,oEAAoE;IACpE,6DAA6D;IAC7D,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CACjB,mEAAmE;YACjE,oEAAoE;YACpE,oCAAoC,CACvC,CAAA;IACH,CAAC;IACD,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAA;AAC5E,CAA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|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Single-verb Space capabilities: the short-lived children a transient
|
|
6
|
+
* session mints so it can destroy (or probe) a Space it has no root
|
|
7
|
+
* invocation over. Two shapes, one mint, both target-exact:
|
|
8
|
+
*
|
|
9
|
+
* - Three links, over a stored parent. The parent is the management zcap an
|
|
10
|
+
* unlock identity delegated to the account at bind time. The child's
|
|
11
|
+
* `invocationTarget` is the parent's own, copied verbatim from the parent's
|
|
12
|
+
* bytes rather than rebuilt, so a deployment whose stored parent carries a
|
|
13
|
+
* target this client would build differently still lands on the bytes the
|
|
14
|
+
* server checks.
|
|
15
|
+
* - Two links, over a Space's synthesized root. The child's
|
|
16
|
+
* `invocationTarget` is the bare Space URL, built with was-client's path
|
|
17
|
+
* builders so a sub-path deployment keeps its prefix.
|
|
18
|
+
*
|
|
19
|
+
* `allowedAction` is exactly one HTTP verb -- `DELETE` for the deletion
|
|
20
|
+
* child, `GET` for the probe child -- which is what a storage server's
|
|
21
|
+
* admission predicate keys on. The delegatee is the caller's: the ladder
|
|
22
|
+
* VM's bare did:key on a transient session (it re-derives from the ladder
|
|
23
|
+
* seed and resolves from its own bytes, so it outlives the account log it
|
|
24
|
+
* was minted beside), the account did:webvh on a remembered one.
|
|
25
|
+
*
|
|
26
|
+
* Nothing here is stored. A child is minted immediately before its own
|
|
27
|
+
* request and dropped; on a torn run it lapses by its short TTL, so no
|
|
28
|
+
* revocation is owed.
|
|
29
|
+
*
|
|
30
|
+
* Two checks stay with the caller rather than here: that the parent's
|
|
31
|
+
* `controller` is the delegator this client signs as, and that the parent's
|
|
32
|
+
* target names the Space the caller means on the deployment it is talking
|
|
33
|
+
* to. The caller holds the deployment URL and the delegator DID; this module
|
|
34
|
+
* holds neither, and guessing either would rebuild the very bytes the
|
|
35
|
+
* verbatim copy exists to preserve.
|
|
36
|
+
*/
|
|
37
|
+
import type { IZcap } from '@interop/data-integrity-core';
|
|
38
|
+
import type { ZcapClient } from '@interop/ezcap';
|
|
39
|
+
/**
|
|
40
|
+
* The single-verb Space capability's lifetime: ten minutes, long enough for
|
|
41
|
+
* the request it is minted for and twice `@interop/zcap`'s 300-second clock
|
|
42
|
+
* skew allowance. A child's `expires` is the earlier of this and its
|
|
43
|
+
* parent's, since the library refuses a child less restrictive than its
|
|
44
|
+
* parent with no skew allowance.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DELETION_ZCAP_TTL_MS: number;
|
|
47
|
+
/**
|
|
48
|
+
* The two verbs a single-verb Space capability may carry: the deletion
|
|
49
|
+
* child's `DELETE` and the probe child's `GET`.
|
|
50
|
+
*/
|
|
51
|
+
export type SpaceCapabilityVerb = 'DELETE' | 'GET';
|
|
52
|
+
/**
|
|
53
|
+
* The typed refusal of a mint over a parent capability whose own `expires`
|
|
54
|
+
* has already passed: the child would verify nowhere, so nothing is minted
|
|
55
|
+
* and nothing is sent. Matched on `name` -- error classes do not survive
|
|
56
|
+
* crossing package copies. The parent's `expires` and `id` ride the error so
|
|
57
|
+
* a caller can name the lapsed capability in its own copy without re-reading
|
|
58
|
+
* the parent.
|
|
59
|
+
*/
|
|
60
|
+
export declare class ExpiredParentCapabilityError extends Error {
|
|
61
|
+
readonly parentExpires: string;
|
|
62
|
+
readonly parentId: string | undefined;
|
|
63
|
+
constructor({ message, parentExpires, parentId }: {
|
|
64
|
+
message: string;
|
|
65
|
+
parentExpires: string;
|
|
66
|
+
parentId: string | undefined;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Mints a single-verb child of a STORED parent capability -- the three-link
|
|
71
|
+
* shape, used on an unlock Space whose management zcap the account already
|
|
72
|
+
* holds. The child's `invocationTarget` is the parent's unchanged.
|
|
73
|
+
*
|
|
74
|
+
* @param options {object}
|
|
75
|
+
* @param options.zcapClient {ZcapClient} the delegating signer (the ladder
|
|
76
|
+
* VM's client on a transient session, an enrolled client's on a remembered
|
|
77
|
+
* one)
|
|
78
|
+
* @param options.parent {IZcap} the stored parent capability
|
|
79
|
+
* @param options.verb {SpaceCapabilityVerb} the child's one allowed action
|
|
80
|
+
* @param options.controller {string} the delegatee DID
|
|
81
|
+
* @param [options.ttlMs] {number} the child's requested lifetime
|
|
82
|
+
* @param [options.now] {number} the clock the child is minted against
|
|
83
|
+
* (epoch milliseconds); a caller holding server-relative time passes it
|
|
84
|
+
* so the proof's `created` and the child's `expires` come off one clock
|
|
85
|
+
* @returns {Promise<IZcap>}
|
|
86
|
+
*/
|
|
87
|
+
export declare function mintSpaceVerbCapability({ zcapClient, parent, verb, controller, ttlMs, now }: {
|
|
88
|
+
zcapClient: ZcapClient;
|
|
89
|
+
parent: IZcap;
|
|
90
|
+
verb: SpaceCapabilityVerb;
|
|
91
|
+
controller: string;
|
|
92
|
+
ttlMs?: number;
|
|
93
|
+
now?: number;
|
|
94
|
+
}): Promise<IZcap>;
|
|
95
|
+
/**
|
|
96
|
+
* Mints a single-verb child of a Space's SYNTHESIZED ROOT -- the two-link
|
|
97
|
+
* shape, used on the account Space and an auxiliary annex Space, where the
|
|
98
|
+
* session holds no stored parent. The child's `invocationTarget` is the bare
|
|
99
|
+
* Space URL, with no trailing slash, so the deletion child covers the Space
|
|
100
|
+
* itself rather than its items subtree.
|
|
101
|
+
*
|
|
102
|
+
* @param options {object}
|
|
103
|
+
* @param options.zcapClient {ZcapClient} the delegating signer
|
|
104
|
+
* @param options.storageServerUrl {string} the Space's storage server
|
|
105
|
+
* @param options.spaceId {string}
|
|
106
|
+
* @param options.verb {SpaceCapabilityVerb} the child's one allowed action
|
|
107
|
+
* @param options.controller {string} the delegatee DID
|
|
108
|
+
* @param [options.ttlMs] {number} the child's requested lifetime
|
|
109
|
+
* @param [options.now] {number} the clock the child is minted against
|
|
110
|
+
* (epoch milliseconds); a caller holding server-relative time passes it
|
|
111
|
+
* so the proof's `created` and the child's `expires` come off one clock
|
|
112
|
+
* @returns {Promise<IZcap>}
|
|
113
|
+
*/
|
|
114
|
+
export declare function mintSpaceRootVerbCapability({ zcapClient, storageServerUrl, spaceId, verb, controller, ttlMs, now }: {
|
|
115
|
+
zcapClient: ZcapClient;
|
|
116
|
+
storageServerUrl: string;
|
|
117
|
+
spaceId: string;
|
|
118
|
+
verb: SpaceCapabilityVerb;
|
|
119
|
+
controller: string;
|
|
120
|
+
ttlMs?: number;
|
|
121
|
+
now?: number;
|
|
122
|
+
}): Promise<IZcap>;
|
|
123
|
+
//# sourceMappingURL=spaceCapability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceCapability.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/spaceCapability.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAiB,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,KAAK,CAAA;AAElD;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;gBAEzB,EACV,OAAO,EACP,aAAa,EACb,QAAQ,EACT,EAAE;QACD,OAAO,EAAE,MAAM,CAAA;QACf,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;KAC7B;CAMF;AA+ED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,UAAU,EACV,MAAM,EACN,IAAI,EACJ,UAAU,EACV,KAA4B,EAC5B,GAAgB,EACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,KAAK,CAAA;IACb,IAAI,EAAE,mBAAmB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,KAAK,CAAC,CAkBjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAA4B,EAC5B,GAAgB,EACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,mBAAmB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,KAAK,CAAC,CAajB"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { rootCapabilityId, spacePath, toUrl } from '@interop/was-client/paths';
|
|
2
|
+
/**
|
|
3
|
+
* The single-verb Space capability's lifetime: ten minutes, long enough for
|
|
4
|
+
* the request it is minted for and twice `@interop/zcap`'s 300-second clock
|
|
5
|
+
* skew allowance. A child's `expires` is the earlier of this and its
|
|
6
|
+
* parent's, since the library refuses a child less restrictive than its
|
|
7
|
+
* parent with no skew allowance.
|
|
8
|
+
*/
|
|
9
|
+
export const DELETION_ZCAP_TTL_MS = 10 * 60 * 1000;
|
|
10
|
+
/**
|
|
11
|
+
* The typed refusal of a mint over a parent capability whose own `expires`
|
|
12
|
+
* has already passed: the child would verify nowhere, so nothing is minted
|
|
13
|
+
* and nothing is sent. Matched on `name` -- error classes do not survive
|
|
14
|
+
* crossing package copies. The parent's `expires` and `id` ride the error so
|
|
15
|
+
* a caller can name the lapsed capability in its own copy without re-reading
|
|
16
|
+
* the parent.
|
|
17
|
+
*/
|
|
18
|
+
export class ExpiredParentCapabilityError extends Error {
|
|
19
|
+
parentExpires;
|
|
20
|
+
parentId;
|
|
21
|
+
constructor({ message, parentExpires, parentId }) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = 'ExpiredParentCapabilityError';
|
|
24
|
+
this.parentExpires = parentExpires;
|
|
25
|
+
this.parentId = parentId;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The child's expiry: `min(now + ttlMs, parent.expires)`. A parent already
|
|
30
|
+
* expired is refused rather than minted from, since the child would verify
|
|
31
|
+
* nowhere.
|
|
32
|
+
*
|
|
33
|
+
* @param options {object}
|
|
34
|
+
* @param options.ttlMs {number}
|
|
35
|
+
* @param [options.parent] {IZcap} the stored parent capability, absent on
|
|
36
|
+
* the root-parented shape (a synthesized root has no expiry)
|
|
37
|
+
* @param options.now {number} epoch milliseconds
|
|
38
|
+
* @returns {Date}
|
|
39
|
+
*/
|
|
40
|
+
function childExpires({ ttlMs, parent, now }) {
|
|
41
|
+
const requested = now + ttlMs;
|
|
42
|
+
const parentExpires = Date.parse(parent?.expires ?? '');
|
|
43
|
+
if (Number.isNaN(parentExpires)) {
|
|
44
|
+
return new Date(requested);
|
|
45
|
+
}
|
|
46
|
+
if (parentExpires <= now) {
|
|
47
|
+
const expiresIso = new Date(parentExpires).toISOString();
|
|
48
|
+
throw new ExpiredParentCapabilityError({
|
|
49
|
+
message: 'single-verb Space capability: the parent capability expired at ' +
|
|
50
|
+
`${expiresIso}; refusing to mint a child that verifies nowhere.`,
|
|
51
|
+
parentExpires: expiresIso,
|
|
52
|
+
parentId: parent?.id
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return new Date(Math.min(requested, parentExpires));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Refuses a child the parent cannot authorize. A parent's `allowedAction` may
|
|
59
|
+
* be a single string, a list, or absent (which delegates every action), so
|
|
60
|
+
* the check normalizes before asking. Refusing locally is what keeps the
|
|
61
|
+
* failure legible: an unauthorized invocation comes back from the storage
|
|
62
|
+
* server as a 404, indistinguishable from a Space that is simply gone, so a
|
|
63
|
+
* child that verifies nowhere must never be minted and sent.
|
|
64
|
+
*
|
|
65
|
+
* @param options {object}
|
|
66
|
+
* @param options.parent {IZcap}
|
|
67
|
+
* @param options.verb {SpaceCapabilityVerb}
|
|
68
|
+
* @returns {void}
|
|
69
|
+
*/
|
|
70
|
+
function assertParentAllows({ parent, verb }) {
|
|
71
|
+
const allowed = parent
|
|
72
|
+
.allowedAction;
|
|
73
|
+
if (allowed === undefined) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const actions = Array.isArray(allowed) ? allowed : [allowed];
|
|
77
|
+
if (actions.length === 0 || actions.includes(verb)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
throw new Error(`single-verb Space capability: the parent capability allows ` +
|
|
81
|
+
`${actions.join(', ')} and not ${verb}; refusing to mint a child that ` +
|
|
82
|
+
'verifies nowhere.');
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Mints a single-verb child of a STORED parent capability -- the three-link
|
|
86
|
+
* shape, used on an unlock Space whose management zcap the account already
|
|
87
|
+
* holds. The child's `invocationTarget` is the parent's unchanged.
|
|
88
|
+
*
|
|
89
|
+
* @param options {object}
|
|
90
|
+
* @param options.zcapClient {ZcapClient} the delegating signer (the ladder
|
|
91
|
+
* VM's client on a transient session, an enrolled client's on a remembered
|
|
92
|
+
* one)
|
|
93
|
+
* @param options.parent {IZcap} the stored parent capability
|
|
94
|
+
* @param options.verb {SpaceCapabilityVerb} the child's one allowed action
|
|
95
|
+
* @param options.controller {string} the delegatee DID
|
|
96
|
+
* @param [options.ttlMs] {number} the child's requested lifetime
|
|
97
|
+
* @param [options.now] {number} the clock the child is minted against
|
|
98
|
+
* (epoch milliseconds); a caller holding server-relative time passes it
|
|
99
|
+
* so the proof's `created` and the child's `expires` come off one clock
|
|
100
|
+
* @returns {Promise<IZcap>}
|
|
101
|
+
*/
|
|
102
|
+
export async function mintSpaceVerbCapability({ zcapClient, parent, verb, controller, ttlMs = DELETION_ZCAP_TTL_MS, now = Date.now() }) {
|
|
103
|
+
const invocationTarget = parent
|
|
104
|
+
.invocationTarget;
|
|
105
|
+
if (invocationTarget === undefined) {
|
|
106
|
+
throw new Error('single-verb Space capability: the parent capability names no ' +
|
|
107
|
+
'`invocationTarget`.');
|
|
108
|
+
}
|
|
109
|
+
assertParentAllows({ parent, verb });
|
|
110
|
+
return (await zcapClient.delegate({
|
|
111
|
+
capability: parent,
|
|
112
|
+
invocationTarget,
|
|
113
|
+
controller,
|
|
114
|
+
allowedActions: [verb],
|
|
115
|
+
expires: childExpires({ ttlMs, parent, now }),
|
|
116
|
+
now
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Mints a single-verb child of a Space's SYNTHESIZED ROOT -- the two-link
|
|
121
|
+
* shape, used on the account Space and an auxiliary annex Space, where the
|
|
122
|
+
* session holds no stored parent. The child's `invocationTarget` is the bare
|
|
123
|
+
* Space URL, with no trailing slash, so the deletion child covers the Space
|
|
124
|
+
* itself rather than its items subtree.
|
|
125
|
+
*
|
|
126
|
+
* @param options {object}
|
|
127
|
+
* @param options.zcapClient {ZcapClient} the delegating signer
|
|
128
|
+
* @param options.storageServerUrl {string} the Space's storage server
|
|
129
|
+
* @param options.spaceId {string}
|
|
130
|
+
* @param options.verb {SpaceCapabilityVerb} the child's one allowed action
|
|
131
|
+
* @param options.controller {string} the delegatee DID
|
|
132
|
+
* @param [options.ttlMs] {number} the child's requested lifetime
|
|
133
|
+
* @param [options.now] {number} the clock the child is minted against
|
|
134
|
+
* (epoch milliseconds); a caller holding server-relative time passes it
|
|
135
|
+
* so the proof's `created` and the child's `expires` come off one clock
|
|
136
|
+
* @returns {Promise<IZcap>}
|
|
137
|
+
*/
|
|
138
|
+
export async function mintSpaceRootVerbCapability({ zcapClient, storageServerUrl, spaceId, verb, controller, ttlMs = DELETION_ZCAP_TTL_MS, now = Date.now() }) {
|
|
139
|
+
const spaceUrl = toUrl({
|
|
140
|
+
serverUrl: storageServerUrl,
|
|
141
|
+
path: spacePath(spaceId)
|
|
142
|
+
});
|
|
143
|
+
return (await zcapClient.delegate({
|
|
144
|
+
capability: rootCapabilityId(spaceUrl),
|
|
145
|
+
invocationTarget: spaceUrl,
|
|
146
|
+
controller,
|
|
147
|
+
allowedActions: [verb],
|
|
148
|
+
expires: childExpires({ ttlMs, now }),
|
|
149
|
+
now
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=spaceCapability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceCapability.js","sourceRoot":"","sources":["../../src/clientAnnex/spaceCapability.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAQlD;;;;;;;GAOG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAC5C,aAAa,CAAQ;IACrB,QAAQ,CAAoB;IAErC,YAAY,EACV,OAAO,EACP,aAAa,EACb,QAAQ,EAKT;QACC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAA;QAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,MAAM,EACN,GAAG,EAKJ;IACC,MAAM,SAAS,GAAG,GAAG,GAAG,KAAK,CAAA;IAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAC7B,MAA+B,EAAE,OAAO,IAAI,EAAE,CAChD,CA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
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The stage vocabulary of the credential-anchored ceremonies: the ordered
|
|
6
|
+
* tuples their `onStage` notifiers report from, the aliases, and the union
|
|
7
|
+
* types derived from them. The ceremonies emit from these types, so a
|
|
8
|
+
* mistyped stage name fails the type check, and a consumer's progress
|
|
9
|
+
* display derives its step list from the tuples instead of re-declaring the
|
|
10
|
+
* names as bare strings.
|
|
11
|
+
*
|
|
12
|
+
* The vocabulary sits in a leaf module of its own rather than beside the
|
|
13
|
+
* code that emits it, because a progress display needs the names and none of
|
|
14
|
+
* the ceremony: an app store importing them from `establish.js` would pull
|
|
15
|
+
* that whole module graph into its bundle.
|
|
16
|
+
*/
|
|
17
|
+
import { KMS_AUTHENTICATION_STAGE } from '../stages.js';
|
|
18
|
+
export { KMS_AUTHENTICATION_STAGE };
|
|
19
|
+
/**
|
|
20
|
+
* The controller-promotion stage, emitted by the genesis ceremony when it
|
|
21
|
+
* promotes and by the establishment when the promotion is deferred to it.
|
|
22
|
+
* Declared once so the two emitters cannot drift apart.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CONTROLLER_PROMOTION_STAGE = "controller-promotion";
|
|
25
|
+
/**
|
|
26
|
+
* The stages `ensureCredentialAnchoredAccountGenesis` reports, in the order
|
|
27
|
+
* they fire, up to but not including the controller promotion (which a
|
|
28
|
+
* caller may defer -- see {@link CONTROLLER_PROMOTION_STAGE}).
|
|
29
|
+
*/
|
|
30
|
+
export declare const CREDENTIAL_ANCHORED_GENESIS_STAGES: readonly ["space-provisioning", "kms-authentication", "webvh-genesis", "roster-genesis", "collection-epochs"];
|
|
31
|
+
/**
|
|
32
|
+
* A stage name the credential-anchored genesis may emit.
|
|
33
|
+
*/
|
|
34
|
+
export type CredentialAnchoredGenesisStage = (typeof CREDENTIAL_ANCHORED_GENESIS_STAGES)[number] | typeof CONTROLLER_PROMOTION_STAGE;
|
|
35
|
+
/**
|
|
36
|
+
* The establishment's stage names in the order they fire: its own marks with
|
|
37
|
+
* the genesis ceremony's spliced in where that ceremony runs (stage 2).
|
|
38
|
+
*
|
|
39
|
+
* Two kinds of name are absent by construction. The stages whose body is a
|
|
40
|
+
* caller's own closure (`beforePromotion`, `promoteKeystore`) are the
|
|
41
|
+
* caller's to name and mark, since only the caller knows what its closure
|
|
42
|
+
* does; and an alias below fires in place of a listed name rather than
|
|
43
|
+
* beside it.
|
|
44
|
+
*/
|
|
45
|
+
export declare const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES: readonly ["interim-bind", "space-provisioning", "kms-authentication", "webvh-genesis", "roster-genesis", "collection-epochs", "account-log-read", "annex-generation", "record-rebind", "controller-promotion"];
|
|
46
|
+
/**
|
|
47
|
+
* A stage the establishment reports as a step of its own.
|
|
48
|
+
*/
|
|
49
|
+
export type CredentialAnchoredEstablishmentStage = (typeof CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES)[number];
|
|
50
|
+
/**
|
|
51
|
+
* Stage names that fire in place of a listed stage rather than beside it,
|
|
52
|
+
* and the stage each stands in for. The heal branch delivers the collection
|
|
53
|
+
* epochs off an adopted roster instead of minting them, so its mark closes
|
|
54
|
+
* the boundary `collection-epochs` closes on a fresh run.
|
|
55
|
+
*/
|
|
56
|
+
export declare const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES: {
|
|
57
|
+
readonly 'roster-delivered-epochs': "collection-epochs";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Every name the establishment may emit: the stages above plus the aliases.
|
|
61
|
+
*/
|
|
62
|
+
export type CredentialAnchoredEstablishmentStageName = CredentialAnchoredEstablishmentStage | keyof typeof CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES;
|
|
63
|
+
//# sourceMappingURL=stages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/stages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,OAAO,EAAE,wBAAwB,EAAE,CAAA;AAEnC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,yBAAyB,CAAA;AAEhE;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,+GAMrC,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,GACnD,OAAO,0BAA0B,CAAA;AAErC;;;;;;;;;GASG;AACH,eAAO,MAAM,wCAAwC,gNAO3C,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAC9C,CAAC,OAAO,wCAAwC,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,+CAA+C;;CAEa,CAAA;AAEzE;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAChD,oCAAoC,GACpC,MAAM,OAAO,+CAA+C,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The stage vocabulary of the credential-anchored ceremonies: the ordered
|
|
6
|
+
* tuples their `onStage` notifiers report from, the aliases, and the union
|
|
7
|
+
* types derived from them. The ceremonies emit from these types, so a
|
|
8
|
+
* mistyped stage name fails the type check, and a consumer's progress
|
|
9
|
+
* display derives its step list from the tuples instead of re-declaring the
|
|
10
|
+
* names as bare strings.
|
|
11
|
+
*
|
|
12
|
+
* The vocabulary sits in a leaf module of its own rather than beside the
|
|
13
|
+
* code that emits it, because a progress display needs the names and none of
|
|
14
|
+
* the ceremony: an app store importing them from `establish.js` would pull
|
|
15
|
+
* that whole module graph into its bundle.
|
|
16
|
+
*/
|
|
17
|
+
import { KMS_AUTHENTICATION_STAGE } from '../stages.js';
|
|
18
|
+
export { KMS_AUTHENTICATION_STAGE };
|
|
19
|
+
/**
|
|
20
|
+
* The controller-promotion stage, emitted by the genesis ceremony when it
|
|
21
|
+
* promotes and by the establishment when the promotion is deferred to it.
|
|
22
|
+
* Declared once so the two emitters cannot drift apart.
|
|
23
|
+
*/
|
|
24
|
+
export const CONTROLLER_PROMOTION_STAGE = 'controller-promotion';
|
|
25
|
+
/**
|
|
26
|
+
* The stages `ensureCredentialAnchoredAccountGenesis` reports, in the order
|
|
27
|
+
* they fire, up to but not including the controller promotion (which a
|
|
28
|
+
* caller may defer -- see {@link CONTROLLER_PROMOTION_STAGE}).
|
|
29
|
+
*/
|
|
30
|
+
export const CREDENTIAL_ANCHORED_GENESIS_STAGES = [
|
|
31
|
+
'space-provisioning',
|
|
32
|
+
KMS_AUTHENTICATION_STAGE,
|
|
33
|
+
'webvh-genesis',
|
|
34
|
+
'roster-genesis',
|
|
35
|
+
'collection-epochs'
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* The establishment's stage names in the order they fire: its own marks with
|
|
39
|
+
* the genesis ceremony's spliced in where that ceremony runs (stage 2).
|
|
40
|
+
*
|
|
41
|
+
* Two kinds of name are absent by construction. The stages whose body is a
|
|
42
|
+
* caller's own closure (`beforePromotion`, `promoteKeystore`) are the
|
|
43
|
+
* caller's to name and mark, since only the caller knows what its closure
|
|
44
|
+
* does; and an alias below fires in place of a listed name rather than
|
|
45
|
+
* beside it.
|
|
46
|
+
*/
|
|
47
|
+
export const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES = [
|
|
48
|
+
'interim-bind',
|
|
49
|
+
...CREDENTIAL_ANCHORED_GENESIS_STAGES,
|
|
50
|
+
'account-log-read',
|
|
51
|
+
'annex-generation',
|
|
52
|
+
'record-rebind',
|
|
53
|
+
CONTROLLER_PROMOTION_STAGE
|
|
54
|
+
];
|
|
55
|
+
/**
|
|
56
|
+
* Stage names that fire in place of a listed stage rather than beside it,
|
|
57
|
+
* and the stage each stands in for. The heal branch delivers the collection
|
|
58
|
+
* epochs off an adopted roster instead of minting them, so its mark closes
|
|
59
|
+
* the boundary `collection-epochs` closes on a fresh run.
|
|
60
|
+
*/
|
|
61
|
+
export const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES = {
|
|
62
|
+
'roster-delivered-epochs': 'collection-epochs'
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=stages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages.js","sourceRoot":"","sources":["../../src/clientAnnex/stages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,OAAO,EAAE,wBAAwB,EAAE,CAAA;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAA;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,oBAAoB;IACpB,wBAAwB;IACxB,eAAe;IACf,gBAAgB;IAChB,mBAAmB;CACX,CAAA;AASV;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG;IACtD,cAAc;IACd,GAAG,kCAAkC;IACrC,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,0BAA0B;CAClB,CAAA;AAQV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAG;IAC7D,yBAAyB,EAAE,mBAAmB;CACyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcap.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zcap.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAgDxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,UAAU,CAAC,CAGtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkB5B"}
|