@metalabel/dfos-protocol 0.8.0 → 0.9.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/dist/chain/index.js
CHANGED
|
@@ -24,13 +24,13 @@ import {
|
|
|
24
24
|
verifyIdentityChain,
|
|
25
25
|
verifyIdentityExtensionFromTrustedState,
|
|
26
26
|
verifyRevocation
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-UEJ364OG.js";
|
|
28
28
|
import {
|
|
29
29
|
ED25519_PRIV_MULTICODEC,
|
|
30
30
|
ED25519_PUB_MULTICODEC,
|
|
31
31
|
decodeMultikey,
|
|
32
32
|
encodeEd25519Multikey
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-24VGJGUM.js";
|
|
34
34
|
import "../chunk-ZXXP5W5N.js";
|
|
35
35
|
export {
|
|
36
36
|
ArtifactPayload,
|
|
@@ -315,7 +315,7 @@ var isAttenuated = (parentAtt, childAtt) => {
|
|
|
315
315
|
if (!parentActions.has(a)) return false;
|
|
316
316
|
}
|
|
317
317
|
if (parentRes.type === "chain" && parentRes.id === "*") {
|
|
318
|
-
return
|
|
318
|
+
return childRes.type === "chain";
|
|
319
319
|
}
|
|
320
320
|
if (childRes.type === "chain" && childRes.id === "*") {
|
|
321
321
|
return false;
|
|
@@ -323,17 +323,11 @@ var isAttenuated = (parentAtt, childAtt) => {
|
|
|
323
323
|
if (childRes.type === "chain" && parentRes.type === "chain") {
|
|
324
324
|
return childRes.id === parentRes.id;
|
|
325
325
|
}
|
|
326
|
-
if (childRes.type === "chain" && parentRes.type === "manifest") {
|
|
327
|
-
return true;
|
|
328
|
-
}
|
|
329
|
-
if (childRes.type === "manifest" && parentRes.type === "manifest") {
|
|
330
|
-
return childRes.id === parentRes.id;
|
|
331
|
-
}
|
|
332
326
|
return false;
|
|
333
327
|
});
|
|
334
328
|
});
|
|
335
329
|
};
|
|
336
|
-
var matchesResource = async (att, resource, action
|
|
330
|
+
var matchesResource = async (att, resource, action) => {
|
|
337
331
|
const requestedRes = parseResource(resource);
|
|
338
332
|
if (!requestedRes) return false;
|
|
339
333
|
const requestedActions = parseActions(action);
|
|
@@ -355,12 +349,6 @@ var matchesResource = async (att, resource, action, options) => {
|
|
|
355
349
|
if (entryRes.type === requestedRes.type && entryRes.id === requestedRes.id) {
|
|
356
350
|
return true;
|
|
357
351
|
}
|
|
358
|
-
if (entryRes.type === "manifest" && requestedRes.type === "chain") {
|
|
359
|
-
if (options?.manifestLookup) {
|
|
360
|
-
const indexed = await options.manifestLookup(entryRes.id);
|
|
361
|
-
if (indexed.includes(requestedRes.id)) return true;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
352
|
}
|
|
365
353
|
return false;
|
|
366
354
|
};
|
|
@@ -179,12 +179,8 @@ declare const verifyDelegationChain: (credential: VerifiedDFOSCredential, option
|
|
|
179
179
|
*
|
|
180
180
|
* - `chain:X` covered by `chain:X` (exact match)
|
|
181
181
|
* - `chain:X` covered by `chain:*` (narrowing from wildcard — valid)
|
|
182
|
-
* - `chain:X` covered by `manifest:M` (narrowing from manifest — valid structurally)
|
|
183
|
-
* - `manifest:M` covered by `chain:*` (narrowing from wildcard — valid)
|
|
184
|
-
* - `manifest:M` covered by `manifest:M` (exact match)
|
|
185
|
-
* - `manifest:M` NOT covered by `chain:X` (widening — invalid)
|
|
186
182
|
* - `chain:*` covered by `chain:*` (exact match)
|
|
187
|
-
* - `chain:*` NOT covered by `chain:X`
|
|
183
|
+
* - `chain:*` NOT covered by `chain:X` (widening — invalid)
|
|
188
184
|
* - Actions: child action set must be a subset of parent action set
|
|
189
185
|
*/
|
|
190
186
|
declare const isAttenuated: (parentAtt: Attenuation[], childAtt: Attenuation[]) => boolean;
|
|
@@ -193,14 +189,8 @@ declare const isAttenuated: (parentAtt: Attenuation[], childAtt: Attenuation[])
|
|
|
193
189
|
*
|
|
194
190
|
* Used at the relay to determine if a credential authorizes access to a
|
|
195
191
|
* specific content chain.
|
|
196
|
-
*
|
|
197
|
-
* For `manifest:` resources, requires a `manifestLookup` callback to resolve
|
|
198
|
-
* which contentIds the manifest indexes. Without the callback, `manifest:`
|
|
199
|
-
* resources can only match exact `manifest:` requests, not `chain:` requests.
|
|
200
192
|
*/
|
|
201
|
-
declare const matchesResource: (att: Attenuation[], resource: string, action: string
|
|
202
|
-
manifestLookup?: (manifestContentId: string) => Promise<string[]>;
|
|
203
|
-
}) => Promise<boolean>;
|
|
193
|
+
declare const matchesResource: (att: Attenuation[], resource: string, action: string) => Promise<boolean>;
|
|
204
194
|
/**
|
|
205
195
|
* Decode a DFOS credential JWS without verifying the signature
|
|
206
196
|
*
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
verifyIdentityChain,
|
|
25
25
|
verifyIdentityExtensionFromTrustedState,
|
|
26
26
|
verifyRevocation
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UEJ364OG.js";
|
|
28
28
|
import {
|
|
29
29
|
buildMerkleTree,
|
|
30
30
|
generateMerkleProof,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
verifyAuthToken,
|
|
51
51
|
verifyDFOSCredential,
|
|
52
52
|
verifyDelegationChain
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-24VGJGUM.js";
|
|
54
54
|
import {
|
|
55
55
|
JwsVerificationError,
|
|
56
56
|
JwtVerificationError,
|