@interop/did-cli 0.13.0 → 0.15.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/CHANGELOG.md +166 -6
- package/README.md +172 -26
- package/dist/commands/did/create.d.ts +22 -0
- package/dist/commands/did/create.d.ts.map +1 -1
- package/dist/commands/did/create.js +6 -27
- package/dist/commands/did/create.js.map +1 -1
- package/dist/commands/did/service.d.ts +19 -4
- package/dist/commands/did/service.d.ts.map +1 -1
- package/dist/commands/did/service.js +46 -45
- package/dist/commands/did/service.js.map +1 -1
- package/dist/commands/did/webvh-update.d.ts +72 -9
- package/dist/commands/did/webvh-update.d.ts.map +1 -1
- package/dist/commands/did/webvh-update.js +177 -61
- package/dist/commands/did/webvh-update.js.map +1 -1
- package/dist/commands/did.d.ts.map +1 -1
- package/dist/commands/did.js +10 -1
- package/dist/commands/did.js.map +1 -1
- package/dist/commands/key.d.ts.map +1 -1
- package/dist/commands/key.js +5 -8
- package/dist/commands/key.js.map +1 -1
- package/dist/commands/was/request-grant.d.ts +39 -0
- package/dist/commands/was/request-grant.d.ts.map +1 -0
- package/dist/commands/was/request-grant.js +250 -0
- package/dist/commands/was/request-grant.js.map +1 -0
- package/dist/commands/was/resource.d.ts +21 -7
- package/dist/commands/was/resource.d.ts.map +1 -1
- package/dist/commands/was/resource.js +40 -15
- package/dist/commands/was/resource.js.map +1 -1
- package/dist/commands/was/shared.d.ts +43 -3
- package/dist/commands/was/shared.d.ts.map +1 -1
- package/dist/commands/was/shared.js +82 -4
- package/dist/commands/was/shared.js.map +1 -1
- package/dist/commands/was/shell/completer.d.ts +24 -0
- package/dist/commands/was/shell/completer.d.ts.map +1 -0
- package/dist/commands/was/shell/completer.js +99 -0
- package/dist/commands/was/shell/completer.js.map +1 -0
- package/dist/commands/was/shell/dispatcher.d.ts +27 -0
- package/dist/commands/was/shell/dispatcher.d.ts.map +1 -0
- package/dist/commands/was/shell/dispatcher.js +227 -0
- package/dist/commands/was/shell/dispatcher.js.map +1 -0
- package/dist/commands/was/shell/session.d.ts +37 -0
- package/dist/commands/was/shell/session.d.ts.map +1 -0
- package/dist/commands/was/shell/session.js +67 -0
- package/dist/commands/was/shell/session.js.map +1 -0
- package/dist/commands/was/shell/tokenize.d.ts +19 -0
- package/dist/commands/was/shell/tokenize.d.ts.map +1 -0
- package/dist/commands/was/shell/tokenize.js +77 -0
- package/dist/commands/was/shell/tokenize.js.map +1 -0
- package/dist/commands/was/shell.d.ts +30 -0
- package/dist/commands/was/shell.d.ts.map +1 -0
- package/dist/commands/was/shell.js +170 -0
- package/dist/commands/was/shell.js.map +1 -0
- package/dist/commands/was/tree.d.ts +6 -1
- package/dist/commands/was/tree.d.ts.map +1 -1
- package/dist/commands/was/tree.js +12 -5
- package/dist/commands/was/tree.js.map +1 -1
- package/dist/commands/was.d.ts.map +1 -1
- package/dist/commands/was.js +34 -1
- package/dist/commands/was.js.map +1 -1
- package/dist/commands/zcap.d.ts +22 -2
- package/dist/commands/zcap.d.ts.map +1 -1
- package/dist/commands/zcap.js +75 -4
- package/dist/commands/zcap.js.map +1 -1
- package/dist/keys/seed.d.ts +21 -0
- package/dist/keys/seed.d.ts.map +1 -0
- package/dist/keys/seed.js +41 -0
- package/dist/keys/seed.js.map +1 -0
- package/dist/keys/webvh-signer.d.ts +18 -13
- package/dist/keys/webvh-signer.d.ts.map +1 -1
- package/dist/keys/webvh-signer.js +5 -20
- package/dist/keys/webvh-signer.js.map +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +57 -10
- package/dist/storage.js.map +1 -1
- package/dist/was/address.d.ts +24 -0
- package/dist/was/address.d.ts.map +1 -1
- package/dist/was/address.js +49 -3
- package/dist/was/address.js.map +1 -1
- package/dist/was/capability.d.ts.map +1 -1
- package/dist/was/capability.js +4 -1
- package/dist/was/capability.js.map +1 -1
- package/dist/was/client.d.ts +10 -3
- package/dist/was/client.d.ts.map +1 -1
- package/dist/was/client.js +27 -6
- package/dist/was/client.js.map +1 -1
- package/dist/was/request-grant.d.ts +147 -0
- package/dist/was/request-grant.d.ts.map +1 -0
- package/dist/was/request-grant.js +256 -0
- package/dist/was/request-grant.js.map +1 -0
- package/dist/zcap/create.d.ts +1 -1
- package/dist/zcap/create.js +1 -1
- package/dist/zcap/delegate.d.ts +1 -1
- package/dist/zcap/delegate.js +1 -1
- package/dist/zcap/encoding.d.ts +17 -5
- package/dist/zcap/encoding.d.ts.map +1 -1
- package/dist/zcap/encoding.js +31 -17
- package/dist/zcap/encoding.js.map +1 -1
- package/dist/zcap/resolve.d.ts +17 -4
- package/dist/zcap/resolve.d.ts.map +1 -1
- package/dist/zcap/resolve.js +25 -8
- package/dist/zcap/resolve.js.map +1 -1
- package/package.json +22 -20
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requests a capability from a user's wallet: mints the grantee key, opens an
|
|
3
|
+
* ephemeral exchange carrying a zcap-only VPR, prints the interaction URL for
|
|
4
|
+
* the user to open, then waits for their approval and records what came back.
|
|
5
|
+
*
|
|
6
|
+
* @param options {object}
|
|
7
|
+
* @param [options.collection] {string} The collection to request (default
|
|
8
|
+
* `web`).
|
|
9
|
+
* @param [options.action] {string[]} The actions to request.
|
|
10
|
+
* @param [options.reason] {string} Why access is wanted, shown at consent.
|
|
11
|
+
* @param [options.name] {string} The agent's self-declared display name,
|
|
12
|
+
* shown at consent as what it calls itself.
|
|
13
|
+
* @param [options.exchange] {string} Base URL of the WAS server that hosts
|
|
14
|
+
* the ephemeral exchange carrying the request (the grant itself may land on
|
|
15
|
+
* any space the wallet picks).
|
|
16
|
+
* @param [options.wallet] {string} A wallet base URL to print an approval
|
|
17
|
+
* deep link for, beside the interaction URL.
|
|
18
|
+
* @param [options.save] {boolean} Persist the key and capabilities
|
|
19
|
+
* (default true).
|
|
20
|
+
* @param [options.handle] {string} Handle to file them under.
|
|
21
|
+
* @param [options.description] {string} Longer description for the sidecar.
|
|
22
|
+
* @param [options.timeout] {string} Seconds to wait for approval.
|
|
23
|
+
* @param [options.json] {boolean} Print one JSON object instead of prose.
|
|
24
|
+
* @returns {Promise<number>} The process exit code.
|
|
25
|
+
*/
|
|
26
|
+
export declare function runRequestGrant(options: {
|
|
27
|
+
collection?: string;
|
|
28
|
+
action?: string[];
|
|
29
|
+
reason?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
exchange?: string;
|
|
32
|
+
wallet?: string;
|
|
33
|
+
save?: boolean;
|
|
34
|
+
handle?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
timeout?: string;
|
|
37
|
+
json?: boolean;
|
|
38
|
+
}): Promise<number>;
|
|
39
|
+
//# sourceMappingURL=request-grant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-grant.d.ts","sourceRoot":"","sources":["../../../src/commands/was/request-grant.ts"],"names":[],"mappings":"AAsKA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAmIlB"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `was request-grant` -- ask a user's wallet for a capability on one of its
|
|
3
|
+
* public collections. The inverse of `was grant`: an agent runs this, the user
|
|
4
|
+
* approves in their wallet, and the agent receives a signed zcap it can then
|
|
5
|
+
* invoke with `was put --capability`.
|
|
6
|
+
*
|
|
7
|
+
* The grantee key is minted here rather than passed in, so the agent driving
|
|
8
|
+
* the CLI never handles key material: the secret goes straight to local DID
|
|
9
|
+
* storage and stdout carries only the capabilities (or, with `--json`, one
|
|
10
|
+
* object holding the DID, the handle, the interaction URL, and the
|
|
11
|
+
* capabilities). Everything addressed to the human -- the approval link and
|
|
12
|
+
* the progress notes -- goes to stderr, so stdout stays pipe-clean.
|
|
13
|
+
*/
|
|
14
|
+
import { driver } from '@interop/did-method-key';
|
|
15
|
+
import { Ed25519VerificationKey } from '@interop/ed25519-verification-key';
|
|
16
|
+
import { sanitizeStorageId, saveToCollection } from '../../storage.js';
|
|
17
|
+
import { resolveDidRef, resolveZcapRef } from '../../meta.js';
|
|
18
|
+
import { encodeCapability } from '../../zcap/encoding.js';
|
|
19
|
+
import { awaitGrantedCapabilities, buildCapabilityRequest, buildWalletDeepLink, openGrantExchange, walletRequestRoute, GrantRequestError, DEFAULT_COLLECTION, DEFAULT_TIMEOUT_MS, MAX_TIMEOUT_MS } from '../../was/request-grant.js';
|
|
20
|
+
import { saveDidArtifacts } from '../did/create.js';
|
|
21
|
+
import { requireSaveForMetaFlags, writeCreateMeta } from '../collection-command.js';
|
|
22
|
+
import { reportError } from './shared.js';
|
|
23
|
+
/** The zcap wallet collection received capabilities are saved into. */
|
|
24
|
+
const ZCAP_COLLECTION = 'zcaps';
|
|
25
|
+
/** The handle the minted key and received capabilities are filed under. */
|
|
26
|
+
const DEFAULT_HANDLE = 'agent';
|
|
27
|
+
/**
|
|
28
|
+
* Mints the Ed25519 `did:key` the capabilities will be delegated to, holding
|
|
29
|
+
* it in memory only. Nothing is written yet: an exchange that is declined,
|
|
30
|
+
* expires, or times out must not leave a DID behind, since every abandoned run
|
|
31
|
+
* would otherwise file another key under the same handle and make later
|
|
32
|
+
* lookups of that handle ambiguous.
|
|
33
|
+
*
|
|
34
|
+
* @returns {Promise<{did: string, keyPair: Ed25519VerificationKey, didDocument: object}>}
|
|
35
|
+
*/
|
|
36
|
+
async function mintAgentKey() {
|
|
37
|
+
const keyPair = await Ed25519VerificationKey.generate();
|
|
38
|
+
const didDriver = driver();
|
|
39
|
+
didDriver.use({ keyPairClass: Ed25519VerificationKey });
|
|
40
|
+
const { didDocument } = await didDriver.fromKeyPair({
|
|
41
|
+
verificationKeyPair: keyPair
|
|
42
|
+
});
|
|
43
|
+
return { did: didDocument.id, keyPair, didDocument };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Writes the minted key to local DID storage, once the grant it was minted for
|
|
47
|
+
* has actually arrived. Only a saved key can sign a later
|
|
48
|
+
* `was put --capability`, since that resolves its signer out of the DID store.
|
|
49
|
+
*
|
|
50
|
+
* @param options {object}
|
|
51
|
+
* @param options.keyPair {Ed25519VerificationKey}
|
|
52
|
+
* @param options.didDocument {object}
|
|
53
|
+
* @param options.handle {string}
|
|
54
|
+
* @param [options.description] {string}
|
|
55
|
+
* @returns {Promise<void>}
|
|
56
|
+
*/
|
|
57
|
+
async function saveAgentDid({ keyPair, didDocument, handle, description }) {
|
|
58
|
+
const exported = await keyPair.export({ publicKey: true, secretKey: true });
|
|
59
|
+
await saveDidArtifacts({
|
|
60
|
+
method: 'key',
|
|
61
|
+
didDocument,
|
|
62
|
+
exportedKeys: exported,
|
|
63
|
+
fingerprints: [
|
|
64
|
+
exported.publicKeyMultibase
|
|
65
|
+
],
|
|
66
|
+
handle,
|
|
67
|
+
description
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Reports whether a handle is already filed against a stored DID or zcap. A
|
|
72
|
+
* run claims the handle in both stores at once, so a collision in either makes
|
|
73
|
+
* a later `--did <handle>` or `--capability <handle>` ambiguous.
|
|
74
|
+
*
|
|
75
|
+
* @param options {object}
|
|
76
|
+
* @param options.handle {string}
|
|
77
|
+
* @returns {Promise<boolean>}
|
|
78
|
+
*/
|
|
79
|
+
async function isHandleTaken({ handle }) {
|
|
80
|
+
try {
|
|
81
|
+
if (await resolveDidRef({ ref: handle })) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
return (await resolveZcapRef({ ref: handle })) !== undefined;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Resolution throws when the handle already matches more than one stored
|
|
88
|
+
// item, which is itself proof that it is taken.
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Files the received capabilities in the local zcap store. The request carries
|
|
94
|
+
* one capability query, so one capability is the expected answer; any extras
|
|
95
|
+
* are saved under the same handle with a numeric suffix, which keeps every
|
|
96
|
+
* handle unambiguous for later lookup.
|
|
97
|
+
*
|
|
98
|
+
* @param options {object}
|
|
99
|
+
* @param options.zcaps {IZcap[]}
|
|
100
|
+
* @param options.handle {string}
|
|
101
|
+
* @param [options.description] {string}
|
|
102
|
+
* @returns {Promise<string[]>} The saved file paths.
|
|
103
|
+
*/
|
|
104
|
+
async function saveCapabilities({ zcaps, handle, description }) {
|
|
105
|
+
const savedPaths = [];
|
|
106
|
+
for (const [index, zcap] of zcaps.entries()) {
|
|
107
|
+
const storageId = sanitizeStorageId(zcap.id);
|
|
108
|
+
savedPaths.push(await saveToCollection({
|
|
109
|
+
collection: ZCAP_COLLECTION,
|
|
110
|
+
storageId,
|
|
111
|
+
data: zcap
|
|
112
|
+
}));
|
|
113
|
+
await writeCreateMeta({
|
|
114
|
+
collection: ZCAP_COLLECTION,
|
|
115
|
+
storageId,
|
|
116
|
+
created: new Date().toISOString(),
|
|
117
|
+
handle: index === 0 ? handle : `${handle}-${index + 1}`,
|
|
118
|
+
description
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return savedPaths;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Requests a capability from a user's wallet: mints the grantee key, opens an
|
|
125
|
+
* ephemeral exchange carrying a zcap-only VPR, prints the interaction URL for
|
|
126
|
+
* the user to open, then waits for their approval and records what came back.
|
|
127
|
+
*
|
|
128
|
+
* @param options {object}
|
|
129
|
+
* @param [options.collection] {string} The collection to request (default
|
|
130
|
+
* `web`).
|
|
131
|
+
* @param [options.action] {string[]} The actions to request.
|
|
132
|
+
* @param [options.reason] {string} Why access is wanted, shown at consent.
|
|
133
|
+
* @param [options.name] {string} The agent's self-declared display name,
|
|
134
|
+
* shown at consent as what it calls itself.
|
|
135
|
+
* @param [options.exchange] {string} Base URL of the WAS server that hosts
|
|
136
|
+
* the ephemeral exchange carrying the request (the grant itself may land on
|
|
137
|
+
* any space the wallet picks).
|
|
138
|
+
* @param [options.wallet] {string} A wallet base URL to print an approval
|
|
139
|
+
* deep link for, beside the interaction URL.
|
|
140
|
+
* @param [options.save] {boolean} Persist the key and capabilities
|
|
141
|
+
* (default true).
|
|
142
|
+
* @param [options.handle] {string} Handle to file them under.
|
|
143
|
+
* @param [options.description] {string} Longer description for the sidecar.
|
|
144
|
+
* @param [options.timeout] {string} Seconds to wait for approval.
|
|
145
|
+
* @param [options.json] {boolean} Print one JSON object instead of prose.
|
|
146
|
+
* @returns {Promise<number>} The process exit code.
|
|
147
|
+
*/
|
|
148
|
+
export async function runRequestGrant(options) {
|
|
149
|
+
const save = options.save !== false;
|
|
150
|
+
try {
|
|
151
|
+
if (!requireSaveForMetaFlags({
|
|
152
|
+
save,
|
|
153
|
+
...(options.handle !== undefined && { handle: options.handle }),
|
|
154
|
+
...(options.description !== undefined && {
|
|
155
|
+
description: options.description
|
|
156
|
+
})
|
|
157
|
+
})) {
|
|
158
|
+
return 2;
|
|
159
|
+
}
|
|
160
|
+
const exchange = options.exchange ?? process.env.WAS_SERVER_URL;
|
|
161
|
+
if (!exchange) {
|
|
162
|
+
throw new Error('No exchange server URL: provide --exchange or set WAS_SERVER_URL.');
|
|
163
|
+
}
|
|
164
|
+
const timeoutMs = options.timeout === undefined
|
|
165
|
+
? DEFAULT_TIMEOUT_MS
|
|
166
|
+
: Number(options.timeout) * 1000;
|
|
167
|
+
if (!Number.isFinite(timeoutMs) ||
|
|
168
|
+
timeoutMs <= 0 ||
|
|
169
|
+
timeoutMs > MAX_TIMEOUT_MS) {
|
|
170
|
+
throw new Error(`Invalid --timeout "${options.timeout}": use seconds, up to ` +
|
|
171
|
+
`${Math.floor(MAX_TIMEOUT_MS / 1000)}.`);
|
|
172
|
+
}
|
|
173
|
+
const collection = options.collection ?? DEFAULT_COLLECTION;
|
|
174
|
+
const handle = options.handle ?? DEFAULT_HANDLE;
|
|
175
|
+
if (save && (await isHandleTaken({ handle }))) {
|
|
176
|
+
console.error(`The handle "${handle}" is already taken by a stored DID or ` +
|
|
177
|
+
'capability; pass a different --handle.');
|
|
178
|
+
return 2;
|
|
179
|
+
}
|
|
180
|
+
const walletRoute = options.wallet === undefined
|
|
181
|
+
? undefined
|
|
182
|
+
: walletRequestRoute({ wallet: options.wallet });
|
|
183
|
+
const { did: controller, keyPair, didDocument } = await mintAgentKey();
|
|
184
|
+
const request = buildCapabilityRequest({
|
|
185
|
+
controller,
|
|
186
|
+
collection,
|
|
187
|
+
...(options.action !== undefined && { actions: options.action }),
|
|
188
|
+
...(options.reason !== undefined && { reason: options.reason }),
|
|
189
|
+
...(options.name !== undefined && { name: options.name })
|
|
190
|
+
});
|
|
191
|
+
const { exchangeUrl, interactionUrl } = await openGrantExchange({
|
|
192
|
+
exchange,
|
|
193
|
+
request
|
|
194
|
+
});
|
|
195
|
+
const walletUrl = walletRoute === undefined
|
|
196
|
+
? undefined
|
|
197
|
+
: buildWalletDeepLink({ route: walletRoute, interactionUrl });
|
|
198
|
+
console.error(`Requesting "${collection}" access for ${controller}.\n` +
|
|
199
|
+
`Open this in your wallet to approve:\n\n ${interactionUrl}\n\n` +
|
|
200
|
+
(walletUrl === undefined
|
|
201
|
+
? ''
|
|
202
|
+
: `Or open your wallet directly:\n\n ${walletUrl}\n\n`) +
|
|
203
|
+
'Waiting for approval...');
|
|
204
|
+
const zcaps = await awaitGrantedCapabilities({ exchangeUrl, timeoutMs });
|
|
205
|
+
let savedPaths = [];
|
|
206
|
+
if (save) {
|
|
207
|
+
const description = options.description !== undefined
|
|
208
|
+
? { description: options.description }
|
|
209
|
+
: {};
|
|
210
|
+
await saveAgentDid({ keyPair, didDocument, handle, ...description });
|
|
211
|
+
savedPaths = await saveCapabilities({ zcaps, handle, ...description });
|
|
212
|
+
}
|
|
213
|
+
for (const savedPath of savedPaths) {
|
|
214
|
+
console.error(`Capability saved to ${savedPath}`);
|
|
215
|
+
}
|
|
216
|
+
if (!save) {
|
|
217
|
+
console.error('Not saved (--no-save): the grantee key was discarded, so these ' +
|
|
218
|
+
'capabilities cannot be invoked by a later command.');
|
|
219
|
+
}
|
|
220
|
+
const encoded = zcaps.map(zcap => encodeCapability(zcap));
|
|
221
|
+
if (options.json) {
|
|
222
|
+
console.log(JSON.stringify({
|
|
223
|
+
controller,
|
|
224
|
+
...(save && { handle }),
|
|
225
|
+
interactionUrl,
|
|
226
|
+
...(walletUrl !== undefined && { walletUrl }),
|
|
227
|
+
capabilities: zcaps,
|
|
228
|
+
encoded
|
|
229
|
+
}, null, 2));
|
|
230
|
+
return 0;
|
|
231
|
+
}
|
|
232
|
+
console.error(save
|
|
233
|
+
? `Granted. Use it with --capability ${handle}, for example:\n` +
|
|
234
|
+
` di was put ./index.html --capability ${handle} ` +
|
|
235
|
+
`--did ${handle} --resource index.html --content-type text/html`
|
|
236
|
+
: 'Granted.');
|
|
237
|
+
for (const value of encoded) {
|
|
238
|
+
console.log(value);
|
|
239
|
+
}
|
|
240
|
+
return 0;
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
if (err instanceof GrantRequestError) {
|
|
244
|
+
console.error(`Could not request a grant: ${err.message}`);
|
|
245
|
+
return 1;
|
|
246
|
+
}
|
|
247
|
+
return reportError({ action: 'request a grant', err });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=request-grant.js.map
|
|
@@ -0,0 +1 @@
|
|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AAI,CAAC,CAAC,CAAA;QACzD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,SAAS,CACZ;gBACE,UAAU;gBACV,GAAG,CAAC,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;gBACvB,cAAc;gBACd,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC;gBAC7C,YAAY,EAAE,KAAK;gBACnB,OAAO;aACR,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAA;YACD,OAAO,CAAC,CAAA;QACV,CAAC;QACD,OAAO,CAAC,KAAK,CACX,IAAI;YACF,CAAC,CAAC,qCAAqC,MAAM,kBAAkB;gBAC3D,0CAA0C,MAAM,GAAG;gBACnD,SAAS,MAAM,iDAAiD;YACpE,CAAC,CAAC,UAAU,CACf,CAAA;QACD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;YACrC,OAAO,CAAC,KAAK,CAAC,8BAA8B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;YAC1D,OAAO,CAAC,CAAA;QACV,CAAC;QACD,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAA;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -23,13 +23,15 @@ export declare function runResourceAdd(options: {
|
|
|
23
23
|
}): Promise<number>;
|
|
24
24
|
/**
|
|
25
25
|
* Creates or replaces a resource at a known id (upsert) and prints
|
|
26
|
-
* `{ id, url }`. The resource comes from a path
|
|
27
|
-
* targeting one
|
|
26
|
+
* `{ id, url }`. The resource comes from a path, a `--capability`
|
|
27
|
+
* targeting one, or a collection `--capability` plus `--resource <id>`.
|
|
28
28
|
*
|
|
29
29
|
* @param options {object}
|
|
30
30
|
* @param [options.address] {string} The resource address.
|
|
31
31
|
* @param [options.capability] {string} A capability reference instead of
|
|
32
32
|
* a path.
|
|
33
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
34
|
+
* capability.
|
|
33
35
|
* @param [options.file] {string} The payload file; stdin when omitted.
|
|
34
36
|
* @param [options.contentType] {string} Explicit payload content type.
|
|
35
37
|
* @param [options.server] {string} The server base URL.
|
|
@@ -39,6 +41,7 @@ export declare function runResourceAdd(options: {
|
|
|
39
41
|
export declare function runResourcePut(options: {
|
|
40
42
|
address?: string;
|
|
41
43
|
capability?: string;
|
|
44
|
+
resource?: string;
|
|
42
45
|
file?: string;
|
|
43
46
|
contentType?: string;
|
|
44
47
|
server?: string;
|
|
@@ -46,13 +49,15 @@ export declare function runResourcePut(options: {
|
|
|
46
49
|
}): Promise<number>;
|
|
47
50
|
/**
|
|
48
51
|
* Reads a resource: JSON pretty-printed to stdout, binary written raw
|
|
49
|
-
* (`--output` for files). The resource comes from a path
|
|
50
|
-
* `--capability`
|
|
52
|
+
* (`--output` for files). The resource comes from a path, a `--capability`
|
|
53
|
+
* targeting one, or a collection `--capability` plus `--resource <id>`.
|
|
51
54
|
*
|
|
52
55
|
* @param options {object}
|
|
53
56
|
* @param [options.address] {string} The resource address.
|
|
54
57
|
* @param [options.capability] {string} A capability reference instead of
|
|
55
58
|
* a path.
|
|
59
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
60
|
+
* capability.
|
|
56
61
|
* @param [options.output] {string} The output file path; stdout when
|
|
57
62
|
* omitted.
|
|
58
63
|
* @param [options.server] {string} The server base URL.
|
|
@@ -62,6 +67,7 @@ export declare function runResourcePut(options: {
|
|
|
62
67
|
export declare function runResourceGet(options: {
|
|
63
68
|
address?: string;
|
|
64
69
|
capability?: string;
|
|
70
|
+
resource?: string;
|
|
65
71
|
output?: string;
|
|
66
72
|
server?: string;
|
|
67
73
|
did?: string;
|
|
@@ -69,12 +75,15 @@ export declare function runResourceGet(options: {
|
|
|
69
75
|
/**
|
|
70
76
|
* Reads a resource's metadata object (server-managed `contentType` / `size` /
|
|
71
77
|
* timestamps plus the user-writable `custom`) and pretty-prints it. The
|
|
72
|
-
* resource comes from a path
|
|
78
|
+
* resource comes from a path, a `--capability` targeting one, or a
|
|
79
|
+
* collection `--capability` plus `--resource <id>`.
|
|
73
80
|
*
|
|
74
81
|
* @param options {object}
|
|
75
82
|
* @param [options.address] {string} The resource address.
|
|
76
83
|
* @param [options.capability] {string} A capability reference instead of
|
|
77
84
|
* a path.
|
|
85
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
86
|
+
* capability.
|
|
78
87
|
* @param [options.server] {string} The server base URL.
|
|
79
88
|
* @param [options.did] {string} The signing DID or stored-DID handle.
|
|
80
89
|
* @returns {Promise<number>} The process exit code.
|
|
@@ -82,6 +91,7 @@ export declare function runResourceGet(options: {
|
|
|
82
91
|
export declare function runResourceMetaGet(options: {
|
|
83
92
|
address?: string;
|
|
84
93
|
capability?: string;
|
|
94
|
+
resource?: string;
|
|
85
95
|
server?: string;
|
|
86
96
|
did?: string;
|
|
87
97
|
}): Promise<number>;
|
|
@@ -89,13 +99,16 @@ export declare function runResourceMetaGet(options: {
|
|
|
89
99
|
* Updates a resource's user-writable metadata and prints the resulting
|
|
90
100
|
* metadata. `--name`/`--tag` are read-modify-write sugar that preserve the
|
|
91
101
|
* other field; giving both, or `--json`, is a full `custom` replacement so
|
|
92
|
-
* any omitted property is cleared. The resource comes from a path
|
|
93
|
-
* `--capability` targeting one
|
|
102
|
+
* any omitted property is cleared. The resource comes from a path, a
|
|
103
|
+
* `--capability` targeting one, or a collection `--capability` plus
|
|
104
|
+
* `--resource <id>`.
|
|
94
105
|
*
|
|
95
106
|
* @param options {object}
|
|
96
107
|
* @param [options.address] {string} The resource address.
|
|
97
108
|
* @param [options.capability] {string} A capability reference instead of
|
|
98
109
|
* a path.
|
|
110
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
111
|
+
* capability.
|
|
99
112
|
* @param [options.name] {string} The resource's display name.
|
|
100
113
|
* @param options.tag {string[]} Repeatable `key=value` tag pairs.
|
|
101
114
|
* @param [options.json] {string} Full `custom` JSON (inline or a file
|
|
@@ -107,6 +120,7 @@ export declare function runResourceMetaGet(options: {
|
|
|
107
120
|
export declare function runResourceMetaPut(options: {
|
|
108
121
|
address?: string;
|
|
109
122
|
capability?: string;
|
|
123
|
+
resource?: string;
|
|
110
124
|
name?: string;
|
|
111
125
|
tag: string[];
|
|
112
126
|
json?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/commands/was/resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/commands/was/resource.ts"],"names":[],"mappings":"AAoGA;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,MAAM,CAAC,CAwClB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,M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;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBlB"}
|
|
@@ -2,34 +2,49 @@
|
|
|
2
2
|
* `was resource` run functions: add (server-generated id), put (upsert at a
|
|
3
3
|
* known id), get (JSON or binary), list, delete, and the resource-metadata
|
|
4
4
|
* verbs `meta get` / `meta put`. Each addressing-capable verb accepts either
|
|
5
|
-
* a path or a `--capability` targeting the resource or its collection.
|
|
5
|
+
* a path or a `--capability` targeting the resource or its collection. A
|
|
6
|
+
* collection capability names its resource with `--resource <id>`, which is
|
|
7
|
+
* how a grant scoped to a whole collection is invoked at one resource.
|
|
6
8
|
*/
|
|
7
9
|
import { readFile } from 'node:fs/promises';
|
|
8
10
|
import { resolveCapabilityTarget } from '../../was/capability.js';
|
|
9
11
|
import { readPayload, writeResourceOutput } from '../../was/io.js';
|
|
10
|
-
import { assertOneAddressing, printResourceListing, reportDeleted, reportError, reportNotFound, resolveCollectionTarget, resolveResourceTarget, wasUrl } from './shared.js';
|
|
12
|
+
import { assertOneAddressing, printResourceListing, reportDeleted, reportError, reportNotFound, resolveCollectionTarget, resolveResourceTarget, wasUrl, withResourceId } from './shared.js';
|
|
11
13
|
/**
|
|
12
14
|
* Resolves a single resource handle and its URL from either a path address
|
|
13
|
-
* or a `--capability`
|
|
14
|
-
*
|
|
15
|
+
* or a `--capability` -- the shared addressing logic of the resource verbs
|
|
16
|
+
* that operate on one resource (`put`, `get`, `meta`).
|
|
17
|
+
*
|
|
18
|
+
* The capability may target the resource itself, or the collection holding
|
|
19
|
+
* it together with `--resource <id>`. The second form is what a grant scoped
|
|
20
|
+
* to a whole collection needs: the id is chosen by the caller (unlike `add`,
|
|
21
|
+
* where the server picks it), and the resource handle inherits the
|
|
22
|
+
* collection's bound capability, so the write is still an invocation of the
|
|
23
|
+
* received grant.
|
|
15
24
|
*
|
|
16
25
|
* @param options {object}
|
|
17
26
|
* @param [options.address] {string} The resource address.
|
|
18
27
|
* @param [options.capability] {string} A capability reference instead of
|
|
19
28
|
* a path.
|
|
29
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
30
|
+
* capability.
|
|
20
31
|
* @param options.verb {string} The verb name, for the capability-depth
|
|
21
32
|
* error message.
|
|
22
33
|
* @param [options.server] {string} The server base URL.
|
|
23
34
|
* @param [options.did] {string} The signing DID or stored-DID handle.
|
|
24
35
|
* @returns {Promise<{resource: Resource, url: string}>}
|
|
25
36
|
*/
|
|
26
|
-
async function resolveResourceHandle({ address, capability, verb, server, did }) {
|
|
27
|
-
assertOneAddressing({ address, capability });
|
|
37
|
+
async function resolveResourceHandle({ address, capability, resource: resourceId, verb, server, did }) {
|
|
38
|
+
assertOneAddressing({ address, capability, resource: resourceId });
|
|
28
39
|
if (capability) {
|
|
29
|
-
const resolved =
|
|
40
|
+
const resolved = withResourceId({
|
|
41
|
+
resolved: await resolveCapabilityTarget({ ref: capability, did }),
|
|
42
|
+
resourceId
|
|
43
|
+
});
|
|
30
44
|
if (resolved.depth !== 'resource') {
|
|
31
45
|
throw new Error(`The capability targets a ${resolved.depth}; ` +
|
|
32
|
-
`${verb} needs a resource capability
|
|
46
|
+
`${verb} needs a resource capability, or a collection capability ` +
|
|
47
|
+
'with --resource <id>.');
|
|
33
48
|
}
|
|
34
49
|
return { resource: resolved.handle, url: resolved.url };
|
|
35
50
|
}
|
|
@@ -108,13 +123,15 @@ export async function runResourceAdd(options) {
|
|
|
108
123
|
}
|
|
109
124
|
/**
|
|
110
125
|
* Creates or replaces a resource at a known id (upsert) and prints
|
|
111
|
-
* `{ id, url }`. The resource comes from a path
|
|
112
|
-
* targeting one
|
|
126
|
+
* `{ id, url }`. The resource comes from a path, a `--capability`
|
|
127
|
+
* targeting one, or a collection `--capability` plus `--resource <id>`.
|
|
113
128
|
*
|
|
114
129
|
* @param options {object}
|
|
115
130
|
* @param [options.address] {string} The resource address.
|
|
116
131
|
* @param [options.capability] {string} A capability reference instead of
|
|
117
132
|
* a path.
|
|
133
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
134
|
+
* capability.
|
|
118
135
|
* @param [options.file] {string} The payload file; stdin when omitted.
|
|
119
136
|
* @param [options.contentType] {string} Explicit payload content type.
|
|
120
137
|
* @param [options.server] {string} The server base URL.
|
|
@@ -145,13 +162,15 @@ export async function runResourcePut(options) {
|
|
|
145
162
|
}
|
|
146
163
|
/**
|
|
147
164
|
* Reads a resource: JSON pretty-printed to stdout, binary written raw
|
|
148
|
-
* (`--output` for files). The resource comes from a path
|
|
149
|
-
* `--capability`
|
|
165
|
+
* (`--output` for files). The resource comes from a path, a `--capability`
|
|
166
|
+
* targeting one, or a collection `--capability` plus `--resource <id>`.
|
|
150
167
|
*
|
|
151
168
|
* @param options {object}
|
|
152
169
|
* @param [options.address] {string} The resource address.
|
|
153
170
|
* @param [options.capability] {string} A capability reference instead of
|
|
154
171
|
* a path.
|
|
172
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
173
|
+
* capability.
|
|
155
174
|
* @param [options.output] {string} The output file path; stdout when
|
|
156
175
|
* omitted.
|
|
157
176
|
* @param [options.server] {string} The server base URL.
|
|
@@ -178,12 +197,15 @@ export async function runResourceGet(options) {
|
|
|
178
197
|
/**
|
|
179
198
|
* Reads a resource's metadata object (server-managed `contentType` / `size` /
|
|
180
199
|
* timestamps plus the user-writable `custom`) and pretty-prints it. The
|
|
181
|
-
* resource comes from a path
|
|
200
|
+
* resource comes from a path, a `--capability` targeting one, or a
|
|
201
|
+
* collection `--capability` plus `--resource <id>`.
|
|
182
202
|
*
|
|
183
203
|
* @param options {object}
|
|
184
204
|
* @param [options.address] {string} The resource address.
|
|
185
205
|
* @param [options.capability] {string} A capability reference instead of
|
|
186
206
|
* a path.
|
|
207
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
208
|
+
* capability.
|
|
187
209
|
* @param [options.server] {string} The server base URL.
|
|
188
210
|
* @param [options.did] {string} The signing DID or stored-DID handle.
|
|
189
211
|
* @returns {Promise<number>} The process exit code.
|
|
@@ -259,13 +281,16 @@ async function parseCustomJson(input) {
|
|
|
259
281
|
* Updates a resource's user-writable metadata and prints the resulting
|
|
260
282
|
* metadata. `--name`/`--tag` are read-modify-write sugar that preserve the
|
|
261
283
|
* other field; giving both, or `--json`, is a full `custom` replacement so
|
|
262
|
-
* any omitted property is cleared. The resource comes from a path
|
|
263
|
-
* `--capability` targeting one
|
|
284
|
+
* any omitted property is cleared. The resource comes from a path, a
|
|
285
|
+
* `--capability` targeting one, or a collection `--capability` plus
|
|
286
|
+
* `--resource <id>`.
|
|
264
287
|
*
|
|
265
288
|
* @param options {object}
|
|
266
289
|
* @param [options.address] {string} The resource address.
|
|
267
290
|
* @param [options.capability] {string} A capability reference instead of
|
|
268
291
|
* a path.
|
|
292
|
+
* @param [options.resource] {string} The resource id beneath a collection
|
|
293
|
+
* capability.
|
|
269
294
|
* @param [options.name] {string} The resource's display name.
|
|
270
295
|
* @param options.tag {string[]} Repeatable `key=value` tag pairs.
|
|
271
296
|
* @param [options.json] {string} Full `custom` JSON (inline or a file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../src/commands/was/resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../src/commands/was/resource.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAM3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;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