@interop/was-react 0.8.3 → 0.10.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 +50 -44
- package/dist/auth/chapi.d.ts.map +1 -1
- package/dist/auth/chapi.js +5 -4
- package/dist/auth/chapi.js.map +1 -1
- package/dist/auth/loginFlow.d.ts.map +1 -1
- package/dist/auth/loginFlow.js +48 -50
- package/dist/auth/loginFlow.js.map +1 -1
- package/dist/auth/loginRequest.d.ts +38 -5
- package/dist/auth/loginRequest.d.ts.map +1 -1
- package/dist/auth/loginRequest.js +66 -5
- package/dist/auth/loginRequest.js.map +1 -1
- package/dist/auth/verifyResponse.d.ts +7 -4
- package/dist/auth/verifyResponse.d.ts.map +1 -1
- package/dist/auth/verifyResponse.js +23 -13
- package/dist/auth/verifyResponse.js.map +1 -1
- package/dist/auth/walletRequestTypes.d.ts +9 -90
- package/dist/auth/walletRequestTypes.d.ts.map +1 -1
- package/dist/config.d.ts +9 -9
- package/dist/config.js +0 -0
- package/dist/dev/provisionDevGrants.d.ts.map +1 -1
- package/dist/dev/provisionDevGrants.js +18 -19
- package/dist/dev/provisionDevGrants.js.map +1 -1
- package/dist/grants.d.ts +19 -9
- package/dist/grants.d.ts.map +1 -1
- package/dist/grants.js +17 -2
- package/dist/grants.js.map +1 -1
- package/dist/identity/agents.d.ts +1 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +10 -25
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/appSession.d.ts +27 -0
- package/dist/identity/appSession.d.ts.map +1 -1
- package/dist/identity/appSession.js +51 -13
- package/dist/identity/appSession.js.map +1 -1
- package/dist/identity/seedCredential.d.ts +7 -0
- package/dist/identity/seedCredential.d.ts.map +1 -1
- package/dist/identity/seedCredential.js +11 -14
- package/dist/identity/seedCredential.js.map +1 -1
- package/dist/identity/seedStore.d.ts +19 -0
- package/dist/identity/seedStore.d.ts.map +1 -1
- package/dist/identity/seedStore.js +40 -13
- package/dist/identity/seedStore.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/jsonLd.d.ts +19 -0
- package/dist/jsonLd.d.ts.map +1 -0
- package/dist/jsonLd.js +24 -0
- package/dist/jsonLd.js.map +1 -0
- package/dist/mui/AdoptDialog.d.ts.map +1 -1
- package/dist/mui/AdoptDialog.js +7 -3
- package/dist/mui/AdoptDialog.js.map +1 -1
- package/dist/mui/ClearDataDialog.d.ts.map +1 -1
- package/dist/mui/ClearDataDialog.js +12 -11
- package/dist/mui/ClearDataDialog.js.map +1 -1
- package/dist/mui/ConfirmDialog.d.ts +35 -0
- package/dist/mui/ConfirmDialog.d.ts.map +1 -0
- package/dist/mui/ConfirmDialog.js +18 -0
- package/dist/mui/ConfirmDialog.js.map +1 -0
- package/dist/mui/LogoutDialog.d.ts.map +1 -1
- package/dist/mui/LogoutDialog.js +7 -3
- package/dist/mui/LogoutDialog.js.map +1 -1
- package/dist/react/documentApp.d.ts +29 -0
- package/dist/react/documentApp.d.ts.map +1 -1
- package/dist/react/documentApp.js +9 -38
- package/dist/react/documentApp.js.map +1 -1
- package/dist/react/hooks.d.ts +13 -7
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js +17 -11
- package/dist/react/hooks.js.map +1 -1
- package/dist/session/authStore.d.ts +9 -9
- package/dist/session/authStore.d.ts.map +1 -1
- package/dist/session/authStore.js +100 -96
- package/dist/session/authStore.js.map +1 -1
- package/dist/storage/adopt.d.ts +5 -1
- package/dist/storage/adopt.d.ts.map +1 -1
- package/dist/storage/adopt.js +8 -24
- package/dist/storage/adopt.js.map +1 -1
- package/dist/storage/entityStore.d.ts.map +1 -1
- package/dist/storage/entityStore.js +27 -20
- package/dist/storage/entityStore.js.map +1 -1
- package/dist/storage/localStore.d.ts +12 -6
- package/dist/storage/localStore.d.ts.map +1 -1
- package/dist/storage/localStore.js +118 -74
- package/dist/storage/localStore.js.map +1 -1
- package/dist/storage/sharedCollectionReader.d.ts +1 -1
- package/dist/storage/sharedCollectionReader.d.ts.map +1 -1
- package/dist/storage/sharedCollectionReader.js +79 -81
- package/dist/storage/sharedCollectionReader.js.map +1 -1
- package/dist/storage/storageManager.d.ts +3 -1
- package/dist/storage/storageManager.d.ts.map +1 -1
- package/dist/storage/storageManager.js +20 -6
- package/dist/storage/storageManager.js.map +1 -1
- package/dist/storage/syncController.d.ts +1 -16
- package/dist/storage/syncController.d.ts.map +1 -1
- package/dist/storage/syncController.js +38 -58
- package/dist/storage/syncController.js.map +1 -1
- package/dist/storage/syncStatusStore.d.ts +8 -6
- package/dist/storage/syncStatusStore.d.ts.map +1 -1
- package/dist/storage/syncStatusStore.js +6 -6
- package/dist/storage/syncStatusStore.js.map +1 -1
- package/dist/storage/wasRemoteStore.d.ts +34 -2
- package/dist/storage/wasRemoteStore.d.ts.map +1 -1
- package/dist/storage/wasRemoteStore.js +45 -7
- package/dist/storage/wasRemoteStore.js.map +1 -1
- package/dist/storage/wasSync.d.ts.map +1 -1
- package/dist/storage/wasSync.js +47 -38
- package/dist/storage/wasSync.js.map +1 -1
- package/dist/sync/changesQuery.d.ts.map +1 -1
- package/dist/sync/changesQuery.js +2 -12
- package/dist/sync/changesQuery.js.map +1 -1
- package/dist/sync/docCipher.d.ts +17 -9
- package/dist/sync/docCipher.d.ts.map +1 -1
- package/dist/sync/docCipher.js +17 -11
- package/dist/sync/docCipher.js.map +1 -1
- package/dist/sync/feedMasterPort.d.ts +6 -0
- package/dist/sync/feedMasterPort.d.ts.map +1 -1
- package/dist/sync/feedMasterPort.js +82 -40
- package/dist/sync/feedMasterPort.js.map +1 -1
- package/dist/sync/index.d.ts +6 -5
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +6 -3
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/lww.d.ts +15 -14
- package/dist/sync/lww.d.ts.map +1 -1
- package/dist/sync/lww.js +3 -3
- package/dist/sync/lww.js.map +1 -1
- package/dist/sync/lwwConflictHandler.d.ts +3 -10
- package/dist/sync/lwwConflictHandler.d.ts.map +1 -1
- package/dist/sync/lwwConflictHandler.js +7 -17
- package/dist/sync/lwwConflictHandler.js.map +1 -1
- package/dist/sync/pushWrites.d.ts +6 -8
- package/dist/sync/pushWrites.d.ts.map +1 -1
- package/dist/sync/pushWrites.js +56 -83
- package/dist/sync/pushWrites.js.map +1 -1
- package/dist/sync/types.d.ts +80 -4
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +36 -18
- package/dist/sync/types.js.map +1 -1
- package/dist/sync/wasSyncPort.d.ts +0 -11
- package/dist/sync/wasSyncPort.d.ts.map +1 -1
- package/dist/sync/wasSyncPort.js +8 -33
- package/dist/sync/wasSyncPort.js.map +1 -1
- package/package.json +5 -5
- package/dist/identity/initAppSession.d.ts +0 -27
- package/dist/identity/initAppSession.d.ts.map +0 -1
- package/dist/identity/initAppSession.js +0 -30
- package/dist/identity/initAppSession.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IVerifiablePresentation, IZcap } from '@interop/data-integrity-core';
|
|
2
2
|
import type { DocumentLoader } from '../identity/documentLoader.js';
|
|
3
3
|
import { type ParsedGrants } from '../grants.js';
|
|
4
|
+
import { type GrantRequestCollection } from './loginRequest.js';
|
|
4
5
|
/**
|
|
5
6
|
* Verifies a login response VP cryptographically and structurally (steps 1-2
|
|
6
7
|
* above). Throws on any failure.
|
|
@@ -40,16 +41,18 @@ export interface CheckedGrants {
|
|
|
40
41
|
* @param options {object}
|
|
41
42
|
* @param options.grants {IZcap[]}
|
|
42
43
|
* @param options.controllerDid {string} this app's seed-derived DID
|
|
43
|
-
* @param options.collections {
|
|
44
|
-
* covered
|
|
44
|
+
* @param options.collections {GrantRequestCollection[]} the collections that
|
|
45
|
+
* must be covered (WAS collection id + visibility; the visibility selects
|
|
46
|
+
* the class ceiling the required actions are capped at)
|
|
45
47
|
* @param [options.requiredActions] {string[]} the actions each collection
|
|
46
|
-
* grant must allow (defaults to
|
|
48
|
+
* grant must allow, capped per collection at its class ceiling (defaults to
|
|
49
|
+
* `RW_ACTIONS`, so each collection requires exactly its ceiling)
|
|
47
50
|
* @returns {CheckedGrants}
|
|
48
51
|
*/
|
|
49
52
|
export declare function checkGrants({ grants, controllerDid, collections, requiredActions }: {
|
|
50
53
|
grants: IZcap[];
|
|
51
54
|
controllerDid: string;
|
|
52
|
-
collections:
|
|
55
|
+
collections: GrantRequestCollection[];
|
|
53
56
|
requiredActions?: string[];
|
|
54
57
|
}): CheckedGrants;
|
|
55
58
|
//# sourceMappingURL=verifyResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyResponse.d.ts","sourceRoot":"","sources":["../../src/auth/verifyResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verifyResponse.d.ts","sourceRoot":"","sources":["../../src/auth/verifyResponse.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EACV,uBAAuB,EACvB,KAAK,EACN,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAG7D,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,YAAY,EACZ,SAAS,EACT,MAAM,EACN,cAAc,EACf,EAAE;IACD,YAAY,EAAE,uBAAuB,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,cAAc,CAAA;CAC/B,GAAG,OAAO,CAAC,IAAI,CAAC,CA0EhB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,YAAY,EAAE,uBAAuB,GAAG,KAAK,EAAE,CAMvE;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,aAAa,EACb,WAAW,EACX,eAA4B,EAC7B,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,sBAAsB,EAAE,CAAA;IACrC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,GAAG,aAAa,CA+ChB"}
|
|
@@ -15,9 +15,13 @@
|
|
|
15
15
|
* the `challenge` echoes this request's fresh nonce.
|
|
16
16
|
* 3. Grant structure: every zcap is controlled by OUR seed-derived DID,
|
|
17
17
|
* targets a single space on a single WAS host, is unexpired, and the
|
|
18
|
-
* collection set is fully covered with sufficient actions
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* collection set is fully covered with sufficient actions -- where
|
|
19
|
+
* "sufficient" is capped at each collection's class ceiling: a conformant
|
|
20
|
+
* wallet caps a public-collection grant add-only, so requiring `PUT` or
|
|
21
|
+
* `DELETE` there would reject every correct wallet (the App Connect spec
|
|
22
|
+
* forbids failing a connection over an action the class ceiling excludes).
|
|
23
|
+
* (Delegation-chain proofs are enforced server-side at invocation; the RP
|
|
24
|
+
* checks structure.)
|
|
21
25
|
*
|
|
22
26
|
* Note on holder binding: the wallet signs the VP as ITS holder DID (did:web
|
|
23
27
|
* or the wallet's did:key) -- not as this app's controller DID, which never
|
|
@@ -28,7 +32,8 @@
|
|
|
28
32
|
import { verifyPresentation } from '@interop/verifier-core';
|
|
29
33
|
import { parseGrants } from '../grants.js';
|
|
30
34
|
import { earliestExpiry, isExpired } from '../identity/appSession.js';
|
|
31
|
-
import {
|
|
35
|
+
import { asArray } from '../jsonLd.js';
|
|
36
|
+
import { actionCeiling, RW_ACTIONS } from './loginRequest.js';
|
|
32
37
|
/**
|
|
33
38
|
* Verifies a login response VP cryptographically and structurally (steps 1-2
|
|
34
39
|
* above). Throws on any failure.
|
|
@@ -69,8 +74,8 @@ export async function verifyLoginPresentation({ presentation, challenge, domain,
|
|
|
69
74
|
.join(', ');
|
|
70
75
|
throw new Error(`Wallet presentation failed verification (${summary || 'unknown check'}).`);
|
|
71
76
|
}
|
|
72
|
-
|
|
73
|
-
const proofs =
|
|
77
|
+
// The presentation-level proofs (a VP may carry one object or several).
|
|
78
|
+
const proofs = asArray(presentation.proof);
|
|
74
79
|
if (proofs.length === 0) {
|
|
75
80
|
throw new Error('Wallet presentation carries no authentication proof.');
|
|
76
81
|
}
|
|
@@ -113,8 +118,7 @@ export function grantsOf(presentation) {
|
|
|
113
118
|
* The actions a grant allows, normalized to an array.
|
|
114
119
|
*/
|
|
115
120
|
function actionsOf(zcap) {
|
|
116
|
-
|
|
117
|
-
return Array.isArray(allowed) ? allowed : allowed ? [allowed] : [];
|
|
121
|
+
return asArray(zcap.allowedAction);
|
|
118
122
|
}
|
|
119
123
|
/**
|
|
120
124
|
* Structural validation of the granted zcaps (step 3 above). Throws on any
|
|
@@ -123,10 +127,12 @@ function actionsOf(zcap) {
|
|
|
123
127
|
* @param options {object}
|
|
124
128
|
* @param options.grants {IZcap[]}
|
|
125
129
|
* @param options.controllerDid {string} this app's seed-derived DID
|
|
126
|
-
* @param options.collections {
|
|
127
|
-
* covered
|
|
130
|
+
* @param options.collections {GrantRequestCollection[]} the collections that
|
|
131
|
+
* must be covered (WAS collection id + visibility; the visibility selects
|
|
132
|
+
* the class ceiling the required actions are capped at)
|
|
128
133
|
* @param [options.requiredActions] {string[]} the actions each collection
|
|
129
|
-
* grant must allow (defaults to
|
|
134
|
+
* grant must allow, capped per collection at its class ceiling (defaults to
|
|
135
|
+
* `RW_ACTIONS`, so each collection requires exactly its ceiling)
|
|
130
136
|
* @returns {CheckedGrants}
|
|
131
137
|
*/
|
|
132
138
|
export function checkGrants({ grants, controllerDid, collections, requiredActions = RW_ACTIONS }) {
|
|
@@ -147,13 +153,17 @@ export function checkGrants({ grants, controllerDid, collections, requiredAction
|
|
|
147
153
|
// builds the per-collection routing table. The wallet decides where the
|
|
148
154
|
// user's Space lives; the sync layer derives its target from the grants.
|
|
149
155
|
const parsed = parseGrants(grants);
|
|
150
|
-
for (const id of collections) {
|
|
156
|
+
for (const { id, visibility } of collections) {
|
|
151
157
|
const grant = parsed.byCollectionId[id];
|
|
152
158
|
if (!grant) {
|
|
153
159
|
throw new Error(`No grant covers the "${id}" collection.`);
|
|
154
160
|
}
|
|
155
161
|
const actions = actionsOf(grant);
|
|
156
|
-
|
|
162
|
+
// The requirement is capped at the class ceiling: a conformant wallet caps
|
|
163
|
+
// a public grant add-only, so an above-ceiling requirement (explicit or
|
|
164
|
+
// the RW default) must cost the excess actions, never the login.
|
|
165
|
+
const required = actionCeiling(visibility).filter(action => requiredActions.includes(action));
|
|
166
|
+
const missing = required.filter(action => !actions.includes(action));
|
|
157
167
|
if (missing.length > 0) {
|
|
158
168
|
throw new Error(`The "${id}" grant lacks required actions: ${missing.join(', ')}.`);
|
|
159
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyResponse.js","sourceRoot":"","sources":["../../src/auth/verifyResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"verifyResponse.js","sourceRoot":"","sources":["../../src/auth/verifyResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAM3D,OAAO,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;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,EAAE,CAAC,CAAA;QACvC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,eAAe,CAAC,CAAA;QAC5D,CAAC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;QAChC,2EAA2E;QAC3E,wEAAwE;QACxE,iEAAiE;QACjE,MAAM,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACzD,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CACjC,CAAA;QACD,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;QACpE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CACb,QAAQ,EAAE,mCAAmC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACnE,CAAA;QACH,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;AACpC,CAAC"}
|
|
@@ -2,45 +2,19 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The relying-party side of the VC API request vocabulary: the Verifiable
|
|
6
|
+
* Presentation Request this library composes for a wallet, and the queries it
|
|
7
|
+
* carries.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* agnostic so the same
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* The request travels today via a CHAPI popup, but the shapes are transport
|
|
10
|
+
* agnostic, so the same compose logic can later back other entry points (a QR
|
|
11
|
+
* scan, an exchange-URL POST) without dragging React or CHAPI along. Only the
|
|
12
|
+
* types this library actually emits or consumes live here; the wallet-side
|
|
13
|
+
* message/response/classification shapes belong to the wallet.
|
|
13
14
|
*
|
|
14
15
|
* @see https://w3c-ccg.github.io/vp-request-spec/
|
|
15
16
|
*/
|
|
16
17
|
import type { IVerifiableCredential, IVerifiablePresentation, IZcap } from '@interop/data-integrity-core';
|
|
17
|
-
/**
|
|
18
|
-
* The union of VC API message types the wallet can classify. Zcap and exchange
|
|
19
|
-
* invitation / issue request messages are deferred to later work.
|
|
20
|
-
*/
|
|
21
|
-
export type WalletAPIMessage = IVPRequest | IVPOffer;
|
|
22
|
-
/**
|
|
23
|
-
* "I'm offering the following credentials" -- a Verifiable Presentation offered
|
|
24
|
-
* to the wallet for storage.
|
|
25
|
-
*
|
|
26
|
-
* @see https://vcplayground.org/docs/n/chapi/wallets/native/#vc-api
|
|
27
|
-
*/
|
|
28
|
-
export type IVPOffer = {
|
|
29
|
-
credentialRequestOrigin?: string;
|
|
30
|
-
verifiablePresentation: IVerifiablePresentation;
|
|
31
|
-
redirectUrl?: string;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* "The following things are requested" -- a Verifiable Presentation Request
|
|
35
|
-
* asking the wallet to share credentials and/or prove DID Authentication.
|
|
36
|
-
*
|
|
37
|
-
* @see https://w3c-ccg.github.io/vp-request-spec/
|
|
38
|
-
*/
|
|
39
|
-
export type IVPRequest = {
|
|
40
|
-
credentialRequestOrigin?: string;
|
|
41
|
-
verifiablePresentationRequest: IVPRDetails;
|
|
42
|
-
redirectUrl?: string;
|
|
43
|
-
};
|
|
44
18
|
/**
|
|
45
19
|
* The body of a Verifiable Presentation Request: one or more queries, plus the
|
|
46
20
|
* `challenge` / `domain` used when a DID Authentication proof is requested.
|
|
@@ -50,27 +24,7 @@ export type IVPRDetails = {
|
|
|
50
24
|
challenge?: string;
|
|
51
25
|
domain?: string;
|
|
52
26
|
};
|
|
53
|
-
export type IVPRQuery =
|
|
54
|
-
/**
|
|
55
|
-
* A request for one or more VCs matching an example credential shape.
|
|
56
|
-
*
|
|
57
|
-
* @see https://w3c-ccg.github.io/vp-request-spec/#query-by-example
|
|
58
|
-
*/
|
|
59
|
-
export type IQueryByExample = {
|
|
60
|
-
type: 'QueryByExample';
|
|
61
|
-
acceptedCryptosuites?: Array<{
|
|
62
|
-
cryptosuite: string;
|
|
63
|
-
}>;
|
|
64
|
-
credentialQuery: {
|
|
65
|
-
reason?: string;
|
|
66
|
-
example: {
|
|
67
|
-
'@context'?: string | object | Array<string | object>;
|
|
68
|
-
type?: string | string[];
|
|
69
|
-
issuer?: string | object | Array<string | object>;
|
|
70
|
-
[x: string]: unknown;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
};
|
|
27
|
+
export type IVPRQuery = IDIDAuthenticationQuery | IAppConnectQuery;
|
|
74
28
|
/**
|
|
75
29
|
* A request for a proof of DID Authentication (a signed VerifiablePresentation
|
|
76
30
|
* over the request's `challenge` / `domain`).
|
|
@@ -86,20 +40,6 @@ export type IDIDAuthenticationQuery = {
|
|
|
86
40
|
cryptosuite: string;
|
|
87
41
|
}>;
|
|
88
42
|
};
|
|
89
|
-
/**
|
|
90
|
-
* A request for one or more delegated capabilities (zcaps) on the user's WAS
|
|
91
|
-
* storage. `AuthorizationCapabilityQuery` is the canonical type string (VCALM
|
|
92
|
-
* §3.4.4); `ZcapQuery` is a legacy alias sent by DCW / the
|
|
93
|
-
* `wallet-to-webapp-demo`. `capabilityQuery` may be a single detail object or
|
|
94
|
-
* an array of them.
|
|
95
|
-
*
|
|
96
|
-
* @see https://w3c.github.io/vcalm/ -- AuthorizationCapabilityQuery
|
|
97
|
-
*/
|
|
98
|
-
export type IZcapQuery = {
|
|
99
|
-
type: 'AuthorizationCapabilityQuery' | 'ZcapQuery';
|
|
100
|
-
capabilityQuery: ICapabilityQueryDetail | ICapabilityQueryDetail[];
|
|
101
|
-
challenge?: string;
|
|
102
|
-
};
|
|
103
43
|
/**
|
|
104
44
|
* A single requested capability: which actions (`allowedAction`) the RP
|
|
105
45
|
* (`controller`) wants on which storage target (`invocationTarget`), with an
|
|
@@ -145,26 +85,5 @@ export type IAppConnectQuery = {
|
|
|
145
85
|
};
|
|
146
86
|
capabilityQuery: IAppConnectCapabilityQuery | IAppConnectCapabilityQuery[];
|
|
147
87
|
};
|
|
148
|
-
/**
|
|
149
|
-
* The wallet's response to a request, delivered by whichever transport received
|
|
150
|
-
* it (CHAPI `respondWith`, a future exchange-URL POST, etc). Delegated zcaps
|
|
151
|
-
* ride *inside* the response VP (as a `zcap` array, embedded before signing),
|
|
152
|
-
* so this shape stays credential-presentation only.
|
|
153
|
-
*/
|
|
154
|
-
export type WalletResponse = {
|
|
155
|
-
verifiablePresentation?: IVerifiablePresentation;
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* A VP Request classified on two independent axes: whether DID Authentication
|
|
159
|
-
* is requested, and separately what content is asked for (credentials and/or
|
|
160
|
-
* capability delegations). Any combination is valid, including zcap-only. The
|
|
161
|
-
* consent screen renders one section per non-empty axis; the two axes replace
|
|
162
|
-
* the former `'vc' | 'didauth' | 'vc+didauth'` cross-product enum.
|
|
163
|
-
*/
|
|
164
|
-
export type WalletRequestProfile = {
|
|
165
|
-
didAuth: boolean;
|
|
166
|
-
vcQueries: IQueryByExample[];
|
|
167
|
-
zcapRequests: ICapabilityQueryDetail[];
|
|
168
|
-
};
|
|
169
88
|
export type { IVerifiableCredential, IVerifiablePresentation, IZcap };
|
|
170
89
|
//# sourceMappingURL=walletRequestTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletRequestTypes.d.ts","sourceRoot":"","sources":["../../src/auth/walletRequestTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,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ACH,IAAI,EAAE,MAAM,CAAA;QACZ,cAAc,EAAE,MAAM,CAAA;QACtB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,eAAe,EAAE,0BAA0B,GAAG,0BAA0B,EAAE,CAAA;CAC3E,CAAA;AAED,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAA"}
|
package/dist/config.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export interface WasCollectionConfig {
|
|
|
46
46
|
* declares a world-readable collection (the wallet provisions it with a
|
|
47
47
|
* public-read policy); public implies PLAINTEXT -- payloads are stored as-is,
|
|
48
48
|
* with no per-collection cipher, and the LWW bookkeeping fields (`updatedAt`,
|
|
49
|
-
* `
|
|
50
|
-
* random per-
|
|
51
|
-
* user's public documents). Changing a collection's visibility after first
|
|
49
|
+
* `clientId`) are world-readable alongside the content (`clientId` is a
|
|
50
|
+
* random per-install attribution label, but still a linkability handle across
|
|
51
|
+
* a user's public documents). Changing a collection's visibility after first
|
|
52
52
|
* use is a data-migration event, not a config tweak: existing rows keep
|
|
53
53
|
* their stored form and stop being readable by the other mode.
|
|
54
54
|
*/
|
|
@@ -66,7 +66,7 @@ export interface WasCollectionConfig {
|
|
|
66
66
|
/**
|
|
67
67
|
* One SHARED collection: a wallet-owned, already-encrypted collection the app
|
|
68
68
|
* asks the wallet for read-and-decrypt access to (the
|
|
69
|
-
* `
|
|
69
|
+
* `https://w3id.org/byoe#shared-collection` grant). It is the mirror image of
|
|
70
70
|
* {@link WasCollectionConfig}: read-only, NOT replicated into RxDB, NOT written
|
|
71
71
|
* to, and with no local replica. Reads go straight to the server through a
|
|
72
72
|
* `SharedCollectionReader`.
|
|
@@ -138,7 +138,7 @@ export interface WasAppConfig {
|
|
|
138
138
|
collections: WasCollectionConfig[];
|
|
139
139
|
/**
|
|
140
140
|
* Wallet-owned collections this app asks to be given READ-AND-DECRYPT access
|
|
141
|
-
* to (the `
|
|
141
|
+
* to (the `https://w3id.org/byoe#shared-collection` grant). Read-only by construction: they
|
|
142
142
|
* are never replicated into RxDB, never written to, and have no local
|
|
143
143
|
* replica -- reads go straight to the server through a
|
|
144
144
|
* `SharedCollectionReader`. A collection may be app-owned (`collections`) or
|
|
@@ -172,9 +172,9 @@ export interface WasAppConfig {
|
|
|
172
172
|
*/
|
|
173
173
|
dbName?: string;
|
|
174
174
|
/**
|
|
175
|
-
* Prefix for this app's `localStorage` keys (e.g. the
|
|
176
|
-
* {@link DEFAULT_STORAGE_KEY_PREFIX}. Migrating apps should set
|
|
177
|
-
* prefix so an existing per-install
|
|
175
|
+
* Prefix for this app's `localStorage` keys (e.g. the LWW `clientId`).
|
|
176
|
+
* Defaults to {@link DEFAULT_STORAGE_KEY_PREFIX}. Migrating apps should set
|
|
177
|
+
* their prior prefix so an existing per-install client id is preserved.
|
|
178
178
|
*/
|
|
179
179
|
storageKeyPrefix?: string;
|
|
180
180
|
/**
|
|
@@ -228,7 +228,7 @@ export declare const DEFAULT_DB_NAME = "was-react";
|
|
|
228
228
|
*/
|
|
229
229
|
export declare const DEFAULT_ONBOARDING = "login-gated";
|
|
230
230
|
/**
|
|
231
|
-
* Default `localStorage` key prefix (e.g. `was-react:
|
|
231
|
+
* Default `localStorage` key prefix (e.g. `was-react:clientId`).
|
|
232
232
|
*/
|
|
233
233
|
export declare const DEFAULT_STORAGE_KEY_PREFIX = "was-react:";
|
|
234
234
|
/**
|
package/dist/config.js
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisionDevGrants.d.ts","sourceRoot":"","sources":["../../src/dev/provisionDevGrants.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAQlE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,UAIrC,CAAA;AAEF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE;QACN,UAAU,EAAE,OAAO,CAAA;QACnB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;CACF;
|
|
1
|
+
{"version":3,"file":"provisionDevGrants.d.ts","sourceRoot":"","sources":["../../src/dev/provisionDevGrants.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAQlE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,UAIrC,CAAA;AAEF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE;QACN,UAAU,EAAE,OAAO,CAAA;QACnB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;CACF;AA0BD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,SAAS,EACT,IAAI,EACJ,WAAW,EACX,SAAuB,EACvB,OAAO,EACP,eAA0C,EAC1C,cAAc,EAGd,OAAqC,EACrC,KAAa,EACb,GAAc,EACf,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAsGpC"}
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
23
23
|
import { dirname } from 'node:path';
|
|
24
24
|
import { WasClient } from '@interop/was-client';
|
|
25
|
-
import { ZcapClient } from '@interop/ezcap';
|
|
26
|
-
import { Ed25519Signature2020 } from '@interop/ed25519-signature';
|
|
27
25
|
import { CapabilityAgent } from '@interop/webkms-client';
|
|
26
|
+
import { agentsFromKeyAgent } from '@interop/wallet-core/identity';
|
|
28
27
|
import { deriveIdentity } from '../identity/agents.js';
|
|
28
|
+
import { collectionPath } from '../grants.js';
|
|
29
29
|
import { RW_ACTIONS } from '../auth/loginRequest.js';
|
|
30
30
|
import { errorStatus } from '../sync/index.js';
|
|
31
31
|
/**
|
|
@@ -52,12 +52,7 @@ async function provisionerClient({ serverUrl, seed }) {
|
|
|
52
52
|
handle: 'dev-provisioner',
|
|
53
53
|
keyName: 'provisioner-key'
|
|
54
54
|
});
|
|
55
|
-
const
|
|
56
|
-
const zcapClient = new ZcapClient({
|
|
57
|
-
SuiteClass: Ed25519Signature2020,
|
|
58
|
-
invocationSigner: signer,
|
|
59
|
-
delegationSigner: signer
|
|
60
|
-
});
|
|
55
|
+
const { zcapClient } = agentsFromKeyAgent({ keyAgent: agent });
|
|
61
56
|
return { was: new WasClient({ serverUrl, zcapClient }), did: agent.id };
|
|
62
57
|
}
|
|
63
58
|
/**
|
|
@@ -90,11 +85,10 @@ export async function provisionDevGrants({ serverUrl, seed, collections, spaceNa
|
|
|
90
85
|
// The server accepts HEAD even though storage-core's ActionInput union omits
|
|
91
86
|
// it, hence the assertion.
|
|
92
87
|
actions = RW_ACTIONS, probe = false, log = () => { } }) {
|
|
93
|
-
const { controllerDid: appDid, zcapClient: appZcapClient }
|
|
94
|
-
|
|
95
|
-
serverUrl,
|
|
96
|
-
|
|
97
|
-
});
|
|
88
|
+
const [{ controllerDid: appDid, zcapClient: appZcapClient }, { was: provisioner, did: provisionerDid }] = await Promise.all([
|
|
89
|
+
deriveIdentity({ seed, identityHandle }),
|
|
90
|
+
provisionerClient({ serverUrl, seed: provisionerSeed })
|
|
91
|
+
]);
|
|
98
92
|
log(`Provisioning against ${serverUrl}`);
|
|
99
93
|
log(` provisioner DID: ${provisionerDid}`);
|
|
100
94
|
log(` app (RP) DID: ${appDid}`);
|
|
@@ -117,9 +111,11 @@ actions = RW_ACTIONS, probe = false, log = () => { } }) {
|
|
|
117
111
|
controller: provisionerDid,
|
|
118
112
|
invocationTarget: spaceUrl
|
|
119
113
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
// `Promise.all` preserves input order, so `grants[i]` still corresponds to
|
|
115
|
+
// `collections[i]` (the probe below relies on that for `[0]`).
|
|
116
|
+
const grants = await Promise.all(collections.map(async (id) => {
|
|
117
|
+
// Plaintext collection (no encryption descriptor) -- mirrors wallet
|
|
118
|
+
// provisioning.
|
|
123
119
|
await space.createCollection({ id, name: id });
|
|
124
120
|
const zcap = await provisioner.grant({
|
|
125
121
|
to: appDid,
|
|
@@ -127,9 +123,9 @@ actions = RW_ACTIONS, probe = false, log = () => { } }) {
|
|
|
127
123
|
target: `${spaceUrl}/${id}`,
|
|
128
124
|
capability: spaceRoot
|
|
129
125
|
});
|
|
130
|
-
grants.push(zcap);
|
|
131
126
|
log(` collection "${id}": created + delegated RW to app`);
|
|
132
|
-
|
|
127
|
+
return zcap;
|
|
128
|
+
}));
|
|
133
129
|
if (outFile !== undefined) {
|
|
134
130
|
await mkdir(dirname(outFile), { recursive: true });
|
|
135
131
|
await writeFile(outFile, JSON.stringify({ grants }, null, 2));
|
|
@@ -155,7 +151,10 @@ actions = RW_ACTIONS, probe = false, log = () => { } }) {
|
|
|
155
151
|
try {
|
|
156
152
|
const response = await appWas.request({
|
|
157
153
|
capability: probeCapability,
|
|
158
|
-
path:
|
|
154
|
+
path: collectionPath({
|
|
155
|
+
spaceId: space.id,
|
|
156
|
+
collectionId: probeCollectionId
|
|
157
|
+
}),
|
|
159
158
|
method: 'PUT',
|
|
160
159
|
json: { id: probeCollectionId, encryption: { scheme: 'edv' } }
|
|
161
160
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisionDevGrants.js","sourceRoot":"","sources":["../../src/dev/provisionDevGrants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAA;AAEjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"provisionDevGrants.js","sourceRoot":"","sources":["../../src/dev/provisionDevGrants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAA;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO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-13,16 +13,23 @@ export interface ParsedGrants {
|
|
|
13
13
|
byCollectionId: Record<string, IZcap>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Builds the server path of a collection, the inverse of the grammar
|
|
17
|
+
* `parseInvocationTarget` reads. Callers append a trailing slash or query
|
|
18
|
+
* string for resource-listing and query endpoints.
|
|
19
|
+
*
|
|
20
|
+
* @param options {object}
|
|
21
|
+
* @param options.spaceId {string}
|
|
22
|
+
* @param options.collectionId {string}
|
|
23
|
+
* @returns {string}
|
|
18
24
|
*/
|
|
19
|
-
|
|
20
|
-
serverUrl: string;
|
|
25
|
+
export declare function collectionPath({ spaceId, collectionId }: {
|
|
21
26
|
spaceId: string;
|
|
22
27
|
collectionId: string;
|
|
23
|
-
}
|
|
28
|
+
}): string;
|
|
24
29
|
/**
|
|
25
|
-
* Parses a single `invocationTarget` URL into its WAS components
|
|
30
|
+
* Parses a single `invocationTarget` URL into its WAS components: the server
|
|
31
|
+
* origin, the space id, and the collection (every routed grant is
|
|
32
|
+
* collection-scoped, so `collectionId` is always present). `serverUrl` is
|
|
26
33
|
* the bare origin (`protocol//host`) with no trailing slash, matching the shape
|
|
27
34
|
* the reference server validates `SERVER_URL` into; the path grammar itself is
|
|
28
35
|
* owned by `@interop/was-client`'s `parseSpaceTarget`. A collection- or
|
|
@@ -32,9 +39,13 @@ interface ParsedTarget {
|
|
|
32
39
|
* capabilities.
|
|
33
40
|
*
|
|
34
41
|
* @param target {string} an absolute WAS URL
|
|
35
|
-
* @returns {
|
|
42
|
+
* @returns {{ serverUrl: string, spaceId: string, collectionId: string }}
|
|
36
43
|
*/
|
|
37
|
-
export declare function parseInvocationTarget(target: string):
|
|
44
|
+
export declare function parseInvocationTarget(target: string): {
|
|
45
|
+
serverUrl: string;
|
|
46
|
+
spaceId: string;
|
|
47
|
+
collectionId: string;
|
|
48
|
+
};
|
|
38
49
|
/**
|
|
39
50
|
* Parses a delegated grant set into the sync topology. Asserts a single server
|
|
40
51
|
* origin and a single space across every grant, and routes each collection-scoped
|
|
@@ -45,5 +56,4 @@ export declare function parseInvocationTarget(target: string): ParsedTarget;
|
|
|
45
56
|
* @returns {ParsedGrants}
|
|
46
57
|
*/
|
|
47
58
|
export declare function parseGrants(zcaps: IZcap[]): ParsedGrants;
|
|
48
|
-
export {};
|
|
49
59
|
//# sourceMappingURL=grants.d.ts.map
|
package/dist/grants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../src/grants.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAEzD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;CACtC;AAED
|
|
1
|
+
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../src/grants.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAEzD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;CACtC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,YAAY,EACb,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,MAAM,CAET;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG;IACrD,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB,CA0BA;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,YAAY,CAgCxD"}
|
package/dist/grants.js
CHANGED
|
@@ -17,7 +17,22 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { parseSpaceTarget } from '@interop/was-client';
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Builds the server path of a collection, the inverse of the grammar
|
|
21
|
+
* `parseInvocationTarget` reads. Callers append a trailing slash or query
|
|
22
|
+
* string for resource-listing and query endpoints.
|
|
23
|
+
*
|
|
24
|
+
* @param options {object}
|
|
25
|
+
* @param options.spaceId {string}
|
|
26
|
+
* @param options.collectionId {string}
|
|
27
|
+
* @returns {string}
|
|
28
|
+
*/
|
|
29
|
+
export function collectionPath({ spaceId, collectionId }) {
|
|
30
|
+
return `/space/${spaceId}/${collectionId}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parses a single `invocationTarget` URL into its WAS components: the server
|
|
34
|
+
* origin, the space id, and the collection (every routed grant is
|
|
35
|
+
* collection-scoped, so `collectionId` is always present). `serverUrl` is
|
|
21
36
|
* the bare origin (`protocol//host`) with no trailing slash, matching the shape
|
|
22
37
|
* the reference server validates `SERVER_URL` into; the path grammar itself is
|
|
23
38
|
* owned by `@interop/was-client`'s `parseSpaceTarget`. A collection- or
|
|
@@ -27,7 +42,7 @@ import { parseSpaceTarget } from '@interop/was-client';
|
|
|
27
42
|
* capabilities.
|
|
28
43
|
*
|
|
29
44
|
* @param target {string} an absolute WAS URL
|
|
30
|
-
* @returns {
|
|
45
|
+
* @returns {{ serverUrl: string, spaceId: string, collectionId: string }}
|
|
31
46
|
*/
|
|
32
47
|
export function parseInvocationTarget(target) {
|
|
33
48
|
let url;
|
package/dist/grants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../src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AAS,EAAE,SAAmB;QAC9B,OAAO,EAAE,OAAiB;QAC1B,cAAc;KACf,CAAA;AACH,CAAC"}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* Crypto that Node 24 provides.
|
|
46
46
|
*/
|
|
47
47
|
import { CapabilityAgent } from '@interop/webkms-client';
|
|
48
|
-
import { ZcapClient } from '@interop/ezcap';
|
|
48
|
+
import type { ZcapClient } from '@interop/ezcap';
|
|
49
49
|
import type { IKeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
|
|
50
50
|
/**
|
|
51
51
|
* Default cosmetic label for the master identity agent. Local naming only (does
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AAErC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,cAAc,CAAA;AAMlD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,eAAe,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;IACtB;;OAEG;IACH,eAAe,EAAE,gBAAgB,CAAA;IACjC;;OAEG;IACH,WAAW,EAAE,YAAY,CAAA;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACJ,cAAwC,EACzC,EAAE;IACD,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,OAAO,CAAC,cAAc,CAAC,CAe1B"}
|