@interop/wallet-core 0.71.0 → 0.73.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 +14 -3
- 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.map +1 -1
- package/dist/clientAnnex/forget.js +4 -3
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +55 -35
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +87 -35
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +48 -19
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +82 -31
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/grantRevocation.d.ts +137 -0
- package/dist/clientAnnex/grantRevocation.d.ts.map +1 -0
- package/dist/clientAnnex/grantRevocation.js +135 -0
- package/dist/clientAnnex/grantRevocation.js.map +1 -0
- package/dist/clientAnnex/index.d.ts +4 -2
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +2 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +0 -22
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +8 -34
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +65 -13
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +160 -67
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.js +51 -24
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +3 -10
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/grantState.d.ts +6 -3
- package/dist/clients/grantState.d.ts.map +1 -1
- package/dist/clients/grantState.js +6 -3
- package/dist/clients/grantState.js.map +1 -1
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +3 -0
- package/dist/clients/policy.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +1 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/keyring/fetch.d.ts +6 -2
- package/dist/keyring/fetch.d.ts.map +1 -1
- package/dist/keyring/fetch.js +7 -3
- package/dist/keyring/fetch.js.map +1 -1
- package/dist/keyring/index.d.ts +15 -10
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +15 -10
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +1 -1
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +1 -1
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/record.d.ts +15 -0
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +22 -0
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +45 -68
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +66 -88
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/clientKeyRecord.d.ts +3 -4
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +6 -25
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +6 -1
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +6 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/userKey.d.ts +57 -11
- package/dist/keys/userKey.d.ts.map +1 -1
- package/dist/keys/userKey.js +76 -11
- package/dist/keys/userKey.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +3 -3
- package/dist/menders/derive.d.ts +85 -0
- package/dist/menders/derive.d.ts.map +1 -0
- package/dist/menders/derive.js +138 -0
- package/dist/menders/derive.js.map +1 -0
- package/dist/menders/ids.d.ts +20 -0
- package/dist/menders/ids.d.ts.map +1 -0
- package/dist/menders/ids.js +85 -0
- package/dist/menders/ids.js.map +1 -0
- package/dist/menders/index.d.ts +42 -0
- package/dist/menders/index.d.ts.map +1 -0
- package/dist/menders/index.js +37 -0
- package/dist/menders/index.js.map +1 -0
- package/dist/menders/registry.d.ts +84 -0
- package/dist/menders/registry.d.ts.map +1 -0
- package/dist/menders/registry.js +62 -0
- package/dist/menders/registry.js.map +1 -0
- package/dist/menders/runner.d.ts +143 -0
- package/dist/menders/runner.d.ts.map +1 -0
- package/dist/menders/runner.js +222 -0
- package/dist/menders/runner.js.map +1 -0
- package/dist/menders/types.d.ts +146 -0
- package/dist/menders/types.d.ts.map +1 -0
- package/dist/menders/types.js +2 -0
- package/dist/menders/types.js.map +1 -0
- package/dist/menders/vocabulary.d.ts +90 -0
- package/dist/menders/vocabulary.d.ts.map +1 -0
- package/dist/menders/vocabulary.js +86 -0
- package/dist/menders/vocabulary.js.map +1 -0
- package/dist/recovery/index.d.ts +1 -1
- package/dist/recovery/index.js +1 -1
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +11 -17
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/resourceLog/document.d.ts.map +1 -1
- package/dist/resourceLog/document.js +30 -6
- package/dist/resourceLog/document.js.map +1 -1
- package/dist/space/activity.d.ts +70 -0
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +82 -0
- package/dist/space/activity.js.map +1 -1
- package/dist/space/deleteSpace.d.ts.map +1 -1
- package/dist/space/deleteSpace.js +6 -5
- package/dist/space/deleteSpace.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/testing.d.ts +78 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +89 -0
- package/dist/testing.js.map +1 -0
- package/dist/unlock/index.d.ts +2 -2
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +1 -1
- package/dist/unlock/retire.d.ts +20 -5
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +22 -2
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +22 -2
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +33 -0
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +52 -18
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +4 -16
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +13 -3
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +13 -3
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +47 -0
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +40 -1
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +66 -0
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +96 -0
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/zcap.d.ts +1 -1
- package/package.json +22 -10
|
@@ -32,109 +32,86 @@ export declare function ensureUnlockSpace({ storageServerUrl, zcapClient, spaceI
|
|
|
32
32
|
* does not exist yet. A network / unreachable error propagates, so callers can
|
|
33
33
|
* distinguish "no keyring" from "could not check".
|
|
34
34
|
*
|
|
35
|
+
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
36
|
+
* the unlock identity's, and the attached management zcap (delegated by the
|
|
37
|
+
* unlock identity at bind time; it must allow GET) authorizes the read. This
|
|
38
|
+
* is what lets the revocation cascade's re-mint read a recovery code's
|
|
39
|
+
* standing record without holding the code: the record's code-authenticated
|
|
40
|
+
* binding rides the frame in the clear, so carrying it forward verbatim needs
|
|
41
|
+
* no decryption.
|
|
42
|
+
*
|
|
35
43
|
* @param options {object}
|
|
36
44
|
* @param options.storageServerUrl {string}
|
|
37
45
|
* @param options.zcapClient {ZcapClient}
|
|
38
46
|
* @param options.spaceId {string} the unlock Space id
|
|
47
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
48
|
+
* absent, the read is a root invocation
|
|
39
49
|
* @returns {Promise<unknown | null>}
|
|
40
50
|
*/
|
|
41
|
-
export declare function getUnlockKeyring({ storageServerUrl, zcapClient, spaceId }: {
|
|
51
|
+
export declare function getUnlockKeyring({ storageServerUrl, zcapClient, spaceId, capability }: {
|
|
42
52
|
storageServerUrl: string;
|
|
43
53
|
zcapClient: ZcapClient;
|
|
44
54
|
spaceId: string;
|
|
55
|
+
capability?: IZcap;
|
|
45
56
|
}): Promise<unknown | null>;
|
|
46
57
|
/**
|
|
47
58
|
* Writes (upserts) the keyring record into the unlock Space as a JSON document.
|
|
48
59
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
export declare function putUnlockKeyring({ storageServerUrl, zcapClient, spaceId, record }: {
|
|
57
|
-
storageServerUrl: string;
|
|
58
|
-
zcapClient: ZcapClient;
|
|
59
|
-
spaceId: string;
|
|
60
|
-
record: object;
|
|
61
|
-
}): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Reads the keyring record with an explicitly attached management capability,
|
|
64
|
-
* rather than by root invocation, or returns `null` when it does not exist.
|
|
65
|
-
* The `zcapClient` here is an enrolled client's (not the unlock identity's);
|
|
66
|
-
* the attached `capability` -- the management zcap the unlock identity
|
|
67
|
-
* delegated at bind time, provided it allows GET -- authorizes the read
|
|
68
|
-
* against the unlock Space. This is what lets the revocation cascade's
|
|
69
|
-
* re-mint read a recovery code's standing record without holding the code:
|
|
70
|
-
* the record's code-authenticated binding rides the frame in the clear, so
|
|
71
|
-
* carrying it forward verbatim needs no decryption.
|
|
72
|
-
*
|
|
73
|
-
* @param options {object}
|
|
74
|
-
* @param options.storageServerUrl {string}
|
|
75
|
-
* @param options.zcapClient {ZcapClient} an enrolled client's zcap client
|
|
76
|
-
* @param options.spaceId {string} the unlock Space id
|
|
77
|
-
* @param options.capability {IZcap} the delegated management zcap (must
|
|
78
|
-
* allow GET)
|
|
79
|
-
* @returns {Promise<unknown | null>}
|
|
80
|
-
*/
|
|
81
|
-
export declare function getUnlockKeyringWithCapability({ storageServerUrl, zcapClient, spaceId, capability }: {
|
|
82
|
-
storageServerUrl: string;
|
|
83
|
-
zcapClient: ZcapClient;
|
|
84
|
-
spaceId: string;
|
|
85
|
-
capability: IZcap;
|
|
86
|
-
}): Promise<unknown | null>;
|
|
87
|
-
/**
|
|
88
|
-
* Writes (upserts) the keyring record with an explicitly attached management
|
|
89
|
-
* capability, rather than by root invocation. The `zcapClient` here is an
|
|
90
|
-
* enrolled client's (not the unlock identity's); the attached `capability` --
|
|
91
|
-
* the management zcap the unlock identity delegated at bind time, provided it
|
|
92
|
-
* allows PUT -- authorizes the write against the unlock Space. This is what
|
|
93
|
-
* lets the revocation cascade re-PUT a recovery code's unlock record (a fresh
|
|
94
|
-
* `did.jsonl` delegation inside a re-wrapped record) without holding the
|
|
95
|
-
* code: the record's JWE recipient is the code's unlock KAK, whose PUBLIC
|
|
60
|
+
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
61
|
+
* the unlock identity's, and the attached management zcap (delegated by the
|
|
62
|
+
* unlock identity at bind time; it must allow PUT) authorizes the write. This
|
|
63
|
+
* is what lets the revocation cascade re-PUT a recovery code's unlock record
|
|
64
|
+
* (a fresh `did.jsonl` delegation inside a re-wrapped record) without holding
|
|
65
|
+
* the code: the record's JWE recipient is the code's unlock KAK, whose PUBLIC
|
|
96
66
|
* half the issuing client recorded, so re-encryption needs no secret.
|
|
97
67
|
*
|
|
98
68
|
* @param options {object}
|
|
99
69
|
* @param options.storageServerUrl {string}
|
|
100
|
-
* @param options.zcapClient {ZcapClient}
|
|
70
|
+
* @param options.zcapClient {ZcapClient}
|
|
101
71
|
* @param options.spaceId {string} the unlock Space id
|
|
102
72
|
* @param options.record {object} the keyring record
|
|
103
|
-
* @param options.capability {IZcap} the delegated management zcap
|
|
104
|
-
*
|
|
73
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
74
|
+
* absent, the write is a root invocation
|
|
105
75
|
* @returns {Promise<void>}
|
|
106
76
|
*/
|
|
107
|
-
export declare function
|
|
77
|
+
export declare function putUnlockKeyring({ storageServerUrl, zcapClient, spaceId, record, capability }: {
|
|
108
78
|
storageServerUrl: string;
|
|
109
79
|
zcapClient: ZcapClient;
|
|
110
80
|
spaceId: string;
|
|
111
81
|
record: object;
|
|
112
|
-
capability
|
|
82
|
+
capability?: IZcap;
|
|
113
83
|
}): Promise<void>;
|
|
114
84
|
/**
|
|
115
85
|
* Deletes the whole unlock Space (what retires an old passphrase on a
|
|
116
|
-
* passphrase change).
|
|
117
|
-
* Space
|
|
86
|
+
* passphrase change, or a lost unlock method). The server's answer is
|
|
87
|
+
* reported rather than decided here: an already-absent Space comes back as
|
|
88
|
+
* `not-found`, and only a non-404 error propagates, so a caller that treats
|
|
89
|
+
* the delete as idempotent ignores the outcome.
|
|
90
|
+
*
|
|
91
|
+
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
92
|
+
* the unlock identity's, and the attached management zcap (delegated by the
|
|
93
|
+
* unlock identity to the data identity at bind time; it must allow DELETE on
|
|
94
|
+
* the Space's own URL) authorizes the delete -- retiring a lost unlock method
|
|
95
|
+
* without re-deriving its identity from the (possibly lost) secret. The
|
|
96
|
+
* server answers 404 both for an absent Space and for a refused capability,
|
|
97
|
+
* so `not-found` is not a statement of absence on its own.
|
|
118
98
|
*
|
|
119
99
|
* @param options {object}
|
|
120
100
|
* @param options.storageServerUrl {string}
|
|
121
101
|
* @param options.zcapClient {ZcapClient}
|
|
122
102
|
* @param options.spaceId {string} the unlock Space id
|
|
123
|
-
* @
|
|
103
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
104
|
+
* absent, the delete is a root invocation
|
|
105
|
+
* @returns {Promise<{ outcome: 'deleted' | 'not-found' }>} `not-found`
|
|
106
|
+
* when the server answered 404 (absent, or unauthorized under a
|
|
107
|
+
* capability); every other error propagates unchanged
|
|
124
108
|
*/
|
|
125
|
-
export declare function deleteUnlockSpace({ storageServerUrl, zcapClient, spaceId }: {
|
|
109
|
+
export declare function deleteUnlockSpace({ storageServerUrl, zcapClient, spaceId, capability }: {
|
|
126
110
|
storageServerUrl: string;
|
|
127
111
|
zcapClient: ZcapClient;
|
|
128
112
|
spaceId: string;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
* Space's deletion is the one this module's callers reach for -- retiring a
|
|
134
|
-
* lost unlock method with the management zcap the unlock identity delegated
|
|
135
|
-
* to the data identity at bind time, rather than by re-deriving the unlock
|
|
136
|
-
* identity from the (possibly lost) secret -- while the request itself is
|
|
137
|
-
* the shared one, 404 outcome and all.
|
|
138
|
-
*/
|
|
139
|
-
export { deleteSpaceWithCapability as deleteUnlockSpaceWithCapability } from '../space/deleteSpace.js';
|
|
113
|
+
capability?: IZcap;
|
|
114
|
+
}): Promise<{
|
|
115
|
+
outcome: 'deleted' | 'not-found';
|
|
116
|
+
}>;
|
|
140
117
|
//# sourceMappingURL=unlockSpace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlockSpace.d.ts","sourceRoot":"","sources":["../../src/keyring/unlockSpace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unlockSpace.d.ts","sourceRo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AAiB,CAAC,EACtC,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,UAAU,EACX,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,CAAC,CAGhD"}
|
|
@@ -6,9 +6,15 @@
|
|
|
6
6
|
* and separate from the wallet data Space, holding the one keyring record.
|
|
7
7
|
* These are standalone functions rather than methods on a wallet's remote-store
|
|
8
8
|
* class (that store is bound to the data identity): each builds its own
|
|
9
|
-
* `WasClient` over the
|
|
10
|
-
* the unlock root key (root invocation,
|
|
11
|
-
* invocation shape the data Space uses).
|
|
9
|
+
* `WasClient` over the caller's `zcapClient`. By default that is the unlock
|
|
10
|
+
* agent's, whose invocation signer is the unlock root key (root invocation,
|
|
11
|
+
* no capability attached -- the same invocation shape the data Space uses).
|
|
12
|
+
* Each read/write/delete also takes an optional `capability`: an enrolled
|
|
13
|
+
* client's `zcapClient` then invokes the management zcap the unlock identity
|
|
14
|
+
* delegated at bind time, which is how a ceremony reaches an unlock Space
|
|
15
|
+
* without holding its secret (the revocation cascade's re-mint reading and
|
|
16
|
+
* re-PUTting a recovery code's standing record, or a lost unlock method's
|
|
17
|
+
* Space being retired).
|
|
12
18
|
*
|
|
13
19
|
* The one resource is a plaintext JSON document (its keyring payload is
|
|
14
20
|
* already ciphertext), so no encryption provider is wired in and every
|
|
@@ -16,7 +22,6 @@
|
|
|
16
22
|
* here for the absent Space a fresh unlock secret's keyring lookup meets.
|
|
17
23
|
*/
|
|
18
24
|
import { WasClient } from '@interop/was-client';
|
|
19
|
-
import { resourcePath } from '@interop/was-client/paths';
|
|
20
25
|
import { KEYRING_COLLECTION, KEYRING_RESOURCE } from '../space/collections.js';
|
|
21
26
|
import { plaintextCollection } from '../space/plaintextCollection.js';
|
|
22
27
|
/**
|
|
@@ -74,11 +79,18 @@ async function ensurePlaintextCollection({ storageServerUrl, zcapClient, spaceId
|
|
|
74
79
|
* @param options.spaceId {string}
|
|
75
80
|
* @param options.collectionId {string}
|
|
76
81
|
* @param options.resourceId {string}
|
|
82
|
+
* @param [options.capability] {IZcap} an invocation capability the GET
|
|
83
|
+
* rides; absent, the request invokes the root capability
|
|
77
84
|
* @returns {Promise<unknown | null>}
|
|
78
85
|
*/
|
|
79
|
-
async function getPlaintextRecord({ storageServerUrl, zcapClient, spaceId, collectionId, resourceId }) {
|
|
86
|
+
async function getPlaintextRecord({ storageServerUrl, zcapClient, spaceId, collectionId, resourceId, capability }) {
|
|
80
87
|
const was = unlockSpaceClient({ storageServerUrl, zcapClient });
|
|
81
|
-
const result = await plaintextCollection({
|
|
88
|
+
const result = await plaintextCollection({
|
|
89
|
+
was,
|
|
90
|
+
spaceId,
|
|
91
|
+
collectionId,
|
|
92
|
+
capability
|
|
93
|
+
})
|
|
82
94
|
.resource(resourceId)
|
|
83
95
|
.get();
|
|
84
96
|
return result === null ? null : result;
|
|
@@ -94,12 +106,14 @@ async function getPlaintextRecord({ storageServerUrl, zcapClient, spaceId, colle
|
|
|
94
106
|
* @param options.collectionId {string}
|
|
95
107
|
* @param options.resourceId {string}
|
|
96
108
|
* @param options.record {object}
|
|
109
|
+
* @param [options.capability] {IZcap} an invocation capability the PUT
|
|
110
|
+
* rides; absent, the request invokes the root capability
|
|
97
111
|
* @returns {Promise<void>}
|
|
98
112
|
*/
|
|
99
|
-
async function putPlaintextRecord({ storageServerUrl, zcapClient, spaceId, collectionId, resourceId, record }) {
|
|
113
|
+
async function putPlaintextRecord({ storageServerUrl, zcapClient, spaceId, collectionId, resourceId, record, capability }) {
|
|
100
114
|
const was = unlockSpaceClient({ storageServerUrl, zcapClient });
|
|
101
115
|
const body = new TextEncoder().encode(JSON.stringify(record));
|
|
102
|
-
await plaintextCollection({ was, spaceId, collectionId })
|
|
116
|
+
await plaintextCollection({ was, spaceId, collectionId, capability })
|
|
103
117
|
.resource(resourceId)
|
|
104
118
|
.put(body, { contentType: 'application/json' });
|
|
105
119
|
}
|
|
@@ -133,126 +147,90 @@ export async function ensureUnlockSpace({ storageServerUrl, zcapClient, spaceId,
|
|
|
133
147
|
* does not exist yet. A network / unreachable error propagates, so callers can
|
|
134
148
|
* distinguish "no keyring" from "could not check".
|
|
135
149
|
*
|
|
150
|
+
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
151
|
+
* the unlock identity's, and the attached management zcap (delegated by the
|
|
152
|
+
* unlock identity at bind time; it must allow GET) authorizes the read. This
|
|
153
|
+
* is what lets the revocation cascade's re-mint read a recovery code's
|
|
154
|
+
* standing record without holding the code: the record's code-authenticated
|
|
155
|
+
* binding rides the frame in the clear, so carrying it forward verbatim needs
|
|
156
|
+
* no decryption.
|
|
157
|
+
*
|
|
136
158
|
* @param options {object}
|
|
137
159
|
* @param options.storageServerUrl {string}
|
|
138
160
|
* @param options.zcapClient {ZcapClient}
|
|
139
161
|
* @param options.spaceId {string} the unlock Space id
|
|
162
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
163
|
+
* absent, the read is a root invocation
|
|
140
164
|
* @returns {Promise<unknown | null>}
|
|
141
165
|
*/
|
|
142
|
-
export async function getUnlockKeyring({ storageServerUrl, zcapClient, spaceId }) {
|
|
166
|
+
export async function getUnlockKeyring({ storageServerUrl, zcapClient, spaceId, capability }) {
|
|
143
167
|
return getPlaintextRecord({
|
|
144
168
|
storageServerUrl,
|
|
145
169
|
zcapClient,
|
|
146
170
|
spaceId,
|
|
147
171
|
collectionId: KEYRING_COLLECTION.id,
|
|
148
|
-
resourceId: KEYRING_RESOURCE
|
|
172
|
+
resourceId: KEYRING_RESOURCE,
|
|
173
|
+
capability
|
|
149
174
|
});
|
|
150
175
|
}
|
|
151
176
|
/**
|
|
152
177
|
* Writes (upserts) the keyring record into the unlock Space as a JSON document.
|
|
153
178
|
*
|
|
179
|
+
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
180
|
+
* the unlock identity's, and the attached management zcap (delegated by the
|
|
181
|
+
* unlock identity at bind time; it must allow PUT) authorizes the write. This
|
|
182
|
+
* is what lets the revocation cascade re-PUT a recovery code's unlock record
|
|
183
|
+
* (a fresh `did.jsonl` delegation inside a re-wrapped record) without holding
|
|
184
|
+
* the code: the record's JWE recipient is the code's unlock KAK, whose PUBLIC
|
|
185
|
+
* half the issuing client recorded, so re-encryption needs no secret.
|
|
186
|
+
*
|
|
154
187
|
* @param options {object}
|
|
155
188
|
* @param options.storageServerUrl {string}
|
|
156
189
|
* @param options.zcapClient {ZcapClient}
|
|
157
190
|
* @param options.spaceId {string} the unlock Space id
|
|
158
191
|
* @param options.record {object} the keyring record
|
|
192
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
193
|
+
* absent, the write is a root invocation
|
|
159
194
|
* @returns {Promise<void>}
|
|
160
195
|
*/
|
|
161
|
-
export async function putUnlockKeyring({ storageServerUrl, zcapClient, spaceId, record }) {
|
|
196
|
+
export async function putUnlockKeyring({ storageServerUrl, zcapClient, spaceId, record, capability }) {
|
|
162
197
|
await putPlaintextRecord({
|
|
163
198
|
storageServerUrl,
|
|
164
199
|
zcapClient,
|
|
165
200
|
spaceId,
|
|
166
201
|
collectionId: KEYRING_COLLECTION.id,
|
|
167
202
|
resourceId: KEYRING_RESOURCE,
|
|
168
|
-
record
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Reads the keyring record with an explicitly attached management capability,
|
|
173
|
-
* rather than by root invocation, or returns `null` when it does not exist.
|
|
174
|
-
* The `zcapClient` here is an enrolled client's (not the unlock identity's);
|
|
175
|
-
* the attached `capability` -- the management zcap the unlock identity
|
|
176
|
-
* delegated at bind time, provided it allows GET -- authorizes the read
|
|
177
|
-
* against the unlock Space. This is what lets the revocation cascade's
|
|
178
|
-
* re-mint read a recovery code's standing record without holding the code:
|
|
179
|
-
* the record's code-authenticated binding rides the frame in the clear, so
|
|
180
|
-
* carrying it forward verbatim needs no decryption.
|
|
181
|
-
*
|
|
182
|
-
* @param options {object}
|
|
183
|
-
* @param options.storageServerUrl {string}
|
|
184
|
-
* @param options.zcapClient {ZcapClient} an enrolled client's zcap client
|
|
185
|
-
* @param options.spaceId {string} the unlock Space id
|
|
186
|
-
* @param options.capability {IZcap} the delegated management zcap (must
|
|
187
|
-
* allow GET)
|
|
188
|
-
* @returns {Promise<unknown | null>}
|
|
189
|
-
*/
|
|
190
|
-
export async function getUnlockKeyringWithCapability({ storageServerUrl, zcapClient, spaceId, capability }) {
|
|
191
|
-
const was = unlockSpaceClient({ storageServerUrl, zcapClient });
|
|
192
|
-
const result = await plaintextCollection({
|
|
193
|
-
was,
|
|
194
|
-
spaceId,
|
|
195
|
-
collectionId: KEYRING_COLLECTION.id,
|
|
203
|
+
record,
|
|
196
204
|
capability
|
|
197
|
-
})
|
|
198
|
-
.resource(KEYRING_RESOURCE)
|
|
199
|
-
.get();
|
|
200
|
-
return result === null ? null : result;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Writes (upserts) the keyring record with an explicitly attached management
|
|
204
|
-
* capability, rather than by root invocation. The `zcapClient` here is an
|
|
205
|
-
* enrolled client's (not the unlock identity's); the attached `capability` --
|
|
206
|
-
* the management zcap the unlock identity delegated at bind time, provided it
|
|
207
|
-
* allows PUT -- authorizes the write against the unlock Space. This is what
|
|
208
|
-
* lets the revocation cascade re-PUT a recovery code's unlock record (a fresh
|
|
209
|
-
* `did.jsonl` delegation inside a re-wrapped record) without holding the
|
|
210
|
-
* code: the record's JWE recipient is the code's unlock KAK, whose PUBLIC
|
|
211
|
-
* half the issuing client recorded, so re-encryption needs no secret.
|
|
212
|
-
*
|
|
213
|
-
* @param options {object}
|
|
214
|
-
* @param options.storageServerUrl {string}
|
|
215
|
-
* @param options.zcapClient {ZcapClient} an enrolled client's zcap client
|
|
216
|
-
* @param options.spaceId {string} the unlock Space id
|
|
217
|
-
* @param options.record {object} the keyring record
|
|
218
|
-
* @param options.capability {IZcap} the delegated management zcap (must
|
|
219
|
-
* allow PUT)
|
|
220
|
-
* @returns {Promise<void>}
|
|
221
|
-
*/
|
|
222
|
-
export async function putUnlockKeyringWithCapability({ storageServerUrl, zcapClient, spaceId, record, capability }) {
|
|
223
|
-
const was = unlockSpaceClient({ storageServerUrl, zcapClient });
|
|
224
|
-
const body = new TextEncoder().encode(JSON.stringify(record));
|
|
225
|
-
await was.request({
|
|
226
|
-
capability,
|
|
227
|
-
path: resourcePath(spaceId, KEYRING_COLLECTION.id, KEYRING_RESOURCE),
|
|
228
|
-
method: 'PUT',
|
|
229
|
-
headers: { 'content-type': 'application/json' },
|
|
230
|
-
body
|
|
231
205
|
});
|
|
232
206
|
}
|
|
233
207
|
/**
|
|
234
208
|
* Deletes the whole unlock Space (what retires an old passphrase on a
|
|
235
|
-
* passphrase change).
|
|
236
|
-
* Space
|
|
209
|
+
* passphrase change, or a lost unlock method). The server's answer is
|
|
210
|
+
* reported rather than decided here: an already-absent Space comes back as
|
|
211
|
+
* `not-found`, and only a non-404 error propagates, so a caller that treats
|
|
212
|
+
* the delete as idempotent ignores the outcome.
|
|
213
|
+
*
|
|
214
|
+
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
215
|
+
* the unlock identity's, and the attached management zcap (delegated by the
|
|
216
|
+
* unlock identity to the data identity at bind time; it must allow DELETE on
|
|
217
|
+
* the Space's own URL) authorizes the delete -- retiring a lost unlock method
|
|
218
|
+
* without re-deriving its identity from the (possibly lost) secret. The
|
|
219
|
+
* server answers 404 both for an absent Space and for a refused capability,
|
|
220
|
+
* so `not-found` is not a statement of absence on its own.
|
|
237
221
|
*
|
|
238
222
|
* @param options {object}
|
|
239
223
|
* @param options.storageServerUrl {string}
|
|
240
224
|
* @param options.zcapClient {ZcapClient}
|
|
241
225
|
* @param options.spaceId {string} the unlock Space id
|
|
242
|
-
* @
|
|
226
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
227
|
+
* absent, the delete is a root invocation
|
|
228
|
+
* @returns {Promise<{ outcome: 'deleted' | 'not-found' }>} `not-found`
|
|
229
|
+
* when the server answered 404 (absent, or unauthorized under a
|
|
230
|
+
* capability); every other error propagates unchanged
|
|
243
231
|
*/
|
|
244
|
-
export async function deleteUnlockSpace({ storageServerUrl, zcapClient, spaceId }) {
|
|
232
|
+
export async function deleteUnlockSpace({ storageServerUrl, zcapClient, spaceId, capability }) {
|
|
245
233
|
const was = unlockSpaceClient({ storageServerUrl, zcapClient });
|
|
246
|
-
|
|
234
|
+
return was.space(spaceId, { capability }).deleteWithOutcome();
|
|
247
235
|
}
|
|
248
|
-
/**
|
|
249
|
-
* The unlock Space's name for the one capability-authorized Space DELETE
|
|
250
|
-
* ({@link deleteSpaceWithCapability}). The alias stands because an unlock
|
|
251
|
-
* Space's deletion is the one this module's callers reach for -- retiring a
|
|
252
|
-
* lost unlock method with the management zcap the unlock identity delegated
|
|
253
|
-
* to the data identity at bind time, rather than by re-deriving the unlock
|
|
254
|
-
* identity from the (possibly lost) secret -- while the request itself is
|
|
255
|
-
* the shared one, 404 outcome and all.
|
|
256
|
-
*/
|
|
257
|
-
export { deleteSpaceWithCapability as deleteUnlockSpaceWithCapability } from '../space/deleteSpace.js';
|
|
258
236
|
//# sourceMappingURL=unlockSpace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlockSpace.js","sourceRoot":"","sources":["../../src/keyring/unlockSpace.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"unlockSpace.js","sourceRoot":"","sources":["../../src/keyring/unlockSpace.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAG/C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAA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A;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,MAAM,EACN,UAAU,EAOX;IACC,MAAM,kBAAkB,CAAC;QACvB,gBAAgB;QAChB,UAAU;QACV,OAAO;QACP,YAAY,EAAE,kBAAkB,CAAC,EAAE;QACnC,UAAU,EAAE,gBAAgB;QAC5B,MAAM;QACN,UAAU;KACX,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,UAAU,EAMX;IACC,MAAM,GAAG,GAAG,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,CAAA;IAC/D,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAA;AAC/D,CAAC"}
|
|
@@ -51,7 +51,6 @@ export interface ClientKeyRecordJson {
|
|
|
51
51
|
userKey?: {
|
|
52
52
|
id: string;
|
|
53
53
|
secret: string;
|
|
54
|
-
signingSeed?: string;
|
|
55
54
|
};
|
|
56
55
|
webvh?: {
|
|
57
56
|
updateSeed: string;
|
|
@@ -87,9 +86,9 @@ export interface EnrolledClientKeyRecord extends ClientKeyRecord {
|
|
|
87
86
|
* to `undefined` (a record written for an account minted before the user key);
|
|
88
87
|
* a present-but-malformed one throws.
|
|
89
88
|
*
|
|
90
|
-
* The
|
|
91
|
-
*
|
|
92
|
-
*
|
|
89
|
+
* The key-agreement secret is the whole of the stored material: the user key's
|
|
90
|
+
* Ed25519 signing half derives from it (`userKeySigningSeed`), so it is
|
|
91
|
+
* neither stored nor read back.
|
|
93
92
|
*
|
|
94
93
|
* @param value {unknown} the record's `userKey` member
|
|
95
94
|
* @returns {UserKey | undefined}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientKeyRecord.d.ts","sourceRoot":"","sources":["../../src/keys/clientKeyRecord.ts"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAgB3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,gBAAgB,GAAG,iBAAiB,CAAA;IAC9C,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,eAAe,CAAC,EAAE,UAAU,CAAA;CAC7B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,qBAAqB,CAAA;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,sBAAsB,CAAA;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"clientKeyRecord.d.ts","sourceRoot":"","sources":["../../src/keys/clientKeyRecord.ts"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAgB3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,gBAAgB,GAAG,iBAAiB,C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ined` (a record written for an account minted before the user key);
|
|
103
103
|
* a present-but-malformed one throws.
|
|
104
104
|
*
|
|
105
|
-
* The
|
|
106
|
-
*
|
|
107
|
-
*
|
|
105
|
+
* The key-agreement secret is the whole of the stored material: the user key's
|
|
106
|
+
* Ed25519 signing half derives from it (`userKeySigningSeed`), so it is
|
|
107
|
+
* neither stored nor read back.
|
|
108
108
|
*
|
|
109
109
|
* @param value {unknown} the record's `userKey` member
|
|
110
110
|
* @returns {UserKey | undefined}
|
|
@@ -116,24 +116,13 @@ export function parseClientRecordUserKey(value) {
|
|
|
116
116
|
if (value === null || typeof value !== 'object') {
|
|
117
117
|
throw new Error('Client-key record has a malformed user key.');
|
|
118
118
|
}
|
|
119
|
-
const { id, secret
|
|
119
|
+
const { id, secret } = value;
|
|
120
120
|
if (typeof id !== 'string' || !id) {
|
|
121
121
|
throw new Error('Client-key record user key is missing its key id.');
|
|
122
122
|
}
|
|
123
|
-
const secretBytes = decodeSecret({
|
|
124
|
-
value: secret,
|
|
125
|
-
name: 'user key material'
|
|
126
|
-
});
|
|
127
|
-
if (signingSeed === undefined) {
|
|
128
|
-
return { id, secret: secretBytes };
|
|
129
|
-
}
|
|
130
123
|
return {
|
|
131
124
|
id,
|
|
132
|
-
secret:
|
|
133
|
-
signingSeed: decodeSecret({
|
|
134
|
-
value: signingSeed,
|
|
135
|
-
name: 'user key signing seed'
|
|
136
|
-
})
|
|
125
|
+
secret: decodeSecret({ value: secret, name: 'user key material' })
|
|
137
126
|
};
|
|
138
127
|
}
|
|
139
128
|
/**
|
|
@@ -299,15 +288,7 @@ export function encodeClientKeyRecord({ clientSeed, userKey, webvhUpdateKeys, co
|
|
|
299
288
|
secret: encodeSecret({
|
|
300
289
|
value: userKey.secret,
|
|
301
290
|
name: 'user key material'
|
|
302
|
-
})
|
|
303
|
-
...(userKey.signingSeed
|
|
304
|
-
? {
|
|
305
|
-
signingSeed: encodeSecret({
|
|
306
|
-
value: userKey.signingSeed,
|
|
307
|
-
name: 'user key signing seed'
|
|
308
|
-
})
|
|
309
|
-
}
|
|
310
|
-
: {})
|
|
291
|
+
})
|
|
311
292
|
}
|
|
312
293
|
}
|
|
313
294
|
: {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientKeyRecord.js","sourceRoot":"","sources":["../../src/keys/clientKeyRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAI5C;;;;GAIG;AACH,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,EAAE,CAAA;AA8E9B;;;;;;;;;GASG;AACH,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,IAAI,EACJ,MAAM,GAAG,YAAY,EAKtB;IACC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,cAAc,CAAC,CAAA;IAC1D,CAAC;IACD,IAAI,KAAiB,CAAA;IACrB,IAAI,CAAC;QACH,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,oBAAoB,EAAE;YAC7D,KAAK,EAAE,GAAG;SACX,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,WAAW,MAAM,SAAS,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,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,CAAC,kDAAkD,CAAC,CAAA;IACrE,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AACxE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAuB;IAEvB,IAAI,CAAC;QACH,6BAA6B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QACzC,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
* - `mintUserKey` / `userKeyVaultKeys` -- minting the account's user key and
|
|
10
10
|
* rebuilding the
|
|
11
11
|
* vault key-agreement key + resolver from stored material.
|
|
12
|
+
* - `userKeySigningSeed` / `userKeyRecordSigner` /
|
|
13
|
+
* `userKeySigningKeyMultibase` / `USER_KEY_SALT` -- the user key's Ed25519
|
|
14
|
+
* signing half, derived from its X25519 secret rather than stored, and the
|
|
15
|
+
* record signer and verification allowlist an app-side record sealed to the
|
|
16
|
+
* vault KAK signs and checks its proof with.
|
|
12
17
|
* - `encodeClientKeyRecord` / `decodeClientKeyRecord` -- the contents codec and
|
|
13
18
|
* strict validation of the local client-key record each client keeps its own
|
|
14
19
|
* key material in (storage and wrapping stay app-side).
|
|
@@ -82,7 +87,7 @@
|
|
|
82
87
|
* `WalletSpaceProvisioningError` when a collection was left without its
|
|
83
88
|
* epoch so the engine never memoizes a torn run.
|
|
84
89
|
*/
|
|
85
|
-
export { mintUserKey, userKeyVaultKeys } from './userKey.js';
|
|
90
|
+
export { mintUserKey, USER_KEY_SALT, userKeyRecordSigner, userKeySigningKeyMultibase, userKeySigningSeed, userKeyVaultKeys } from './userKey.js';
|
|
86
91
|
export type { UserKey } from './userKey.js';
|
|
87
92
|
export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRecord, isEnrolledClientKeyRecord, parseClientRecordPending, parseClientRecordUserKey, parseClientRecordWebvhKeys } from './clientKeyRecord.js';
|
|
88
93
|
export type { ClientKeyRecord, ClientKeyRecordJson, ClientKeyRecordPending, EnrolledClientKeyRecord } from './clientKeyRecord.js';
|
package/dist/keys/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,cAAc,EACd,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,8BAA8B,EAC9B,kBAAkB,E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uilding the
|
|
11
11
|
* vault key-agreement key + resolver from stored material.
|
|
12
|
+
* - `userKeySigningSeed` / `userKeyRecordSigner` /
|
|
13
|
+
* `userKeySigningKeyMultibase` / `USER_KEY_SALT` -- the user key's Ed25519
|
|
14
|
+
* signing half, derived from its X25519 secret rather than stored, and the
|
|
15
|
+
* record signer and verification allowlist an app-side record sealed to the
|
|
16
|
+
* vault KAK signs and checks its proof with.
|
|
12
17
|
* - `encodeClientKeyRecord` / `decodeClientKeyRecord` -- the contents codec and
|
|
13
18
|
* strict validation of the local client-key record each client keeps its own
|
|
14
19
|
* key material in (storage and wrapping stay app-side).
|
|
@@ -82,7 +87,7 @@
|
|
|
82
87
|
* `WalletSpaceProvisioningError` when a collection was left without its
|
|
83
88
|
* epoch so the engine never memoizes a torn run.
|
|
84
89
|
*/
|
|
85
|
-
export { mintUserKey, userKeyVaultKeys } from './userKey.js';
|
|
90
|
+
export { mintUserKey, USER_KEY_SALT, userKeyRecordSigner, userKeySigningKeyMultibase, userKeySigningSeed, userKeyVaultKeys } from './userKey.js';
|
|
86
91
|
export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRecord, isEnrolledClientKeyRecord, parseClientRecordPending, parseClientRecordUserKey, parseClientRecordWebvhKeys } from './clientKeyRecord.js';
|
|
87
92
|
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, currentEpochOf, enrolledClientRosterRecipients, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, replaceUserKeyRosterRecipients, rosterRecipientKid, rosterRecipientsToRetire, rosterWrapsRecipient, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
88
93
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
package/dist/keys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAQ7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,cAAc,EACd,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,8BAA8B,EAC9B,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAK5B,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,2BAA2B,CAAA;AAalC,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAG/D,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,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