@interop/wallet-core 0.101.1 → 0.103.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 +33 -17
- package/dist/audiences/audienceGrant.d.ts +49 -0
- package/dist/audiences/audienceGrant.d.ts.map +1 -0
- package/dist/audiences/audienceGrant.js +46 -0
- package/dist/audiences/audienceGrant.js.map +1 -0
- package/dist/audiences/index.d.ts +10 -0
- package/dist/audiences/index.d.ts.map +1 -0
- package/dist/audiences/index.js +10 -0
- package/dist/audiences/index.js.map +1 -0
- package/dist/clientAnnex/grantRevocation.d.ts +0 -10
- package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
- package/dist/clientAnnex/grantRevocation.js +1 -23
- package/dist/clientAnnex/grantRevocation.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +1 -1
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +1 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +2 -1
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +5 -2
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +3 -1
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/connections/didKey.d.ts +27 -0
- package/dist/connections/didKey.d.ts.map +1 -1
- package/dist/connections/didKey.js +42 -6
- package/dist/connections/didKey.js.map +1 -1
- package/dist/connections/entry.d.ts +95 -13
- package/dist/connections/entry.d.ts.map +1 -1
- package/dist/connections/entry.js +102 -16
- package/dist/connections/entry.js.map +1 -1
- package/dist/connections/grants.d.ts +225 -3
- package/dist/connections/grants.d.ts.map +1 -1
- package/dist/connections/grants.js +293 -8
- package/dist/connections/grants.js.map +1 -1
- package/dist/connections/index.d.ts +15 -8
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +13 -6
- package/dist/connections/index.js.map +1 -1
- package/dist/connections/read.d.ts.map +1 -1
- package/dist/connections/read.js +2 -1
- package/dist/connections/read.js.map +1 -1
- package/dist/connections/resourceId.d.ts +33 -0
- package/dist/connections/resourceId.d.ts.map +1 -1
- package/dist/connections/resourceId.js +88 -8
- package/dist/connections/resourceId.js.map +1 -1
- package/dist/connections/upsert.d.ts +219 -7
- package/dist/connections/upsert.d.ts.map +1 -1
- package/dist/connections/upsert.js +628 -41
- package/dist/connections/upsert.js.map +1 -1
- package/dist/connections/writers.js +2 -1
- package/dist/connections/writers.js.map +1 -1
- 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/descriptors/logSource.d.ts +9 -4
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +13 -6
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/jsonObject.d.ts +16 -0
- package/dist/jsonObject.d.ts.map +1 -0
- package/dist/jsonObject.js +18 -0
- package/dist/jsonObject.js.map +1 -0
- package/dist/keys/index.d.ts +13 -9
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +11 -7
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +46 -0
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +153 -65
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +60 -7
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +165 -47
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +1 -0
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/menders/ids.d.ts +1 -1
- package/dist/menders/ids.d.ts.map +1 -1
- package/dist/menders/ids.js +20 -4
- package/dist/menders/ids.js.map +1 -1
- package/dist/space/collections.d.ts +23 -3
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +26 -2
- package/dist/space/collections.js.map +1 -1
- package/dist/space/inboxMessage.d.ts +47 -0
- package/dist/space/inboxMessage.d.ts.map +1 -0
- package/dist/space/inboxMessage.js +86 -0
- package/dist/space/inboxMessage.js.map +1 -0
- package/dist/space/index.d.ts +6 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +5 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts +23 -10
- package/dist/sync/contactsConflict.d.ts.map +1 -1
- package/dist/sync/contactsConflict.js +40 -21
- package/dist/sync/contactsConflict.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +38 -5
- package/dist/webvh/didWebProjection.d.ts.map +1 -1
- package/dist/webvh/didWebProjection.js +35 -22
- package/dist/webvh/didWebProjection.js.map +1 -1
- package/dist/webvh/index.d.ts +4 -3
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +4 -3
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +19 -2
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +31 -3
- package/dist/webvh/standingZcap.js.map +1 -1
- package/package.json +11 -5
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A delegated zcap carried in an inbox message, verbatim. The parser checks
|
|
3
|
+
* the members named here and keeps every other member as it arrived.
|
|
4
|
+
*/
|
|
5
|
+
export interface InboxMessageZcap {
|
|
6
|
+
id: string;
|
|
7
|
+
controller: string;
|
|
8
|
+
invocationTarget: string;
|
|
9
|
+
proof: Record<string, unknown> | Record<string, unknown>[];
|
|
10
|
+
[member: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The inbox message envelope. `type` is the bare string `'Grant'` (the
|
|
14
|
+
* history Grant activity row carries a one-member array instead).
|
|
15
|
+
*/
|
|
16
|
+
export interface InboxGrantMessage {
|
|
17
|
+
type: 'Grant';
|
|
18
|
+
actor: string;
|
|
19
|
+
object: {
|
|
20
|
+
zcaps: InboxMessageZcap[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds an inbox Grant message carrying the given zcaps verbatim.
|
|
25
|
+
*
|
|
26
|
+
* @param options {object}
|
|
27
|
+
* @param options.actor {string} the sender's did:key
|
|
28
|
+
* @param options.zcaps {InboxMessageZcap[]} the delegated zcaps, at least
|
|
29
|
+
* one
|
|
30
|
+
* @returns {InboxGrantMessage}
|
|
31
|
+
*/
|
|
32
|
+
export declare function inboxGrantMessage({ actor, zcaps }: {
|
|
33
|
+
actor: string;
|
|
34
|
+
zcaps: InboxMessageZcap[];
|
|
35
|
+
}): InboxGrantMessage;
|
|
36
|
+
/**
|
|
37
|
+
* Reads an inbox Grant message. Returns `undefined` for a body that is not
|
|
38
|
+
* one: a non-object body, a `type` other than the bare string `'Grant'`, an
|
|
39
|
+
* `actor` that is not a did:key, or an `object.zcaps` that is not a non-empty
|
|
40
|
+
* array of zcaps each carrying `id`, `controller`, `invocationTarget`, and a
|
|
41
|
+
* `proof`. Unknown members at any level are ignored and kept verbatim.
|
|
42
|
+
*
|
|
43
|
+
* @param body {unknown} the parsed JSON body
|
|
44
|
+
* @returns {InboxGrantMessage | undefined}
|
|
45
|
+
*/
|
|
46
|
+
export declare function parseInboxGrantMessage(body: unknown): InboxGrantMessage | undefined;
|
|
47
|
+
//# sourceMappingURL=inboxMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inboxMessage.d.ts","sourceRoot":"","sources":["../../src/space/inboxMessage.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC1D,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE;QAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAA;CACtC;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAC1B,GAAG,iBAAiB,CAQpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,GACZ,iBAAiB,GAAG,SAAS,CAuB/B"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The inbox message envelope: the one message kind a party POSTs to a
|
|
6
|
+
* wallet's `inbox` collection, or a wallet POSTs to a party's inbox. Shape:
|
|
7
|
+
* `{ type: 'Grant', actor: <did:key>, object: { zcaps: [ <zcap>, ... ] } }`,
|
|
8
|
+
* content type `application/json`, with no `@context`.
|
|
9
|
+
*
|
|
10
|
+
* There is one message kind. An invitation and a renewal are told apart by
|
|
11
|
+
* the zcap target. A zcap targeting the sender's own inbox is a channel
|
|
12
|
+
* capability, and one targeting the recipient's Space is a renewed grant.
|
|
13
|
+
* Every wallet and any agent built on this package share the shape.
|
|
14
|
+
*/
|
|
15
|
+
import { isJsonObject } from '../jsonObject.js';
|
|
16
|
+
import { ACTIVITY_TYPE } from './activity.js';
|
|
17
|
+
function isDidKey(value) {
|
|
18
|
+
return typeof value === 'string' && value.startsWith('did:key:');
|
|
19
|
+
}
|
|
20
|
+
function isInboxMessageZcap(value) {
|
|
21
|
+
if (!isJsonObject(value)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const { id, controller, invocationTarget, proof } = value;
|
|
25
|
+
if (typeof id !== 'string' ||
|
|
26
|
+
id.length === 0 ||
|
|
27
|
+
typeof controller !== 'string' ||
|
|
28
|
+
typeof invocationTarget !== 'string') {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(proof)) {
|
|
32
|
+
return proof.length > 0 && proof.every(isJsonObject);
|
|
33
|
+
}
|
|
34
|
+
return isJsonObject(proof);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Builds an inbox Grant message carrying the given zcaps verbatim.
|
|
38
|
+
*
|
|
39
|
+
* @param options {object}
|
|
40
|
+
* @param options.actor {string} the sender's did:key
|
|
41
|
+
* @param options.zcaps {InboxMessageZcap[]} the delegated zcaps, at least
|
|
42
|
+
* one
|
|
43
|
+
* @returns {InboxGrantMessage}
|
|
44
|
+
*/
|
|
45
|
+
export function inboxGrantMessage({ actor, zcaps }) {
|
|
46
|
+
if (!isDidKey(actor)) {
|
|
47
|
+
throw new TypeError('inbox message: `actor` must be a did:key DID.');
|
|
48
|
+
}
|
|
49
|
+
if (zcaps.length === 0) {
|
|
50
|
+
throw new TypeError('inbox message: `zcaps` must not be empty.');
|
|
51
|
+
}
|
|
52
|
+
return { type: ACTIVITY_TYPE.Grant, actor, object: { zcaps } };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Reads an inbox Grant message. Returns `undefined` for a body that is not
|
|
56
|
+
* one: a non-object body, a `type` other than the bare string `'Grant'`, an
|
|
57
|
+
* `actor` that is not a did:key, or an `object.zcaps` that is not a non-empty
|
|
58
|
+
* array of zcaps each carrying `id`, `controller`, `invocationTarget`, and a
|
|
59
|
+
* `proof`. Unknown members at any level are ignored and kept verbatim.
|
|
60
|
+
*
|
|
61
|
+
* @param body {unknown} the parsed JSON body
|
|
62
|
+
* @returns {InboxGrantMessage | undefined}
|
|
63
|
+
*/
|
|
64
|
+
export function parseInboxGrantMessage(body) {
|
|
65
|
+
if (!isJsonObject(body)) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const { type, actor, object } = body;
|
|
69
|
+
if (type !== ACTIVITY_TYPE.Grant) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
if (!isDidKey(actor)) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
if (!isJsonObject(object)) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const { zcaps } = object;
|
|
79
|
+
if (!Array.isArray(zcaps) ||
|
|
80
|
+
zcaps.length === 0 ||
|
|
81
|
+
!zcaps.every(isInboxMessageZcap)) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
return body;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=inboxMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inboxMessage.js","sourceRoot":"","sources":["../../src/space/inboxMessage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACz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I,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IACxB,IACE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrB,KAAK,CAAC,MAAM,KAAK,CAAC;QAClB,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAChC,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,IAAoC,CAAA;AAC7C,CAAC"}
|
package/dist/space/index.d.ts
CHANGED
|
@@ -35,11 +35,14 @@
|
|
|
35
35
|
* `parseWasLinkPayload` / `encodeWasLinkSecret`) and `isWasLinkPayload`,
|
|
36
36
|
* the recognizer a wallet hands `@interop/wallet-request`'s input
|
|
37
37
|
* classifier.
|
|
38
|
+
* - The inbox message envelope (`InboxGrantMessage`, built by
|
|
39
|
+
* `inboxGrantMessage` and read by `parseInboxGrantMessage`), the one
|
|
40
|
+
* message kind a party POSTs to an inbox, carrying delegated zcaps.
|
|
38
41
|
* - `CEREMONY_IDS` / `CeremonyId`, the typed vocabulary of account ceremony
|
|
39
42
|
* ids, including the ceremonies still implemented app-side.
|
|
40
43
|
*/
|
|
41
44
|
export { deleteSpaceWithCapability } from './deleteSpace.js';
|
|
42
|
-
export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_KEYS_COLLECTION, CONNECTIONS_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_KEYS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
45
|
+
export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_KEYS_COLLECTION, CONNECTIONS_COLLECTION, INBOX_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_KEYS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, INBOX_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
43
46
|
export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, COLLECTION_HISTORY_LOG_SUBRESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
|
|
44
47
|
export type { SpaceProvisionSpec, SpaceCollectionSpec } from './collections.js';
|
|
45
48
|
export { provisionWalletSpace } from './provisioning.js';
|
|
@@ -49,6 +52,8 @@ export type { WalletActivity, ActivityGrant, ImportCollectionOutcome } from './a
|
|
|
49
52
|
export { publicCredentialUrl } from './publicLink.js';
|
|
50
53
|
export { encodeWasLinkSecret, isWasLinkPayload, buildWasLinkPayload, parseWasLinkPayload } from './wasLink.js';
|
|
51
54
|
export type { WasLinkPayload } from './wasLink.js';
|
|
55
|
+
export { inboxGrantMessage, parseInboxGrantMessage } from './inboxMessage.js';
|
|
56
|
+
export type { InboxGrantMessage, InboxMessageZcap } from './inboxMessage.js';
|
|
52
57
|
export { HumanReadableError } from './errors.js';
|
|
53
58
|
export { CEREMONY_IDS } from './ceremony.js';
|
|
54
59
|
export type { CeremonyId } from './ceremony.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,EACtC,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,EAC5B,kCAAkC,EAClC,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,eAAe,CAAA;AACtB,YAAY,EACV,cAAc,EACd,aAAa,EACb,uBAAuB,EACxB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC7E,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/space/index.js
CHANGED
|
@@ -35,17 +35,21 @@
|
|
|
35
35
|
* `parseWasLinkPayload` / `encodeWasLinkSecret`) and `isWasLinkPayload`,
|
|
36
36
|
* the recognizer a wallet hands `@interop/wallet-request`'s input
|
|
37
37
|
* classifier.
|
|
38
|
+
* - The inbox message envelope (`InboxGrantMessage`, built by
|
|
39
|
+
* `inboxGrantMessage` and read by `parseInboxGrantMessage`), the one
|
|
40
|
+
* message kind a party POSTs to an inbox, carrying delegated zcaps.
|
|
38
41
|
* - `CEREMONY_IDS` / `CeremonyId`, the typed vocabulary of account ceremony
|
|
39
42
|
* ids, including the ceremonies still implemented app-side.
|
|
40
43
|
*/
|
|
41
44
|
export { deleteSpaceWithCapability } from './deleteSpace.js';
|
|
42
|
-
export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_KEYS_COLLECTION, CONNECTIONS_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_KEYS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
45
|
+
export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_KEYS_COLLECTION, CONNECTIONS_COLLECTION, INBOX_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_KEYS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, INBOX_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
43
46
|
export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, COLLECTION_HISTORY_LOG_SUBRESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
|
|
44
47
|
export { provisionWalletSpace } from './provisioning.js';
|
|
45
48
|
export { plaintextCollection } from './plaintextCollection.js';
|
|
46
49
|
export { ACTIVITY_TYPE, addHistoryNewAccount, addHistorySpaceCreated, addHistoryCredentialCreated, addHistoryCredentialDeleted, addHistoryCredentialShared, addHistoryCredentialUnshared, addHistoryLogin, addHistoryGrant, addHistoryWalletLogin, addHistoryAppRevoke, addHistoryAgentRevoke, addHistoryClientConnected, addHistoryClientRevoked, addHistoryGenerationCollected, addHistoryContentImported, addHistoryProfileCreated, addHistoryCollectionShared, addHistoryCollectionUnshared } from './activity.js';
|
|
47
50
|
export { publicCredentialUrl } from './publicLink.js';
|
|
48
51
|
export { encodeWasLinkSecret, isWasLinkPayload, buildWasLinkPayload, parseWasLinkPayload } from './wasLink.js';
|
|
52
|
+
export { inboxGrantMessage, parseInboxGrantMessage } from './inboxMessage.js';
|
|
49
53
|
export { HumanReadableError } from './errors.js';
|
|
50
54
|
export { CEREMONY_IDS } from './ceremony.js';
|
|
51
55
|
//# sourceMappingURL=index.js.map
|
package/dist/space/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,EACtC,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,EAC5B,kCAAkC,EAClC,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,eAAe,CAAA;AAOtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAG7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -18,13 +18,23 @@
|
|
|
18
18
|
*
|
|
19
19
|
* **Fail-safe to remote.** Whenever the fields the rule needs are unreachable
|
|
20
20
|
* -- a tombstone on either side, a missing cipher, an envelope this replica
|
|
21
|
-
* holds no key for, a body
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* malformed
|
|
26
|
-
* forever. A delete is in the same
|
|
27
|
-
* fresher stamp (a delete does not
|
|
21
|
+
* holds no key for, a plaintext body where a cipher is configured, a body that
|
|
22
|
+
* is not a valid head payload -- the remote master wins. That is the
|
|
23
|
+
* always-converging default, so a malformed side simply loses: a valid local
|
|
24
|
+
* over a malformed remote re-pushes and repairs the server copy, a valid remote
|
|
25
|
+
* over a malformed local is adopted, and two malformed sides adopt the server
|
|
26
|
+
* version rather than re-fighting the conflict forever. A delete is in the same
|
|
27
|
+
* class deliberately: a tombstone carries no fresher stamp (a delete does not
|
|
28
|
+
* rewrite the head payload), so deletion wins.
|
|
29
|
+
*
|
|
30
|
+
* **A plaintext body under a cipher is unreachable.** When the collection is
|
|
31
|
+
* encrypted, a non-envelope body is not one of this wallet's heads: an older
|
|
32
|
+
* writer or a hostile host put it there, and the app's own reads refuse it.
|
|
33
|
+
* Comparing its stamp would let a plaintext head with a later `updatedAt` beat
|
|
34
|
+
* a valid local envelope, which then disappears for good, since no read can
|
|
35
|
+
* open the winner and no write replaces it. So it scores as unreachable, and a
|
|
36
|
+
* valid encrypted side wins over it and re-pushes. Plaintext passes through
|
|
37
|
+
* only when no cipher is passed.
|
|
28
38
|
*
|
|
29
39
|
* **An integrity refusal is not an unreachable side.** A decrypt refused by the
|
|
30
40
|
* cipher's envelope-to-resource binding check (was-client's `IntegrityError`)
|
|
@@ -60,8 +70,10 @@ import { type ContactHeadPayload } from '@interop/social-core';
|
|
|
60
70
|
export type ContactConflictWinner = 'remote' | 'local';
|
|
61
71
|
/**
|
|
62
72
|
* Recovers a validated head payload from a stored body: decrypts an
|
|
63
|
-
* envelope,
|
|
64
|
-
*
|
|
73
|
+
* envelope, and resolves `undefined` when the payload (and so the fields the
|
|
74
|
+
* rule compares) cannot be reached. A plaintext body passes through only when
|
|
75
|
+
* no cipher is passed. With a cipher, a plaintext body is unreachable and is
|
|
76
|
+
* never handed to the cipher (see the module doc).
|
|
65
77
|
*
|
|
66
78
|
* A side this replica holds no key for is unreachable. What the fail-safe rule
|
|
67
79
|
* below then does with it depends on which side it was: an unreachable local
|
|
@@ -80,7 +92,8 @@ export type ContactConflictWinner = 'remote' | 'local';
|
|
|
80
92
|
* @param options.data {Json} the stored body: an encrypted envelope or a
|
|
81
93
|
* plaintext payload
|
|
82
94
|
* @param [options.cipher] {DocCipher} the collection's document cipher;
|
|
83
|
-
* absent for a plaintext store, in which case an envelope is unreachable
|
|
95
|
+
* absent for a plaintext store, in which case an envelope is unreachable.
|
|
96
|
+
* When present, a plaintext body is unreachable.
|
|
84
97
|
* @returns {Promise<ContactHeadPayload | undefined>}
|
|
85
98
|
* @throws {Error} the cipher's `IntegrityError`: the stored envelope was
|
|
86
99
|
* sealed for a different resource than `id`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsConflict.d.ts","sourceRoot":"","sources":["../../src/sync/contactsConflict.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"contactsConflict.d.ts","sourceRoot":"","sources":["../../src/sync/contactsConflict.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAA;AAE7B;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,EAAE,EACF,IAAI,EACJ,MAAM,EACP,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;IACtB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAyB1C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,EAAE,EACF,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAqB,EACrB,YAAoB,EACpB,kBAAkB,EACnB,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,IAAI,GAAG,SAAS,CAAA;IACxB,KAAK,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC7B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;QACxB,GAAG,EAAE,OAAO,CAAA;KACb,KAAK,IAAI,CAAA;CACX,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0CjC"}
|
|
@@ -18,13 +18,23 @@
|
|
|
18
18
|
*
|
|
19
19
|
* **Fail-safe to remote.** Whenever the fields the rule needs are unreachable
|
|
20
20
|
* -- a tombstone on either side, a missing cipher, an envelope this replica
|
|
21
|
-
* holds no key for, a body
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* malformed
|
|
26
|
-
* forever. A delete is in the same
|
|
27
|
-
* fresher stamp (a delete does not
|
|
21
|
+
* holds no key for, a plaintext body where a cipher is configured, a body that
|
|
22
|
+
* is not a valid head payload -- the remote master wins. That is the
|
|
23
|
+
* always-converging default, so a malformed side simply loses: a valid local
|
|
24
|
+
* over a malformed remote re-pushes and repairs the server copy, a valid remote
|
|
25
|
+
* over a malformed local is adopted, and two malformed sides adopt the server
|
|
26
|
+
* version rather than re-fighting the conflict forever. A delete is in the same
|
|
27
|
+
* class deliberately: a tombstone carries no fresher stamp (a delete does not
|
|
28
|
+
* rewrite the head payload), so deletion wins.
|
|
29
|
+
*
|
|
30
|
+
* **A plaintext body under a cipher is unreachable.** When the collection is
|
|
31
|
+
* encrypted, a non-envelope body is not one of this wallet's heads: an older
|
|
32
|
+
* writer or a hostile host put it there, and the app's own reads refuse it.
|
|
33
|
+
* Comparing its stamp would let a plaintext head with a later `updatedAt` beat
|
|
34
|
+
* a valid local envelope, which then disappears for good, since no read can
|
|
35
|
+
* open the winner and no write replaces it. So it scores as unreachable, and a
|
|
36
|
+
* valid encrypted side wins over it and re-pushes. Plaintext passes through
|
|
37
|
+
* only when no cipher is passed.
|
|
28
38
|
*
|
|
29
39
|
* **An integrity refusal is not an unreachable side.** A decrypt refused by the
|
|
30
40
|
* cipher's envelope-to-resource binding check (was-client's `IntegrityError`)
|
|
@@ -56,8 +66,10 @@ import { isEncryptedEnvelope, isIntegrityError } from '@interop/was-client/sync'
|
|
|
56
66
|
import { isContactHeadPayload, remotePayloadWins } from '@interop/social-core';
|
|
57
67
|
/**
|
|
58
68
|
* Recovers a validated head payload from a stored body: decrypts an
|
|
59
|
-
* envelope,
|
|
60
|
-
*
|
|
69
|
+
* envelope, and resolves `undefined` when the payload (and so the fields the
|
|
70
|
+
* rule compares) cannot be reached. A plaintext body passes through only when
|
|
71
|
+
* no cipher is passed. With a cipher, a plaintext body is unreachable and is
|
|
72
|
+
* never handed to the cipher (see the module doc).
|
|
61
73
|
*
|
|
62
74
|
* A side this replica holds no key for is unreachable. What the fail-safe rule
|
|
63
75
|
* below then does with it depends on which side it was: an unreachable local
|
|
@@ -76,7 +88,8 @@ import { isContactHeadPayload, remotePayloadWins } from '@interop/social-core';
|
|
|
76
88
|
* @param options.data {Json} the stored body: an encrypted envelope or a
|
|
77
89
|
* plaintext payload
|
|
78
90
|
* @param [options.cipher] {DocCipher} the collection's document cipher;
|
|
79
|
-
* absent for a plaintext store, in which case an envelope is unreachable
|
|
91
|
+
* absent for a plaintext store, in which case an envelope is unreachable.
|
|
92
|
+
* When present, a plaintext body is unreachable.
|
|
80
93
|
* @returns {Promise<ContactHeadPayload | undefined>}
|
|
81
94
|
* @throws {Error} the cipher's `IntegrityError`: the stored envelope was
|
|
82
95
|
* sealed for a different resource than `id`
|
|
@@ -85,20 +98,26 @@ export async function contactHeadPayloadOf({ id, data, cipher }) {
|
|
|
85
98
|
if (data === null || data === undefined) {
|
|
86
99
|
return undefined;
|
|
87
100
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
if (!isEncryptedEnvelope(data)) {
|
|
102
|
+
// A plaintext body counts only on a plaintext store. Under a cipher it is
|
|
103
|
+
// not one of this wallet's heads, so it must not win on its stamp.
|
|
104
|
+
if (cipher) {
|
|
91
105
|
return undefined;
|
|
92
106
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
return isContactHeadPayload(data) ? data : undefined;
|
|
108
|
+
}
|
|
109
|
+
if (!cipher) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
let body;
|
|
113
|
+
try {
|
|
114
|
+
body = await cipher.decrypt({ id, envelope: data });
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
if (isIntegrityError(err)) {
|
|
118
|
+
throw err;
|
|
101
119
|
}
|
|
120
|
+
return undefined;
|
|
102
121
|
}
|
|
103
122
|
return isContactHeadPayload(body) ? body : undefined;
|
|
104
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsConflict.js","sourceRoot":"","sources":["../../src/sync/contactsConflict.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"contactsConflict.js","sourceRoot":"","sources":["../../src/sync/contactsConflict.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;IACrC,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAA;IACnC,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;QAC5B,OAAO,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAA;IACtE,CAAC;IACD,4EAA4E;IAC5E,6BAA6B;IAC7B,IAAI,SAAS,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* the two ways that cache is written -- the unconditional PUT every publish
|
|
9
9
|
* tail makes ({@link putDidWebProjection}) and the read-then-write freshness
|
|
10
10
|
* ensure a caller with no controller authority makes
|
|
11
|
-
* ({@link ensureDidWebProjection}).
|
|
11
|
+
* ({@link ensureDidWebProjection}). The ensure's compare is exported on its
|
|
12
|
+
* own as {@link didWebProjectionCurrent}, for a reader that wants it without
|
|
13
|
+
* the write.
|
|
12
14
|
*
|
|
13
15
|
* The ensure exists because the projection is NOT republished by every entry.
|
|
14
16
|
* A ladder-signed entry publishes through `publishEntryPinned`, which writes
|
|
@@ -110,10 +112,11 @@ export declare function preEntryProjectionPublisher({ store }: {
|
|
|
110
112
|
* account Space's container URL and so may write `id/did.json` with no
|
|
111
113
|
* widened bridge and no server change.
|
|
112
114
|
*
|
|
113
|
-
* The served document is compared
|
|
114
|
-
* a host (or an earlier writer)
|
|
115
|
-
*
|
|
116
|
-
* an equal document is
|
|
115
|
+
* The served document is compared through {@link didWebProjectionCurrent}, as
|
|
116
|
+
* parsed JSON and key-order-insensitively, so a host (or an earlier writer)
|
|
117
|
+
* that reserialized the same document does not provoke a write. Absent,
|
|
118
|
+
* unparsable, and different all reach the write; only an equal document is
|
|
119
|
+
* left alone.
|
|
117
120
|
*
|
|
118
121
|
* A difference is not by itself evidence that the served projection is the
|
|
119
122
|
* stale side. The caller's `doc` was resolved at some earlier point, and a
|
|
@@ -161,4 +164,34 @@ export declare function ensureDidWebProjection({ store, did, doc, refresh }: {
|
|
|
161
164
|
}): Promise<{
|
|
162
165
|
outcome: 'current' | 'republished' | 'conflict';
|
|
163
166
|
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Whether the served projection text is the current `did:web` projection of a
|
|
169
|
+
* resolved did:webvh document. It derives the projection with
|
|
170
|
+
* `generateParallelDidWeb` and compares it against the served body as parsed
|
|
171
|
+
* JSON, key-order-insensitively. This is the compare
|
|
172
|
+
* {@link ensureDidWebProjection} runs, exported for a reader (a wallet's
|
|
173
|
+
* invariant audit) that wants the compare without the write.
|
|
174
|
+
*
|
|
175
|
+
* An absent or unparsable body reads as not current rather than as an error.
|
|
176
|
+
* Whatever it is, it is not the projection, and republishing is the answer
|
|
177
|
+
* either way.
|
|
178
|
+
*
|
|
179
|
+
* The derived document is round-tripped through JSON before the comparison,
|
|
180
|
+
* so it is compared in the form a PUT would serialize it into. A member whose
|
|
181
|
+
* value is `undefined` disappears on both sides rather than reading as a
|
|
182
|
+
* difference the write could never fix.
|
|
183
|
+
*
|
|
184
|
+
* @param options {object}
|
|
185
|
+
* @param options.text {string | undefined} the served `did.json` body, or
|
|
186
|
+
* `undefined` when the resource is absent
|
|
187
|
+
* @param options.did {string} the account's did:webvh, from the resolved log
|
|
188
|
+
* @param options.doc {DIDDoc} the resolved did:webvh document
|
|
189
|
+
* @returns {boolean} true only when the served body parses and structurally
|
|
190
|
+
* equals the derived projection
|
|
191
|
+
*/
|
|
192
|
+
export declare function didWebProjectionCurrent({ text, did, doc }: {
|
|
193
|
+
text: string | undefined;
|
|
194
|
+
did: string;
|
|
195
|
+
doc: DIDDoc;
|
|
196
|
+
}): boolean;
|
|
164
197
|
//# sourceMappingURL=didWebProjection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didWebProjection.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"didWebProjection.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,MAAM,EACP,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAA;IAC1C,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACN,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAA;CAChE,GAAG,CAAC,KAAK,EAAE;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAgBzD;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,GAAG,EACH,OAAO,EACR,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAA;IAC/D,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACtD,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAA;CAAE,CAAC,CAqC/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,GAAG,EACH,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,OAAO,CAcV"}
|
|
@@ -87,10 +87,11 @@ const PRECONDITION_FAILED_ERROR_NAME = 'PreconditionFailedError';
|
|
|
87
87
|
* account Space's container URL and so may write `id/did.json` with no
|
|
88
88
|
* widened bridge and no server change.
|
|
89
89
|
*
|
|
90
|
-
* The served document is compared
|
|
91
|
-
* a host (or an earlier writer)
|
|
92
|
-
*
|
|
93
|
-
* an equal document is
|
|
90
|
+
* The served document is compared through {@link didWebProjectionCurrent}, as
|
|
91
|
+
* parsed JSON and key-order-insensitively, so a host (or an earlier writer)
|
|
92
|
+
* that reserialized the same document does not provoke a write. Absent,
|
|
93
|
+
* unparsable, and different all reach the write; only an equal document is
|
|
94
|
+
* left alone.
|
|
94
95
|
*
|
|
95
96
|
* A difference is not by itself evidence that the served projection is the
|
|
96
97
|
* stale side. The caller's `doc` was resolved at some earlier point, and a
|
|
@@ -131,22 +132,20 @@ export async function ensureDidWebProjection({ store, did, doc, refresh }) {
|
|
|
131
132
|
const served = await store.getIdResourceRaw({
|
|
132
133
|
resourceId: DID_DOCUMENT_RESOURCE
|
|
133
134
|
});
|
|
134
|
-
let
|
|
135
|
-
if (
|
|
135
|
+
let resolved = { did, doc };
|
|
136
|
+
if (didWebProjectionCurrent({ text: served?.text, ...resolved })) {
|
|
136
137
|
return { outcome: 'current' };
|
|
137
138
|
}
|
|
138
139
|
if (refresh) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (served !== undefined &&
|
|
142
|
-
servedMatches({ text: served.text, expected })) {
|
|
140
|
+
resolved = await refresh();
|
|
141
|
+
if (didWebProjectionCurrent({ text: served?.text, ...resolved })) {
|
|
143
142
|
return { outcome: 'current' };
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
try {
|
|
147
146
|
await store.putIdResource({
|
|
148
147
|
resourceId: DID_DOCUMENT_RESOURCE,
|
|
149
|
-
content:
|
|
148
|
+
content: generateParallelDidWeb(resolved.did, resolved.doc),
|
|
150
149
|
contentType: 'application/did+json',
|
|
151
150
|
// Absent, the write is a create; present, an update-if-unchanged. A
|
|
152
151
|
// backend serving no ETag versions nothing, so that write degrades to
|
|
@@ -169,21 +168,34 @@ export async function ensureDidWebProjection({ store, did, doc, refresh }) {
|
|
|
169
168
|
return { outcome: 'republished' };
|
|
170
169
|
}
|
|
171
170
|
/**
|
|
172
|
-
* Whether the served projection text is the
|
|
173
|
-
*
|
|
174
|
-
*
|
|
171
|
+
* Whether the served projection text is the current `did:web` projection of a
|
|
172
|
+
* resolved did:webvh document. It derives the projection with
|
|
173
|
+
* `generateParallelDidWeb` and compares it against the served body as parsed
|
|
174
|
+
* JSON, key-order-insensitively. This is the compare
|
|
175
|
+
* {@link ensureDidWebProjection} runs, exported for a reader (a wallet's
|
|
176
|
+
* invariant audit) that wants the compare without the write.
|
|
175
177
|
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
178
|
+
* An absent or unparsable body reads as not current rather than as an error.
|
|
179
|
+
* Whatever it is, it is not the projection, and republishing is the answer
|
|
180
|
+
* either way.
|
|
181
|
+
*
|
|
182
|
+
* The derived document is round-tripped through JSON before the comparison,
|
|
183
|
+
* so it is compared in the form a PUT would serialize it into. A member whose
|
|
184
|
+
* value is `undefined` disappears on both sides rather than reading as a
|
|
179
185
|
* difference the write could never fix.
|
|
180
186
|
*
|
|
181
187
|
* @param options {object}
|
|
182
|
-
* @param options.text {string} the served body
|
|
183
|
-
*
|
|
184
|
-
* @
|
|
188
|
+
* @param options.text {string | undefined} the served `did.json` body, or
|
|
189
|
+
* `undefined` when the resource is absent
|
|
190
|
+
* @param options.did {string} the account's did:webvh, from the resolved log
|
|
191
|
+
* @param options.doc {DIDDoc} the resolved did:webvh document
|
|
192
|
+
* @returns {boolean} true only when the served body parses and structurally
|
|
193
|
+
* equals the derived projection
|
|
185
194
|
*/
|
|
186
|
-
function
|
|
195
|
+
export function didWebProjectionCurrent({ text, did, doc }) {
|
|
196
|
+
if (text === undefined) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
187
199
|
let parsed;
|
|
188
200
|
try {
|
|
189
201
|
parsed = JSON.parse(text);
|
|
@@ -191,7 +203,8 @@ function servedMatches({ text, expected }) {
|
|
|
191
203
|
catch {
|
|
192
204
|
return false;
|
|
193
205
|
}
|
|
194
|
-
|
|
206
|
+
const expected = JSON.parse(JSON.stringify(generateParallelDidWeb(did, doc)));
|
|
207
|
+
return sameJsonValue(expected, parsed);
|
|
195
208
|
}
|
|
196
209
|
/**
|
|
197
210
|
* Structural JSON equality: object key order is immaterial, array order is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didWebProjection.js","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"didWebProjection.js","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAiDA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAG/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,KAAK,EACL,MAAM,EAIP;IACC,MAAM,KAAK,CAAC,aAAa,CAAC;QACxB,UAAU,EAAE,qBAAqB;QACjC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,sBAAsB;KAC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,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CACf,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC;YACtD,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CACzC,CACF,CAAA;AACH,CAAC"}
|
package/dist/webvh/index.d.ts
CHANGED
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
* through, over the parameterized `wasWebvhLogStore` (any collection's
|
|
64
64
|
* `did.jsonl`), which also serves a client-annex generation's log.
|
|
65
65
|
* - `ensureDidWebProjection` / `putDidWebProjection` -- the `did:web`
|
|
66
|
-
* projection (`id/did.json`) writers
|
|
66
|
+
* projection (`id/did.json`) writers, with the ensure's compare exported on
|
|
67
|
+
* its own as `didWebProjectionCurrent`. The publish tails PUT it
|
|
67
68
|
* unconditionally behind a won log compare-and-swap; the ensure compares
|
|
68
69
|
* the served document against the one the resolved log derives and writes
|
|
69
70
|
* only on a difference -- re-resolving through the caller's optional
|
|
@@ -96,10 +97,10 @@ export { accountControllerResolver, accountLogPinId, logResourcePinId, AccountLo
|
|
|
96
97
|
export type { VerifiedAccountLog } from './verifyLog.js';
|
|
97
98
|
export { wasWebvhIdStore, wasWebvhLogStore } from './wasIdStore.js';
|
|
98
99
|
export type { WebvhLogResourceStore } from './wasIdStore.js';
|
|
99
|
-
export { ensureDidWebProjection, putDidWebProjection } from './didWebProjection.js';
|
|
100
|
+
export { didWebProjectionCurrent, ensureDidWebProjection, putDidWebProjection } from './didWebProjection.js';
|
|
100
101
|
export { delegatedWebvhLogStore } from './delegatedLogStore.js';
|
|
101
102
|
export type { DelegatedWebvhLogStore } from './delegatedLogStore.js';
|
|
102
|
-
export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
|
|
103
|
+
export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, embeddedParentCapability, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
|
|
103
104
|
export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases, enrolledClientVmIds, isLastEnrolledClient, listEnrolledWebvhClients, markedKeyAgreementMethods, markedKeyAgreementMultibases } from './listClients.js';
|
|
104
105
|
export type { EnrolledWebvhClient, PublishedKeyDocument } from './listClients.js';
|
|
105
106
|
export { mergeVerificationMethods } from './mergeMethods.js';
|