@interop/wallet-core 0.51.0 → 0.53.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 +7 -11
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +2 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +1 -1
- package/dist/clientAnnex/forget.d.ts +18 -6
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +19 -6
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +51 -30
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +72 -26
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -3
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +2 -2
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +6 -6
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +5 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +19 -11
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +77 -14
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +146 -10
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +230 -26
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +6 -6
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +8 -8
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +18 -7
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +54 -14
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +67 -6
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +91 -15
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clients/listing.d.ts +1 -1
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +1 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +10 -7
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.js +1 -1
- package/dist/descriptors/logSource.d.ts +6 -4
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +7 -4
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +1 -1
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +2 -1
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +1 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +6 -20
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +8 -5
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/unlockSpace.js +1 -1
- package/dist/keys/clientKeyRecord.d.ts +68 -1
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +155 -20
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +2 -2
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +16 -14
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +164 -32
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +8 -7
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +6 -6
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +1 -1
- package/dist/keys/spaceEpochs.js +1 -1
- package/dist/keys/userKeyRoster.d.ts +3 -3
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +3 -3
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/log.d.ts +49 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +53 -0
- package/dist/log.js.map +1 -0
- package/dist/recovery/index.d.ts +2 -2
- package/dist/recovery/index.js +2 -2
- package/dist/recovery/recoveryDelegation.d.ts +6 -2
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +32 -6
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +67 -8
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +114 -19
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/appKey.d.ts +9 -3
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +13 -8
- package/dist/request/appKey.js.map +1 -1
- package/dist/request/capabilityRequest.d.ts +9 -1
- package/dist/request/capabilityRequest.d.ts.map +1 -1
- package/dist/request/capabilityRequest.js +13 -2
- package/dist/request/capabilityRequest.js.map +1 -1
- package/dist/request/classify.d.ts +37 -1
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +74 -3
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +5 -18
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js +9 -3
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/exchangeClient.d.ts +0 -23
- package/dist/request/exchangeClient.d.ts.map +1 -1
- package/dist/request/exchangeClient.js +30 -1
- package/dist/request/exchangeClient.js.map +1 -1
- package/dist/request/index.d.ts +4 -1
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +4 -1
- package/dist/request/index.js.map +1 -1
- package/dist/request/interactionRequest.d.ts +23 -0
- package/dist/request/interactionRequest.d.ts.map +1 -0
- package/dist/request/interactionRequest.js +46 -0
- package/dist/request/interactionRequest.js.map +1 -0
- package/dist/request/interactionUrl.d.ts +3 -14
- package/dist/request/interactionUrl.d.ts.map +1 -1
- package/dist/request/interactionUrl.js +24 -3
- package/dist/request/interactionUrl.js.map +1 -1
- package/dist/request/parse.d.ts +0 -10
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +15 -1
- package/dist/request/parse.js.map +1 -1
- package/dist/request/processRequest.d.ts.map +1 -1
- package/dist/request/processRequest.js +2 -1
- package/dist/request/processRequest.js.map +1 -1
- package/dist/request/types.d.ts +23 -2
- package/dist/request/types.d.ts.map +1 -1
- package/dist/resourceLog/controller.d.ts +48 -49
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +41 -20
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/errors.d.ts +12 -78
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +12 -79
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +17 -22
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +16 -21
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/license.d.ts +42 -27
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +53 -30
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +48 -1
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +52 -4
- package/dist/space/activity.js.map +1 -1
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/pull.d.ts +0 -22
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +30 -2
- package/dist/sync/pull.js.map +1 -1
- package/dist/unlock/index.d.ts +7 -7
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +6 -6
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +29 -28
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +25 -16
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts +1 -1
- package/dist/unlock/standingClient.js +3 -3
- package/dist/unlock/standingWebvh.d.ts +28 -10
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +75 -37
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +37 -0
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +54 -1
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +2 -2
- package/dist/webvh/delegatedLogStore.js +2 -2
- package/dist/webvh/didWeb.js +1 -1
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +33 -3
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +40 -11
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +1 -1
- 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/listClients.js +1 -1
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +1 -1
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +1 -2
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +9 -11
- package/dist/display/alignment.d.ts +0 -55
- package/dist/display/alignment.d.ts.map +0 -1
- package/dist/display/alignment.js +0 -117
- package/dist/display/alignment.js.map +0 -1
- package/dist/display/credentialName.d.ts +0 -42
- package/dist/display/credentialName.d.ts.map +0 -1
- package/dist/display/credentialName.js +0 -106
- package/dist/display/credentialName.js.map +0 -1
- package/dist/display/displayFields.d.ts +0 -59
- package/dist/display/displayFields.d.ts.map +0 -1
- package/dist/display/displayFields.js +0 -136
- package/dist/display/displayFields.js.map +0 -1
- package/dist/display/evidence.d.ts +0 -50
- package/dist/display/evidence.d.ts.map +0 -1
- package/dist/display/evidence.js +0 -67
- package/dist/display/evidence.js.map +0 -1
- package/dist/display/image.d.ts +0 -18
- package/dist/display/image.d.ts.map +0 -1
- package/dist/display/image.js +0 -23
- package/dist/display/image.js.map +0 -1
- package/dist/display/index.d.ts +0 -38
- package/dist/display/index.d.ts.map +0 -1
- package/dist/display/index.js +0 -32
- package/dist/display/index.js.map +0 -1
- package/dist/display/issuer.d.ts +0 -105
- package/dist/display/issuer.d.ts.map +0 -1
- package/dist/display/issuer.js +0 -126
- package/dist/display/issuer.js.map +0 -1
- package/dist/display/obv3.d.ts +0 -82
- package/dist/display/obv3.d.ts.map +0 -1
- package/dist/display/obv3.js +0 -117
- package/dist/display/obv3.js.map +0 -1
- package/dist/display/parse.d.ts +0 -66
- package/dist/display/parse.d.ts.map +0 -1
- package/dist/display/parse.js +0 -104
- package/dist/display/parse.js.map +0 -1
- package/dist/display/subject.d.ts +0 -79
- package/dist/display/subject.d.ts.map +0 -1
- package/dist/display/subject.js +0 -124
- package/dist/display/subject.js.map +0 -1
- package/dist/display/text.d.ts +0 -53
- package/dist/display/text.d.ts.map +0 -1
- package/dist/display/text.js +0 -78
- package/dist/display/text.js.map +0 -1
- package/dist/display/types.d.ts +0 -55
- package/dist/display/types.d.ts.map +0 -1
- package/dist/display/types.js +0 -41
- package/dist/display/types.js.map +0 -1
- package/dist/display/validity.d.ts +0 -51
- package/dist/display/validity.d.ts.map +0 -1
- package/dist/display/validity.js +0 -51
- package/dist/display/validity.js.map +0 -1
- package/dist/display/verificationView.d.ts +0 -115
- package/dist/display/verificationView.d.ts.map +0 -1
- package/dist/display/verificationView.js +0 -199
- package/dist/display/verificationView.js.map +0 -1
- package/dist/resourceLog/append.d.ts +0 -112
- package/dist/resourceLog/append.d.ts.map +0 -1
- package/dist/resourceLog/append.js +0 -197
- package/dist/resourceLog/append.js.map +0 -1
- package/dist/resourceLog/entry.d.ts +0 -68
- package/dist/resourceLog/entry.d.ts.map +0 -1
- package/dist/resourceLog/entry.js +0 -167
- package/dist/resourceLog/entry.js.map +0 -1
- package/dist/resourceLog/pin.d.ts +0 -82
- package/dist/resourceLog/pin.d.ts.map +0 -1
- package/dist/resourceLog/pin.js +0 -57
- package/dist/resourceLog/pin.js.map +0 -1
- package/dist/resourceLog/seal.d.ts +0 -97
- package/dist/resourceLog/seal.d.ts.map +0 -1
- package/dist/resourceLog/seal.js +0 -113
- package/dist/resourceLog/seal.js.map +0 -1
- package/dist/resourceLog/verify.d.ts +0 -96
- package/dist/resourceLog/verify.d.ts.map +0 -1
- package/dist/resourceLog/verify.js +0 -474
- package/dist/resourceLog/verify.js.map +0 -1
- package/dist/resourceLog/vmFragment.d.ts +0 -33
- package/dist/resourceLog/vmFragment.d.ts.map +0 -1
- package/dist/resourceLog/vmFragment.js +0 -39
- package/dist/resourceLog/vmFragment.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ResourceLogIntegrityError } from '
|
|
1
|
+
import { ResourceLogIntegrityError } from '@interop/vh-resource-log';
|
|
2
|
+
import { assertLadderAppendLicensed } from './license.js';
|
|
2
3
|
/**
|
|
3
4
|
* Resolves one relation entry: an embedded verification method verbatim, a
|
|
4
5
|
* string reference through the given `verificationMethod` index.
|
|
@@ -55,21 +56,21 @@ function assertionKeysOf(doc) {
|
|
|
55
56
|
return keys;
|
|
56
57
|
}
|
|
57
58
|
/**
|
|
58
|
-
* Collects a document's credential-
|
|
59
|
-
* {@link
|
|
59
|
+
* Collects a document's credential-inventory view (see
|
|
60
|
+
* {@link ControllerInventory}): the ladder VMs by relation asymmetry
|
|
60
61
|
* (`capabilityDelegation` members absent from `capabilityInvocation`,
|
|
61
62
|
* compared by verification-method id), and S(V) as the account-controlled
|
|
62
63
|
* `keyAgreement` methods' key material -- `publicKeyCommitment` where the
|
|
63
64
|
* entry is a commitment, `publicKeyMultibase` where it is verbatim (the two
|
|
64
65
|
* value spaces are disjoint) -- union the ladder keys. A `keyAgreement`
|
|
65
66
|
* method carrying neither is skipped: an unidentifiable entry must not make
|
|
66
|
-
* two distinct
|
|
67
|
+
* two distinct inventories compare equal.
|
|
67
68
|
*
|
|
68
69
|
* @param doc {ControllerDocument}
|
|
69
|
-
* @param did {string} the account DID
|
|
70
|
-
* @returns {
|
|
70
|
+
* @param did {string} the account DID inventory entries are controlled by
|
|
71
|
+
* @returns {ControllerInventory}
|
|
71
72
|
*/
|
|
72
|
-
function
|
|
73
|
+
function inventoryOf(doc, did) {
|
|
73
74
|
const byId = methodsById(doc);
|
|
74
75
|
const invocable = new Set();
|
|
75
76
|
for (const entry of doc.capabilityInvocation ?? []) {
|
|
@@ -89,20 +90,20 @@ function postureOf(doc, did) {
|
|
|
89
90
|
ladderKeys.add(method.publicKeyMultibase);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
+
const inventoryKeys = new Set(ladderKeys);
|
|
93
94
|
for (const entry of doc.keyAgreement ?? []) {
|
|
94
95
|
const method = resolveMethod(entry, byId);
|
|
95
96
|
if (!method || method.controller !== did) {
|
|
96
97
|
continue;
|
|
97
98
|
}
|
|
98
99
|
if (typeof method.publicKeyCommitment === 'string') {
|
|
99
|
-
|
|
100
|
+
inventoryKeys.add(method.publicKeyCommitment);
|
|
100
101
|
}
|
|
101
102
|
else if (typeof method.publicKeyMultibase === 'string') {
|
|
102
|
-
|
|
103
|
+
inventoryKeys.add(method.publicKeyMultibase);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
return { ladderKeys,
|
|
106
|
+
return { ladderKeys, inventoryKeys };
|
|
106
107
|
}
|
|
107
108
|
/**
|
|
108
109
|
* Builds the controller view over an already-verified did:webvh account log
|
|
@@ -110,30 +111,38 @@ function postureOf(doc, did) {
|
|
|
110
111
|
* not verified against the account pointer). Because every verified entry
|
|
111
112
|
* carries its resolved document in `state`, the per-version `assertionMethod`
|
|
112
113
|
* sets are read straight off those entries in one linear pass over the log
|
|
113
|
-
* rather than replaying resolution once per version.
|
|
114
|
-
*
|
|
114
|
+
* rather than replaying resolution once per version. A lookup at a version
|
|
115
|
+
* the log does not carry refuses instead of guessing, and `undefined`
|
|
115
116
|
* answers from the last entry (the current document).
|
|
116
117
|
*
|
|
118
|
+
* The returned view carries the `admitAppend` hook: it resolves the
|
|
119
|
+
* inventory at the proof's controller versionId, and where the signing key
|
|
120
|
+
* is a ladder VM there it runs the ceremony-tail license
|
|
121
|
+
* (`assertLadderAppendLicensed`) --
|
|
122
|
+
* so ordinary client-signed appends admit untouched, and a ladder-signed
|
|
123
|
+
* append outside the license refuses with `ResourceLogLicenseError`,
|
|
124
|
+
* propagated with its class intact by the library's verifier.
|
|
125
|
+
*
|
|
117
126
|
* @param options {object}
|
|
118
127
|
* @param options.did {string} the account's did:webvh, as verified
|
|
119
128
|
* @param options.log {DIDLog} the verified account log
|
|
120
|
-
* @returns {
|
|
129
|
+
* @returns {WebvhResourceLogController}
|
|
121
130
|
*/
|
|
122
131
|
export function webvhResourceLogController({ did, log }) {
|
|
123
132
|
const versionIds = log.map(entry => entry.versionId);
|
|
124
133
|
const keysByVersion = new Map();
|
|
125
|
-
const
|
|
134
|
+
const inventoryByVersion = new Map();
|
|
126
135
|
for (const entry of log) {
|
|
127
136
|
const doc = entry.state;
|
|
128
137
|
keysByVersion.set(entry.versionId, assertionKeysOf(doc));
|
|
129
|
-
|
|
138
|
+
inventoryByVersion.set(entry.versionId, inventoryOf(doc, did));
|
|
130
139
|
}
|
|
131
140
|
const head = log.length === 0 ? undefined : log[log.length - 1];
|
|
132
141
|
function versionRefusal(versionId) {
|
|
133
142
|
return new ResourceLogIntegrityError(`The controller document did not resolve at version ` +
|
|
134
143
|
`"${versionId ?? '<head>'}" (no document returned).`);
|
|
135
144
|
}
|
|
136
|
-
|
|
145
|
+
const view = {
|
|
137
146
|
did,
|
|
138
147
|
versionIds,
|
|
139
148
|
assertionKeysAt(versionId) {
|
|
@@ -145,15 +154,27 @@ export function webvhResourceLogController({ did, log }) {
|
|
|
145
154
|
}
|
|
146
155
|
return Promise.resolve(resolved);
|
|
147
156
|
},
|
|
148
|
-
|
|
157
|
+
inventoryAt(versionId) {
|
|
149
158
|
const resolved = versionId === undefined
|
|
150
|
-
? head &&
|
|
151
|
-
:
|
|
159
|
+
? head && inventoryByVersion.get(head.versionId)
|
|
160
|
+
: inventoryByVersion.get(versionId);
|
|
152
161
|
if (!resolved) {
|
|
153
162
|
return Promise.reject(versionRefusal(versionId));
|
|
154
163
|
}
|
|
155
164
|
return Promise.resolve(resolved);
|
|
165
|
+
},
|
|
166
|
+
async admitAppend({ keyMultibase, controllerVersionId, controllerVersionIndex, headControllerVersionIndex, proofKeys }) {
|
|
167
|
+
const inventory = await view.inventoryAt(controllerVersionId);
|
|
168
|
+
if (inventory.ladderKeys.has(keyMultibase)) {
|
|
169
|
+
await assertLadderAppendLicensed({
|
|
170
|
+
controller: view,
|
|
171
|
+
controllerVersionIndex,
|
|
172
|
+
headControllerVersionIndex,
|
|
173
|
+
proofKeys
|
|
174
|
+
});
|
|
175
|
+
}
|
|
156
176
|
}
|
|
157
177
|
};
|
|
178
|
+
return view;
|
|
158
179
|
}
|
|
159
180
|
//# sourceMappingURL=controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/resourceLog/controller.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/resourceLog/controller.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAyEzD;;;;;;;GAOG;AACH,SAAS,aAAa,CACpB,KAA4C,EAC5C,IAA+C;IAE/C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC5D,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAClB,GAAuB;IAEvB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAwC,CAAA;IAC5D,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,kBAAkB,IAAI,EAAE,EAAE,CAAC;QAClD,IAAI,OAAO,MAAM,EAAE,EAAE,KAAK,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,KAA4C;IAE5C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAA;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,GAAuB;IAC9C,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,KAAK,MAAM,KAAK,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,0BAA0B,EAC1B,SAAS,EACV;YACC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAA;YAC7D,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC3C,MAAM,0BAA0B,CAAC;oBAC/B,UAAU,EAAE,IAAI;oBAChB,sBAAsB;oBACtB,0BAA0B;oBAC1B,SAAS;iBACV,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;KACF,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -2,73 +2,24 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The resource-log
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
* conflicts with what this client has already accepted: a rollback behind
|
|
15
|
-
* the chain-head pin, a fork off the pinned history, or an SCID/method
|
|
16
|
-
* switch outside a verified handover. The log may be internally consistent;
|
|
17
|
-
* it is not the continuation of the history this client pinned.
|
|
18
|
-
* - {@link ResourceLogClosedError} -- an append refused because the verified
|
|
19
|
-
* head is a terminal handover entry. Not an attack: the log's own authors
|
|
20
|
-
* closed it, and a verifier of this profile must refuse to extend a closed
|
|
21
|
-
* log even though nothing currently emits terminal entries.
|
|
22
|
-
* - {@link ResourceLogLicenseError} -- a ladder-signed append outside the
|
|
23
|
-
* ceremony-tail license. An admission refusal, not log corruption: the
|
|
24
|
-
* append (attempted, or already served) is not licensed, and the same
|
|
25
|
-
* append can become licensed after a posture-changing controller-document
|
|
26
|
-
* entry -- callers must not treat it with the reject-the-whole-log
|
|
27
|
-
* severity of the integrity class.
|
|
5
|
+
* The one refusal class the resource-log layer still owns after the generic
|
|
6
|
+
* client side moved to `@interop/vh-resource-log`: the ceremony-tail license
|
|
7
|
+
* refusal. The generic taxonomy (`ResourceLogIntegrityError`,
|
|
8
|
+
* `ResourceLogContinuityError`, `ResourceLogClosedError`,
|
|
9
|
+
* `LogNotConfirmedError`, and the store port's `ResourceLogConflictError`)
|
|
10
|
+
* is the library's; wallet-core re-exports none of it -- one owner per name.
|
|
11
|
+
* Like every class in that taxonomy, this one assigns its `name` string
|
|
12
|
+
* explicitly and is matched by `err.name` across package boundaries (the
|
|
13
|
+
* WC-64 rule; minified class names do not survive bundling).
|
|
28
14
|
*/
|
|
29
|
-
/**
|
|
30
|
-
* A served log failed verification: malformed entries, a non-verifying SCID,
|
|
31
|
-
* a broken hash chain, a failing proof, or a signer the controller document
|
|
32
|
-
* does not back at the entry's anchored version. Fabrication-class: refused
|
|
33
|
-
* as something no enrolled client produced.
|
|
34
|
-
*/
|
|
35
|
-
export declare class ResourceLogIntegrityError extends Error {
|
|
36
|
-
constructor(message: string, options?: {
|
|
37
|
-
cause?: unknown;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A served log conflicts with this client's chain-head pin: `rollback` (the
|
|
42
|
-
* served head is behind the pinned head -- possibly replication lag; the pin
|
|
43
|
-
* is never regressed and the caller may retry), `fork` (the served log
|
|
44
|
-
* diverges from the pinned history -- both logs are transferable evidence of
|
|
45
|
-
* equivocation, so the served entries ride along), `scid-switch` /
|
|
46
|
-
* `method-switch` (a different log identity or format under the pinned
|
|
47
|
-
* location, outside a verified handover).
|
|
48
|
-
*/
|
|
49
|
-
export declare class ResourceLogContinuityError extends Error {
|
|
50
|
-
reason: 'rollback' | 'fork' | 'scid-switch' | 'method-switch';
|
|
51
|
-
pinnedHead: string;
|
|
52
|
-
/**
|
|
53
|
-
* On a `fork`, the full served log retained as evidence: every entry is
|
|
54
|
-
* signed, so a conflicting pair of logs under one SCID is transferable,
|
|
55
|
-
* independently verifiable proof of equivocation.
|
|
56
|
-
*/
|
|
57
|
-
servedEntries?: unknown[];
|
|
58
|
-
constructor({ reason, pinnedHead, servedEntries }: {
|
|
59
|
-
reason: 'rollback' | 'fork' | 'scid-switch' | 'method-switch';
|
|
60
|
-
pinnedHead: string;
|
|
61
|
-
servedEntries?: unknown[];
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
15
|
/**
|
|
65
16
|
* A ladder-signed append outside the ceremony-tail license: it is not the
|
|
66
|
-
* log's first entry, and it does not
|
|
67
|
-
* document version no verified entry already
|
|
17
|
+
* log's first entry, and it does not carry an inventory-changing controller
|
|
18
|
+
* document version no verified entry already carries at or past. Above all
|
|
68
19
|
* this refuses the silent-rekey shape -- a ladder-signed rotation against an
|
|
69
20
|
* unchanged document. Write-time admission class: the log is not corrupt and
|
|
70
21
|
* whoever signed the append genuinely holds the credential; the append is
|
|
71
|
-
* merely unlicensed, and a retry after a
|
|
22
|
+
* merely unlicensed, and a retry after a inventory-changing document entry may
|
|
72
23
|
* succeed.
|
|
73
24
|
*/
|
|
74
25
|
export declare class ResourceLogLicenseError extends Error {
|
|
@@ -76,21 +27,4 @@ export declare class ResourceLogLicenseError extends Error {
|
|
|
76
27
|
cause?: unknown;
|
|
77
28
|
});
|
|
78
29
|
}
|
|
79
|
-
/**
|
|
80
|
-
* An append was refused because the log's verified head is a terminal
|
|
81
|
-
* handover entry: the log is closed and names a successor, and this profile
|
|
82
|
-
* forbids extending a history its authors have closed.
|
|
83
|
-
*/
|
|
84
|
-
export declare class ResourceLogClosedError extends Error {
|
|
85
|
-
nextLog: {
|
|
86
|
-
method: string;
|
|
87
|
-
scid: string;
|
|
88
|
-
};
|
|
89
|
-
constructor({ nextLog }: {
|
|
90
|
-
nextLog: {
|
|
91
|
-
method: string;
|
|
92
|
-
scid: string;
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
30
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D"}
|
|
@@ -2,77 +2,24 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The resource-log
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
* conflicts with what this client has already accepted: a rollback behind
|
|
15
|
-
* the chain-head pin, a fork off the pinned history, or an SCID/method
|
|
16
|
-
* switch outside a verified handover. The log may be internally consistent;
|
|
17
|
-
* it is not the continuation of the history this client pinned.
|
|
18
|
-
* - {@link ResourceLogClosedError} -- an append refused because the verified
|
|
19
|
-
* head is a terminal handover entry. Not an attack: the log's own authors
|
|
20
|
-
* closed it, and a verifier of this profile must refuse to extend a closed
|
|
21
|
-
* log even though nothing currently emits terminal entries.
|
|
22
|
-
* - {@link ResourceLogLicenseError} -- a ladder-signed append outside the
|
|
23
|
-
* ceremony-tail license. An admission refusal, not log corruption: the
|
|
24
|
-
* append (attempted, or already served) is not licensed, and the same
|
|
25
|
-
* append can become licensed after a posture-changing controller-document
|
|
26
|
-
* entry -- callers must not treat it with the reject-the-whole-log
|
|
27
|
-
* severity of the integrity class.
|
|
5
|
+
* The one refusal class the resource-log layer still owns after the generic
|
|
6
|
+
* client side moved to `@interop/vh-resource-log`: the ceremony-tail license
|
|
7
|
+
* refusal. The generic taxonomy (`ResourceLogIntegrityError`,
|
|
8
|
+
* `ResourceLogContinuityError`, `ResourceLogClosedError`,
|
|
9
|
+
* `LogNotConfirmedError`, and the store port's `ResourceLogConflictError`)
|
|
10
|
+
* is the library's; wallet-core re-exports none of it -- one owner per name.
|
|
11
|
+
* Like every class in that taxonomy, this one assigns its `name` string
|
|
12
|
+
* explicitly and is matched by `err.name` across package boundaries (the
|
|
13
|
+
* WC-64 rule; minified class names do not survive bundling).
|
|
28
14
|
*/
|
|
29
|
-
/**
|
|
30
|
-
* A served log failed verification: malformed entries, a non-verifying SCID,
|
|
31
|
-
* a broken hash chain, a failing proof, or a signer the controller document
|
|
32
|
-
* does not back at the entry's anchored version. Fabrication-class: refused
|
|
33
|
-
* as something no enrolled client produced.
|
|
34
|
-
*/
|
|
35
|
-
export class ResourceLogIntegrityError extends Error {
|
|
36
|
-
constructor(message, options) {
|
|
37
|
-
super(message, options);
|
|
38
|
-
this.name = 'ResourceLogIntegrityError';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* A served log conflicts with this client's chain-head pin: `rollback` (the
|
|
43
|
-
* served head is behind the pinned head -- possibly replication lag; the pin
|
|
44
|
-
* is never regressed and the caller may retry), `fork` (the served log
|
|
45
|
-
* diverges from the pinned history -- both logs are transferable evidence of
|
|
46
|
-
* equivocation, so the served entries ride along), `scid-switch` /
|
|
47
|
-
* `method-switch` (a different log identity or format under the pinned
|
|
48
|
-
* location, outside a verified handover).
|
|
49
|
-
*/
|
|
50
|
-
export class ResourceLogContinuityError extends Error {
|
|
51
|
-
reason;
|
|
52
|
-
pinnedHead;
|
|
53
|
-
/**
|
|
54
|
-
* On a `fork`, the full served log retained as evidence: every entry is
|
|
55
|
-
* signed, so a conflicting pair of logs under one SCID is transferable,
|
|
56
|
-
* independently verifiable proof of equivocation.
|
|
57
|
-
*/
|
|
58
|
-
servedEntries;
|
|
59
|
-
constructor({ reason, pinnedHead, servedEntries }) {
|
|
60
|
-
super(`The served resource log is not a continuation of the pinned history ` +
|
|
61
|
-
`(${reason}; pinned head ${pinnedHead}).`);
|
|
62
|
-
this.name = 'ResourceLogContinuityError';
|
|
63
|
-
this.reason = reason;
|
|
64
|
-
this.pinnedHead = pinnedHead;
|
|
65
|
-
this.servedEntries = servedEntries;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
15
|
/**
|
|
69
16
|
* A ladder-signed append outside the ceremony-tail license: it is not the
|
|
70
|
-
* log's first entry, and it does not
|
|
71
|
-
* document version no verified entry already
|
|
17
|
+
* log's first entry, and it does not carry an inventory-changing controller
|
|
18
|
+
* document version no verified entry already carries at or past. Above all
|
|
72
19
|
* this refuses the silent-rekey shape -- a ladder-signed rotation against an
|
|
73
20
|
* unchanged document. Write-time admission class: the log is not corrupt and
|
|
74
21
|
* whoever signed the append genuinely holds the credential; the append is
|
|
75
|
-
* merely unlicensed, and a retry after a
|
|
22
|
+
* merely unlicensed, and a retry after a inventory-changing document entry may
|
|
76
23
|
* succeed.
|
|
77
24
|
*/
|
|
78
25
|
export class ResourceLogLicenseError extends Error {
|
|
@@ -81,18 +28,4 @@ export class ResourceLogLicenseError extends Error {
|
|
|
81
28
|
this.name = 'ResourceLogLicenseError';
|
|
82
29
|
}
|
|
83
30
|
}
|
|
84
|
-
/**
|
|
85
|
-
* An append was refused because the log's verified head is a terminal
|
|
86
|
-
* handover entry: the log is closed and names a successor, and this profile
|
|
87
|
-
* forbids extending a history its authors have closed.
|
|
88
|
-
*/
|
|
89
|
-
export class ResourceLogClosedError extends Error {
|
|
90
|
-
nextLog;
|
|
91
|
-
constructor({ nextLog }) {
|
|
92
|
-
super('The resource log is closed by a terminal handover entry; appends must ' +
|
|
93
|
-
'go to its successor log.');
|
|
94
|
-
this.name = 'ResourceLogClosedError';
|
|
95
|
-
this.nextLog = nextLog;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
31
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF"}
|
|
@@ -2,28 +2,23 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The `@interop/wallet-core/resourceLog` entry: the
|
|
6
|
-
* Resource Log Profile
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
5
|
+
* The `@interop/wallet-core/resourceLog` entry: the wallet-domain residue of
|
|
6
|
+
* the Resource Log Profile's client side after the generic half moved to
|
|
7
|
+
* `@interop/vh-resource-log` -- the did:webvh controller adapter (the
|
|
8
|
+
* library's controller port extended with the per-version
|
|
9
|
+
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
|
+
* hook), and the ceremony-tail license the hook carries
|
|
11
|
+
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`).
|
|
12
|
+
* Everything generic -- the JSON Lines codec, the store port and
|
|
13
|
+
* `confirmAppend`, chain verification, the chain-head pin
|
|
14
|
+
* (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
|
|
15
|
+
* stay on their owning subpaths: `accountLogPinId` in `webvh`,
|
|
16
|
+
* `userKeyRosterPinId` in `keys`, `clientAnnexLogPinId` in `clientAnnex`),
|
|
17
|
+
* the append path, and the sealing sweep -- lives in the library, and this
|
|
18
|
+
* subpath re-exports none of it: one owner per name. Kept out of the root
|
|
19
|
+
* export: this subpath pulls the did:webvh and ed25519 dependency graph.
|
|
19
20
|
*/
|
|
20
|
-
export { webvhResourceLogController, type
|
|
21
|
-
export {
|
|
21
|
+
export { webvhResourceLogController, type ControllerInventory, type WebvhResourceLogController } from './controller.js';
|
|
22
|
+
export { ResourceLogLicenseError } from './errors.js';
|
|
22
23
|
export { assertLadderAppendLicensed } from './license.js';
|
|
23
|
-
export { buildResourceLogEntry, buildResourceLogGenesis, type ResourceLogSigner } from './entry.js';
|
|
24
|
-
export { memoryResourceLogPinStore, resourceLogPinId, type ResourceLogHeadPin, type ResourceLogPinStore } from './pin.js';
|
|
25
|
-
export { isTerminalResourceLogEntry, verifyResourceLog, verifyResourceLogHandover, type VerifiedResourceLog } from './verify.js';
|
|
26
|
-
export { appendResourceLog, createResourceLog, readResourceLog } from './append.js';
|
|
27
|
-
export { latestAssertionRemovalIndex, sealResourceLog } from './seal.js';
|
|
28
|
-
export { vmFragmentOf } from './vmFragment.js';
|
|
29
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -2,28 +2,23 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The `@interop/wallet-core/resourceLog` entry: the
|
|
6
|
-
* Resource Log Profile
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
5
|
+
* The `@interop/wallet-core/resourceLog` entry: the wallet-domain residue of
|
|
6
|
+
* the Resource Log Profile's client side after the generic half moved to
|
|
7
|
+
* `@interop/vh-resource-log` -- the did:webvh controller adapter (the
|
|
8
|
+
* library's controller port extended with the per-version
|
|
9
|
+
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
|
+
* hook), and the ceremony-tail license the hook carries
|
|
11
|
+
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`).
|
|
12
|
+
* Everything generic -- the JSON Lines codec, the store port and
|
|
13
|
+
* `confirmAppend`, chain verification, the chain-head pin
|
|
14
|
+
* (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
|
|
15
|
+
* stay on their owning subpaths: `accountLogPinId` in `webvh`,
|
|
16
|
+
* `userKeyRosterPinId` in `keys`, `clientAnnexLogPinId` in `clientAnnex`),
|
|
17
|
+
* the append path, and the sealing sweep -- lives in the library, and this
|
|
18
|
+
* subpath re-exports none of it: one owner per name. Kept out of the root
|
|
19
|
+
* export: this subpath pulls the did:webvh and ed25519 dependency graph.
|
|
19
20
|
*/
|
|
20
21
|
export { webvhResourceLogController } from './controller.js';
|
|
21
|
-
export {
|
|
22
|
+
export { ResourceLogLicenseError } from './errors.js';
|
|
22
23
|
export { assertLadderAppendLicensed } from './license.js';
|
|
23
|
-
export { buildResourceLogEntry, buildResourceLogGenesis } from './entry.js';
|
|
24
|
-
export { memoryResourceLogPinStore, resourceLogPinId } from './pin.js';
|
|
25
|
-
export { isTerminalResourceLogEntry, verifyResourceLog, verifyResourceLogHandover } from './verify.js';
|
|
26
|
-
export { appendResourceLog, createResourceLog, readResourceLog } from './append.js';
|
|
27
|
-
export { latestAssertionRemovalIndex, sealResourceLog } from './seal.js';
|
|
28
|
-
export { vmFragmentOf } from './vmFragment.js';
|
|
29
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,0BAA0B,EAG3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -4,41 +4,56 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The ceremony-tail license on ladder-signed resource-log appends (clause B
|
|
6
6
|
* of the ladder VM's authority clauses). A ladder-signed append is accepted
|
|
7
|
-
* in exactly two shapes: the log's first entry (creation,
|
|
7
|
+
* in exactly two shapes: the log's first entry (creation, not extension --
|
|
8
8
|
* callers admit that shape by not calling this check on a genesis entry),
|
|
9
|
-
* or a rotation
|
|
10
|
-
* one-shot -- refused when the verified log head already carries
|
|
11
|
-
*
|
|
9
|
+
* or a rotation that carries an inventory-changing controller document
|
|
10
|
+
* version, one-shot -- refused when the verified log head already carries
|
|
11
|
+
* an entry at that version or later. Both shapes carry a per-entry rule: at
|
|
12
|
+
* most one of an entry's proofs may be by a ladder key, so a second ladder
|
|
13
|
+
* key cannot co-sign its way around the one-shot. A rotation co-signed by an
|
|
14
|
+
* ordinary member stays licensed. Everything else, above all a rotation
|
|
12
15
|
* against an unchanged document (the silent-rekey shape), is refused with
|
|
13
|
-
* {@link ResourceLogLicenseError}.
|
|
14
|
-
* controller's verified version history, the structural twin of the
|
|
15
|
-
* sweep's `
|
|
16
|
+
* {@link ResourceLogLicenseError}. Controller versions compare by position
|
|
17
|
+
* in the controller's verified version history, the structural twin of the
|
|
18
|
+
* sealing sweep's `headControllerVersionIndex >= removalIndex` check.
|
|
16
19
|
*/
|
|
17
|
-
import type {
|
|
20
|
+
import type { WebvhResourceLogController } from './controller.js';
|
|
18
21
|
/**
|
|
19
22
|
* Evaluates the ceremony-tail license's second shape for one ladder-signed
|
|
20
|
-
* append: the append must
|
|
21
|
-
* S(V) differs from S(V-1) in either direction, with S(-1) empty for
|
|
22
|
-
* genesis
|
|
23
|
-
*
|
|
24
|
-
* so a torn ceremony's late-arriving tail still passes
|
|
25
|
-
* rotation against the same
|
|
26
|
-
* unversioned controller, where no
|
|
27
|
-
* refused fail-closed.
|
|
23
|
+
* append: the append must carry an inventory-changing document version V --
|
|
24
|
+
* S(V) differs from S(V-1) in either direction, with S(-1) empty for the
|
|
25
|
+
* genesis version -- and no verified entry may already carry V or later
|
|
26
|
+
* (`headControllerVersionIndex >= controllerVersionIndex` refuses; the
|
|
27
|
+
* license is one-shot, so a torn ceremony's late-arriving tail still passes
|
|
28
|
+
* while a second rotation against the same version does not). A `null`
|
|
29
|
+
* controller version index (an unversioned controller, where no version
|
|
30
|
+
* exists to license against) is refused fail-closed.
|
|
31
|
+
*
|
|
32
|
+
* The one-shot is spent per entry, so the entry itself may carry at most one
|
|
33
|
+
* ladder-key proof: a second ladder key among `proofKeys` refuses, because
|
|
34
|
+
* every proof of an entry shares one controller version and two ladder
|
|
35
|
+
* signatures would otherwise spend the same version twice. Proof order does
|
|
36
|
+
* not matter -- `proofKeys` is read as a set, and the caller's hook runs on
|
|
37
|
+
* each proof, so the refusal lands on whichever ladder-key proof is admitted
|
|
38
|
+
* first. A ladder proof co-signed by an ordinary member is untouched.
|
|
28
39
|
*
|
|
29
40
|
* @param options {object}
|
|
30
|
-
* @param options.controller {
|
|
31
|
-
*
|
|
32
|
-
* @param options.
|
|
33
|
-
* index into `controller.versionIds` (`null`:
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
41
|
+
* @param options.controller {object} the verified controller view's
|
|
42
|
+
* version list and inventory accessor
|
|
43
|
+
* @param options.controllerVersionIndex {number | null} the append's
|
|
44
|
+
* controller version as an index into `controller.versionIds` (`null`:
|
|
45
|
+
* no controller version)
|
|
46
|
+
* @param options.headControllerVersionIndex {number | null} the verified
|
|
47
|
+
* log head's effective controller version index before this append
|
|
48
|
+
* (`null`: the log has no versioned entries yet)
|
|
49
|
+
* @param options.proofKeys {string[]} every signing-key multibase on the
|
|
50
|
+
* entry, distinct, read as a set
|
|
37
51
|
* @returns {Promise<void>}
|
|
38
52
|
*/
|
|
39
|
-
export declare function assertLadderAppendLicensed({ controller,
|
|
40
|
-
controller:
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
export declare function assertLadderAppendLicensed({ controller, controllerVersionIndex, headControllerVersionIndex, proofKeys }: {
|
|
54
|
+
controller: Pick<WebvhResourceLogController, 'versionIds' | 'inventoryAt'>;
|
|
55
|
+
controllerVersionIndex: number | null;
|
|
56
|
+
headControllerVersionIndex: number | null;
|
|
57
|
+
proofKeys: string[];
|
|
43
58
|
}): Promise<void>;
|
|
44
59
|
//# sourceMappingURL=license.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAsBjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,UAAU,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,SAAS,EACV,EAAE;IACD,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,YAAY,GAAG,aAAa,CAAC,CAAA;IAC1E,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAA;IACzC,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDhB"}
|