@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.
@@ -24,13 +24,13 @@ import {
24
24
  verifyIdentityChain,
25
25
  verifyIdentityExtensionFromTrustedState,
26
26
  verifyRevocation
27
- } from "../chunk-LQ56P4SU.js";
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-MEV6QVLC.js";
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 true;
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, options) => {
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
  };
@@ -4,7 +4,7 @@ import {
4
4
  matchesResource,
5
5
  verifyDFOSCredential,
6
6
  verifyDelegationChain
7
- } from "./chunk-MEV6QVLC.js";
7
+ } from "./chunk-24VGJGUM.js";
8
8
  import {
9
9
  createJws,
10
10
  dagCborCanonicalEncode,
@@ -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` or `manifest:M` (widening — invalid)
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, options?: {
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
  *
@@ -12,7 +12,7 @@ import {
12
12
  verifyAuthToken,
13
13
  verifyDFOSCredential,
14
14
  verifyDelegationChain
15
- } from "../chunk-MEV6QVLC.js";
15
+ } from "../chunk-24VGJGUM.js";
16
16
  import "../chunk-ZXXP5W5N.js";
17
17
  export {
18
18
  Attenuation,
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  verifyIdentityChain,
25
25
  verifyIdentityExtensionFromTrustedState,
26
26
  verifyRevocation
27
- } from "./chunk-LQ56P4SU.js";
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-MEV6QVLC.js";
53
+ } from "./chunk-24VGJGUM.js";
54
54
  import {
55
55
  JwsVerificationError,
56
56
  JwtVerificationError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metalabel/dfos-protocol",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "DFOS Protocol — Ed25519 signed chain primitives, beacons, merkle trees, and verification",
6
6
  "license": "MIT",