@fedify/fedify 2.4.0-dev.2253 → 2.4.0-dev.2259

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.
Files changed (110) hide show
  1. package/dist/{builder-DdUWFCwL.mjs → builder-CBNa1Uw2.mjs} +8 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-CcWDD5VB.mjs → compound-proof-CMPv4UK0.mjs} +20 -3
  6. package/dist/{context-CtI307_A.d.ts → context-7NyiqIcg.d.ts} +111 -2
  7. package/dist/{context-B6X-t8gI.d.cts → context-tsYPJ2Ew.d.cts} +111 -2
  8. package/dist/{deno-D9uhdIuD.mjs → deno-C8XaXmPB.mjs} +1 -1
  9. package/dist/{docloader-fbmPhCdS.mjs → docloader-CpdFLwAg.mjs} +2 -2
  10. package/dist/federation/builder.test.mjs +1 -1
  11. package/dist/federation/compound-fanout.test.mjs +3 -3
  12. package/dist/federation/handler-compound-proof.test.mjs +3 -3
  13. package/dist/federation/handler.test.mjs +76 -5
  14. package/dist/federation/hashlink-media.test.mjs +2 -2
  15. package/dist/federation/idempotency.test.mjs +2 -2
  16. package/dist/federation/inbox-report.test.d.mts +2 -0
  17. package/dist/federation/inbox-report.test.mjs +475 -0
  18. package/dist/federation/metrics.test.mjs +1 -1
  19. package/dist/federation/middleware.test.mjs +7 -7
  20. package/dist/federation/mod.cjs +1 -1
  21. package/dist/federation/mod.d.cts +4 -3
  22. package/dist/federation/mod.d.ts +4 -3
  23. package/dist/federation/mod.js +1 -1
  24. package/dist/federation/outgoing-proof.test.mjs +5 -5
  25. package/dist/federation/portable-actor.test.mjs +3 -3
  26. package/dist/federation/portable-chain.test.mjs +3 -3
  27. package/dist/federation/portable-collection.test.mjs +4 -4
  28. package/dist/federation/portable-delivery.test.mjs +2 -2
  29. package/dist/federation/portable-gateway-keys.test.mjs +4 -4
  30. package/dist/federation/portable-inbox.test.mjs +67 -6
  31. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  32. package/dist/federation/portable-route-activity.test.mjs +2 -2
  33. package/dist/federation/portable.test.mjs +3 -3
  34. package/dist/federation/send.test.mjs +3 -3
  35. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  36. package/dist/federation/tasks/tasks.test.mjs +2 -2
  37. package/dist/federation/temporal.test.mjs +1 -1
  38. package/dist/federation/webfinger.test.mjs +1 -1
  39. package/dist/{federation-B858-Ylk.cjs → federation-D6giSGUT.cjs} +524 -118
  40. package/dist/{http-CUyBaVsQ.mjs → http-BqSbUEiQ.mjs} +141 -98
  41. package/dist/{http-Bp0MKAK3.cjs → http-Cki-npuA.cjs} +456 -116
  42. package/dist/{http-BoGE-nk7.js → http-OMtKlbx1.js} +439 -117
  43. package/dist/{http-DGx0KOws.d.ts → key-C1nv7_jD.d.ts} +638 -229
  44. package/dist/{http-BrwKINQn.d.cts → key-DYxuyd-s.d.cts} +638 -229
  45. package/dist/{key-BlTaKABr.mjs → key-DecAtABm.mjs} +30 -3
  46. package/dist/{kv-cache-Dmqd7s2a.mjs → kv-cache-CWWlMv-s.mjs} +1 -1
  47. package/dist/{kv-cache-BnWemxH2.cjs → kv-cache-D73yVcE5.cjs} +1 -1
  48. package/dist/{kv-cache-DhMzUXEE.js → kv-cache-J0v3UbUn.js} +1 -1
  49. package/dist/{ld-Dx8r_qJU.mjs → ld-UsN-TIPh.mjs} +40 -5
  50. package/dist/{metrics-DFkZkLrO.mjs → metrics-DWCn4VXX.mjs} +2 -1
  51. package/dist/{middleware-DC018B4u.js → middleware-BqzfIlUO.js} +524 -118
  52. package/dist/{middleware-B0RRI88k.mjs → middleware-CkjwiEBd.mjs} +512 -127
  53. package/dist/{middleware-BNhF-Ayx.mjs → middleware-DHn2q0L1.mjs} +1 -1
  54. package/dist/{mod-C7_2j7VT.d.cts → mod-BojP2Bw3.d.cts} +1 -1
  55. package/dist/{mod-Cy9VNHVw.d.ts → mod-CavhAgLw.d.cts} +5 -253
  56. package/dist/{mod-DoTWIc7F.d.cts → mod-CtpF2BU5.d.ts} +5 -253
  57. package/dist/{mod-B8MI1mpi.d.ts → mod-DEZXwV6J.d.ts} +1 -1
  58. package/dist/{mod-DFL6IxYQ.d.cts → mod-Dw-nPxQh.d.cts} +1 -1
  59. package/dist/{mod-BhTaDR5H.d.ts → mod-Xj5P4s4d.d.ts} +1 -1
  60. package/dist/mod.cjs +4 -4
  61. package/dist/mod.d.cts +7 -7
  62. package/dist/mod.d.ts +7 -7
  63. package/dist/mod.js +4 -4
  64. package/dist/nodeinfo/handler.test.mjs +1 -1
  65. package/dist/{owner-B61jjp5K.mjs → owner-CEBn81LD.mjs} +3 -3
  66. package/dist/{portable-collection-DhEA_nWT.cjs → portable-collection-DqTUBKY7.cjs} +1 -1
  67. package/dist/{portable-collection-BnktjQ04.js → portable-collection-ZkUNjtb7.js} +1 -1
  68. package/dist/{portable-collection-CyBJDEzs.mjs → portable-collection-qFSYw4TG.mjs} +2 -2
  69. package/dist/{portable-key-CPN0QZSA.mjs → portable-key-LlMkP-vz.mjs} +1 -1
  70. package/dist/{proof-CZrjvoJ3.mjs → proof-BHRf_jMG.mjs} +142 -22
  71. package/dist/{send-enxOnmZo.mjs → send-DjG8DDU_.mjs} +3 -3
  72. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  73. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  74. package/dist/sig/compound-proof-verification.test.mjs +19 -2
  75. package/dist/sig/compound-proof.test.mjs +2 -2
  76. package/dist/sig/http.test.mjs +2 -2
  77. package/dist/sig/key.test.mjs +1 -1
  78. package/dist/sig/ld.test.mjs +2 -2
  79. package/dist/sig/mitra-receive-interop.test.d.mts +2 -0
  80. package/dist/sig/mitra-receive-interop.test.mjs +260 -0
  81. package/dist/sig/mitra-send-interop.test.d.mts +2 -0
  82. package/dist/sig/mitra-send-interop.test.mjs +461 -0
  83. package/dist/sig/mod.cjs +2 -2
  84. package/dist/sig/mod.d.cts +2 -2
  85. package/dist/sig/mod.d.ts +2 -2
  86. package/dist/sig/mod.js +2 -2
  87. package/dist/sig/owner.test.mjs +1 -1
  88. package/dist/sig/portable-collection.test.mjs +1 -1
  89. package/dist/sig/portable-interop.test.d.mts +2 -0
  90. package/dist/sig/portable-interop.test.mjs +156 -0
  91. package/dist/sig/portable-key.test.mjs +6 -6
  92. package/dist/sig/proof.test.mjs +161 -3
  93. package/dist/sig/tootik-request-interop.test.d.mts +2 -0
  94. package/dist/sig/tootik-request-interop.test.mjs +190 -0
  95. package/dist/sig/tootik-send-interop.test.d.mts +2 -0
  96. package/dist/sig/tootik-send-interop.test.mjs +331 -0
  97. package/dist/sig/verification.test.d.mts +2 -0
  98. package/dist/sig/verification.test.mjs +310 -0
  99. package/dist/{temporal-CBVv0xRB.mjs → temporal-BRFH_dte.mjs} +1 -1
  100. package/dist/testing/kv.test.mjs +1 -1
  101. package/dist/testing/mod.d.mts +315 -28
  102. package/dist/utils/docloader.test.mjs +2 -2
  103. package/dist/utils/kv-cache.test.mjs +1 -1
  104. package/dist/utils/mod.cjs +1 -1
  105. package/dist/utils/mod.d.cts +1 -1
  106. package/dist/utils/mod.d.ts +1 -1
  107. package/dist/utils/mod.js +1 -1
  108. package/dist/verification-C3954hQh.mjs +5 -0
  109. package/dist/verification-Dpfcw8ml.mjs +105 -0
  110. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-B0RRI88k.mjs";
4
+ import { n as FederationImpl } from "./middleware-CkjwiEBd.mjs";
5
5
  export { FederationImpl };
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-B6X-t8gI.cjs";
2
+ import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-tsYPJ2Ew.cjs";
3
3
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
4
4
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
5
5
 
@@ -1,8 +1,8 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { S as KeyCache } from "./http-DGx0KOws.js";
3
- import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
2
+ import { B as VerifyPortableObjectProofOptions, a as KeyCache, v as VerificationObservationOptions, z as VerifyPortableObjectProofFailureReason } from "./key-DYxuyd-s.cjs";
3
+ import { CryptographicKey, Multikey } from "@fedify/vocab";
4
+ import { DocumentLoader, PortableObjectVerifierOptions } from "@fedify/vocab-runtime";
4
5
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
5
- import { DocumentLoader, PortableObjectVerifier, PortableObjectVerifierOptions } from "@fedify/vocab-runtime";
6
6
 
7
7
  //#region src/sig/ld.d.ts
8
8
  /**
@@ -108,7 +108,7 @@ declare function detachSignature(jsonLd: unknown): unknown;
108
108
  * Options for verifying Linked Data Signatures.
109
109
  * @since 1.0.0
110
110
  */
111
- interface VerifySignatureOptions {
111
+ interface VerifySignatureOptions extends VerificationObservationOptions {
112
112
  /**
113
113
  * The document loader to use for fetching the public key.
114
114
  */
@@ -169,254 +169,6 @@ interface VerifyJsonLdOptions extends VerifySignatureOptions {}
169
169
  */
170
170
  declare function verifyJsonLd(jsonLd: unknown, options?: VerifyJsonLdOptions): Promise<boolean>;
171
171
  //#endregion
172
- //#region src/sig/proof.d.ts
173
- /**
174
- * Checks if the given JSON-LD document has a DataIntegrityProof-like object,
175
- * without fully deserializing it into vocabulary classes.
176
- * @param jsonLd The JSON-LD document to check.
177
- * @returns `true` if the document has a proof-like object; `false` otherwise.
178
- * @since 2.2.0
179
- */
180
- declare function hasProofLike(jsonLd: unknown): boolean;
181
- /**
182
- * Options for {@link createProof}.
183
- * @since 0.10.0
184
- */
185
- interface CreateProofOptions {
186
- /**
187
- * The context loader for loading remote JSON-LD contexts.
188
- */
189
- contextLoader?: DocumentLoader;
190
- /**
191
- * The JSON-LD context to use for serializing the object to sign.
192
- */
193
- context?: string | Record<string, string> | (string | Record<string, string>)[];
194
- /**
195
- * The time when the proof was created. If not specified, the current time
196
- * will be used.
197
- */
198
- created?: Temporal.Instant;
199
- }
200
- /**
201
- * Creates a proof for the given object.
202
- * @param object The object to create a proof for.
203
- * @param privateKey The private key to sign the proof with.
204
- * @param keyId The key ID to use in the proof. It will be used by the verifier.
205
- * @param options Additional options. See also {@link CreateProofOptions}.
206
- * @returns The created proof.
207
- * @throws {TypeError} If the private key is invalid or unsupported.
208
- * @since 0.10.0
209
- */
210
- declare function createProof(object: Object$1, privateKey: CryptoKey, keyId: URL, options?: CreateProofOptions): Promise<DataIntegrityProof>;
211
- /**
212
- * Options for {@link signObject}.
213
- * @since 0.10.0
214
- */
215
- interface SignObjectOptions extends CreateProofOptions {
216
- /**
217
- * The document loader for loading remote JSON-LD documents.
218
- */
219
- documentLoader?: DocumentLoader;
220
- /**
221
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
222
- * is used.
223
- * @since 1.3.0
224
- */
225
- tracerProvider?: TracerProvider;
226
- }
227
- /**
228
- * Signs the given object with the private key and returns the signed object.
229
- * @param object The object to create a proof for.
230
- * @param privateKey The private key to sign the proof with.
231
- * @param keyId The key ID to use in the proof. It will be used by the verifier.
232
- * @param options Additional options. See also {@link SignObjectOptions}.
233
- * @returns The signed object.
234
- * @throws {TypeError} If the private key is invalid or unsupported.
235
- * @since 0.10.0
236
- */
237
- declare function signObject<T extends Object$1>(object: T, privateKey: CryptoKey, keyId: URL, options?: SignObjectOptions): Promise<T>;
238
- /**
239
- * Options for {@link verifyProof}.
240
- * @since 0.10.0
241
- */
242
- interface VerifyProofOptions {
243
- /**
244
- * The security domain expected by the verifier. When specified, it must
245
- * contain the same strings as the proof's `domain` option.
246
- * @since 2.4.0
247
- */
248
- domain?: string | readonly string[];
249
- /**
250
- * The challenge expected by the verifier. When specified, it must exactly
251
- * match the proof's `challenge` option.
252
- * @since 2.4.0
253
- */
254
- challenge?: string;
255
- /**
256
- * The context loader for loading remote JSON-LD contexts.
257
- */
258
- contextLoader?: DocumentLoader;
259
- /**
260
- * The document loader for loading remote JSON-LD documents.
261
- */
262
- documentLoader?: DocumentLoader;
263
- /**
264
- * The key cache to use for caching public keys.
265
- * @since 0.12.0
266
- */
267
- keyCache?: KeyCache;
268
- /**
269
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
270
- * is used.
271
- * @since 1.3.0
272
- */
273
- tracerProvider?: TracerProvider;
274
- /**
275
- * The OpenTelemetry meter provider. If omitted, the global meter provider
276
- * is used.
277
- * @since 2.3.0
278
- */
279
- meterProvider?: MeterProvider;
280
- }
281
- /**
282
- * Options for {@link verifyPortableObjectProof}.
283
- * @since 2.4.0
284
- */
285
- interface VerifyPortableObjectProofOptions extends VerifyProofOptions {}
286
- /**
287
- * The reason why {@link verifyPortableObjectProof} could not verify a portable
288
- * object proof.
289
- * @since 2.4.0
290
- */
291
- type VerifyPortableObjectProofFailureReason = {
292
- /**
293
- * The document has neither a portable `ap:` or `ap+ef61:` ID nor an
294
- * FEP-ef61 compatible identifier.
295
- */
296
- readonly type: "notPortableObject";
297
- } | {
298
- /**
299
- * The document is a portable collection without an Object Integrity
300
- * Proof. Its trust policy is outside this verifier.
301
- */
302
- readonly type: "unsecuredCollection";
303
- } | {
304
- /** The portable document is a core type outside FEP-ef61 proof policy. */readonly type: "unsupportedObjectType"; /** The FEP-2277 core type of the document. */
305
- readonly objectType: "verificationMethod" | "publicKey" | "link";
306
- } | {
307
- /** A portable actor, activity, or object has no proof. */readonly type: "missingProof";
308
- } | {
309
- /**
310
- * A portable actor's `gateways` is missing or empty, or has an item that
311
- * is not an HTTP(S) URI with an empty path, query, and fragment.
312
- * The document is rejected before its proofs are verified, so this
313
- * reason does not mean that the proofs are valid.
314
- */
315
- readonly type: "invalidGateways";
316
- } | {
317
- /** The proof is malformed, unsupported, or cryptographically invalid. */readonly type: "invalidProof"; /** The zero-based index of the invalid proof. */
318
- readonly proofIndex: number;
319
- } | {
320
- /** The proof's verification method is not a valid DID URL. */readonly type: "unsupportedVerificationMethod"; /** The zero-based index of the proof. */
321
- readonly proofIndex: number; /** The unsupported verification method. */
322
- readonly verificationMethod: URL;
323
- } | {
324
- /** The verification method DID does not match the portable ID authority. */readonly type: "verificationMethodMismatch"; /** The zero-based index of the proof. */
325
- readonly proofIndex: number; /** The portable object ID. */
326
- readonly objectId: URL; /** The mismatching verification method. */
327
- readonly verificationMethod: URL;
328
- };
329
- /**
330
- * The detailed result of {@link verifyPortableObjectProof}.
331
- * @since 2.4.0
332
- */
333
- type VerifyPortableObjectProofResult = {
334
- /** Whether every Object Integrity Proof was verified. */readonly verified: true; /** The public keys used by the verified proofs, in proof order. */
335
- readonly keys: readonly Multikey[];
336
- } | {
337
- /** Whether every Object Integrity Proof was verified. */readonly verified: false; /** Why portable proof verification did not succeed. */
338
- readonly reason: VerifyPortableObjectProofFailureReason;
339
- };
340
- /**
341
- * Verifies the given proof for the object.
342
- * @param jsonLd The JSON-LD object to verify the proof for. Its proof
343
- * properties are excluded from the message, but matching proof
344
- * occurrences are used to authenticate the received proof
345
- * configuration.
346
- * @param proof The proof to verify.
347
- * @param options Additional options. See also {@link VerifyProofOptions}.
348
- * @returns The public key that was used to sign the proof, or `null` if the
349
- * proof is invalid.
350
- * @since 0.10.0
351
- * @since 2.4.0 Matching proof configurations are authenticated.
352
- */
353
- declare function verifyProof(jsonLd: unknown, proof: DataIntegrityProof, options?: VerifyProofOptions): Promise<Multikey | null>;
354
- /**
355
- * Verifies the FEP-ef61 Object Integrity Proof policy for a portable object.
356
- *
357
- * This applies the FEP-2277 core-type classification to the top-level JSON-LD
358
- * node. Portable actors, activities, and objects require proofs. A portable
359
- * collection without a proof is reported separately so a caller can apply a
360
- * gateway trust policy. Embedded portable objects are not traversed.
361
- *
362
- * A portable object is a document whose ID is an `ap:` or `ap+ef61:` URI, or
363
- * an [FEP-ef61] compatible identifier such as
364
- * `https://gw.example/.well-known/apgateway/did:key:z6Mk…/actor`, which
365
- * stands for the portable ID `ap+ef61://did:key:z6Mk…/actor`.
366
- *
367
- * Every proof must use a DID URL whose DID matches the portable object's
368
- * authority, i.e., the DID of its canonical portable ID, and every proof must
369
- * pass {@link verifyProof}. A portable actor must also have a non-empty
370
- * `gateways` list whose items are all HTTP(S) URIs with an empty path, query,
371
- * and fragment; otherwise, it is rejected with the `invalidGateways` reason
372
- * before its proofs are verified. The proofs are verified over the document as
373
- * given; a compatible identifier is never rewritten into a portable ID.
374
- *
375
- * [FEP-ef61]: https://w3id.org/fep/ef61
376
- *
377
- * @param jsonLd The JSON-LD document to verify.
378
- * @param options Additional options. See also
379
- * {@link VerifyPortableObjectProofOptions}.
380
- * @returns The detailed portable proof-policy result.
381
- * @throws {TypeError} If the input is not a single JSON-LD object or has a
382
- * malformed portable ID or compatible identifier.
383
- * @since 2.4.0
384
- */
385
- declare function verifyPortableObjectProof(jsonLd: unknown, options?: VerifyPortableObjectProofOptions): Promise<VerifyPortableObjectProofResult>;
386
- /**
387
- * Options for {@link verifyObject}.
388
- * @since 0.10.0
389
- */
390
- interface VerifyObjectOptions extends VerifyProofOptions {
391
- /**
392
- * The default [FEP-ef61] portable object verifier for the property
393
- * accessors of the returned object and the objects obtained from it, e.g.,
394
- * `Context.verifyPortableObject`. It is not used to verify the given
395
- * object itself.
396
- *
397
- * [FEP-ef61]: https://w3id.org/fep/ef61
398
- * @since 2.4.0
399
- */
400
- verifyPortableObject?: PortableObjectVerifier;
401
- }
402
- /**
403
- * Verifies the given object. It will verify all the proofs in the object,
404
- * and succeed only if all the proofs are valid and all attributions and
405
- * actors are authenticated by the proofs.
406
- * @template T The type of the object to verify.
407
- * @param cls The class of the object to verify. It must be a subclass of
408
- * the {@link Object}.
409
- * @param jsonLd The JSON-LD object to verify. It's assumed that the object
410
- * is a compacted JSON-LD representation of a `T` with `@context`.
411
- * @param options Additional options. See also {@link VerifyObjectOptions}.
412
- * @returns The object if it's verified, or `null` if it's not.
413
- * @throws {TypeError} If the object is invalid or unsupported.
414
- * @since 0.10.0
415
- */
416
- declare function verifyObject<T extends Object$1>(cls: (new (...args: any[]) => T) & {
417
- fromJsonLd(jsonLd: unknown, options: VerifyObjectOptions): Promise<T>;
418
- }, jsonLd: unknown, options?: VerifyObjectOptions): Promise<T | null>;
419
- //#endregion
420
172
  //#region src/sig/portable-collection.d.ts
421
173
  /**
422
174
  * Options for {@link verifyPortableObject}.
@@ -565,4 +317,4 @@ type VerifyPortableObjectResult = {
565
317
  */
566
318
  declare function verifyPortableObject(jsonLd: unknown, options?: VerifyPortableObjectOptions): Promise<VerifyPortableObjectResult>;
567
319
  //#endregion
568
- export { createSignature as C, verifyJsonLd as D, signJsonLd as E, verifySignature as O, attachSignature as S, hasSignatureLike as T, verifyProof as _, CreateProofOptions as a, VerifyJsonLdOptions as b, VerifyPortableObjectProofFailureReason as c, VerifyProofOptions as d, createProof as f, verifyPortableObjectProof as g, verifyObject as h, verifyPortableObject as i, VerifyPortableObjectProofOptions as l, signObject as m, VerifyPortableObjectOptions as n, SignObjectOptions as o, hasProofLike as p, VerifyPortableObjectResult as r, VerifyObjectOptions as s, VerifyPortableObjectFailureReason as t, VerifyPortableObjectProofResult as u, CreateSignatureOptions as v, detachSignature as w, VerifySignatureOptions as x, SignJsonLdOptions as y };
320
+ export { CreateSignatureOptions as a, VerifySignatureOptions as c, detachSignature as d, hasSignatureLike as f, verifySignature as h, verifyPortableObject as i, attachSignature as l, verifyJsonLd as m, VerifyPortableObjectOptions as n, SignJsonLdOptions as o, signJsonLd as p, VerifyPortableObjectResult as r, VerifyJsonLdOptions as s, VerifyPortableObjectFailureReason as t, createSignature as u };
@@ -1,8 +1,8 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { S as KeyCache } from "./http-BrwKINQn.cjs";
3
- import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
4
- import { DocumentLoader, PortableObjectVerifier, PortableObjectVerifierOptions } from "@fedify/vocab-runtime";
2
+ import { B as VerifyPortableObjectProofOptions, a as KeyCache, v as VerificationObservationOptions, z as VerifyPortableObjectProofFailureReason } from "./key-C1nv7_jD.js";
3
+ import { CryptographicKey, Multikey } from "@fedify/vocab";
5
4
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
5
+ import { DocumentLoader, PortableObjectVerifierOptions } from "@fedify/vocab-runtime";
6
6
 
7
7
  //#region src/sig/ld.d.ts
8
8
  /**
@@ -108,7 +108,7 @@ declare function detachSignature(jsonLd: unknown): unknown;
108
108
  * Options for verifying Linked Data Signatures.
109
109
  * @since 1.0.0
110
110
  */
111
- interface VerifySignatureOptions {
111
+ interface VerifySignatureOptions extends VerificationObservationOptions {
112
112
  /**
113
113
  * The document loader to use for fetching the public key.
114
114
  */
@@ -169,254 +169,6 @@ interface VerifyJsonLdOptions extends VerifySignatureOptions {}
169
169
  */
170
170
  declare function verifyJsonLd(jsonLd: unknown, options?: VerifyJsonLdOptions): Promise<boolean>;
171
171
  //#endregion
172
- //#region src/sig/proof.d.ts
173
- /**
174
- * Checks if the given JSON-LD document has a DataIntegrityProof-like object,
175
- * without fully deserializing it into vocabulary classes.
176
- * @param jsonLd The JSON-LD document to check.
177
- * @returns `true` if the document has a proof-like object; `false` otherwise.
178
- * @since 2.2.0
179
- */
180
- declare function hasProofLike(jsonLd: unknown): boolean;
181
- /**
182
- * Options for {@link createProof}.
183
- * @since 0.10.0
184
- */
185
- interface CreateProofOptions {
186
- /**
187
- * The context loader for loading remote JSON-LD contexts.
188
- */
189
- contextLoader?: DocumentLoader;
190
- /**
191
- * The JSON-LD context to use for serializing the object to sign.
192
- */
193
- context?: string | Record<string, string> | (string | Record<string, string>)[];
194
- /**
195
- * The time when the proof was created. If not specified, the current time
196
- * will be used.
197
- */
198
- created?: Temporal.Instant;
199
- }
200
- /**
201
- * Creates a proof for the given object.
202
- * @param object The object to create a proof for.
203
- * @param privateKey The private key to sign the proof with.
204
- * @param keyId The key ID to use in the proof. It will be used by the verifier.
205
- * @param options Additional options. See also {@link CreateProofOptions}.
206
- * @returns The created proof.
207
- * @throws {TypeError} If the private key is invalid or unsupported.
208
- * @since 0.10.0
209
- */
210
- declare function createProof(object: Object$1, privateKey: CryptoKey, keyId: URL, options?: CreateProofOptions): Promise<DataIntegrityProof>;
211
- /**
212
- * Options for {@link signObject}.
213
- * @since 0.10.0
214
- */
215
- interface SignObjectOptions extends CreateProofOptions {
216
- /**
217
- * The document loader for loading remote JSON-LD documents.
218
- */
219
- documentLoader?: DocumentLoader;
220
- /**
221
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
222
- * is used.
223
- * @since 1.3.0
224
- */
225
- tracerProvider?: TracerProvider;
226
- }
227
- /**
228
- * Signs the given object with the private key and returns the signed object.
229
- * @param object The object to create a proof for.
230
- * @param privateKey The private key to sign the proof with.
231
- * @param keyId The key ID to use in the proof. It will be used by the verifier.
232
- * @param options Additional options. See also {@link SignObjectOptions}.
233
- * @returns The signed object.
234
- * @throws {TypeError} If the private key is invalid or unsupported.
235
- * @since 0.10.0
236
- */
237
- declare function signObject<T extends Object$1>(object: T, privateKey: CryptoKey, keyId: URL, options?: SignObjectOptions): Promise<T>;
238
- /**
239
- * Options for {@link verifyProof}.
240
- * @since 0.10.0
241
- */
242
- interface VerifyProofOptions {
243
- /**
244
- * The security domain expected by the verifier. When specified, it must
245
- * contain the same strings as the proof's `domain` option.
246
- * @since 2.4.0
247
- */
248
- domain?: string | readonly string[];
249
- /**
250
- * The challenge expected by the verifier. When specified, it must exactly
251
- * match the proof's `challenge` option.
252
- * @since 2.4.0
253
- */
254
- challenge?: string;
255
- /**
256
- * The context loader for loading remote JSON-LD contexts.
257
- */
258
- contextLoader?: DocumentLoader;
259
- /**
260
- * The document loader for loading remote JSON-LD documents.
261
- */
262
- documentLoader?: DocumentLoader;
263
- /**
264
- * The key cache to use for caching public keys.
265
- * @since 0.12.0
266
- */
267
- keyCache?: KeyCache;
268
- /**
269
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
270
- * is used.
271
- * @since 1.3.0
272
- */
273
- tracerProvider?: TracerProvider;
274
- /**
275
- * The OpenTelemetry meter provider. If omitted, the global meter provider
276
- * is used.
277
- * @since 2.3.0
278
- */
279
- meterProvider?: MeterProvider;
280
- }
281
- /**
282
- * Options for {@link verifyPortableObjectProof}.
283
- * @since 2.4.0
284
- */
285
- interface VerifyPortableObjectProofOptions extends VerifyProofOptions {}
286
- /**
287
- * The reason why {@link verifyPortableObjectProof} could not verify a portable
288
- * object proof.
289
- * @since 2.4.0
290
- */
291
- type VerifyPortableObjectProofFailureReason = {
292
- /**
293
- * The document has neither a portable `ap:` or `ap+ef61:` ID nor an
294
- * FEP-ef61 compatible identifier.
295
- */
296
- readonly type: "notPortableObject";
297
- } | {
298
- /**
299
- * The document is a portable collection without an Object Integrity
300
- * Proof. Its trust policy is outside this verifier.
301
- */
302
- readonly type: "unsecuredCollection";
303
- } | {
304
- /** The portable document is a core type outside FEP-ef61 proof policy. */readonly type: "unsupportedObjectType"; /** The FEP-2277 core type of the document. */
305
- readonly objectType: "verificationMethod" | "publicKey" | "link";
306
- } | {
307
- /** A portable actor, activity, or object has no proof. */readonly type: "missingProof";
308
- } | {
309
- /**
310
- * A portable actor's `gateways` is missing or empty, or has an item that
311
- * is not an HTTP(S) URI with an empty path, query, and fragment.
312
- * The document is rejected before its proofs are verified, so this
313
- * reason does not mean that the proofs are valid.
314
- */
315
- readonly type: "invalidGateways";
316
- } | {
317
- /** The proof is malformed, unsupported, or cryptographically invalid. */readonly type: "invalidProof"; /** The zero-based index of the invalid proof. */
318
- readonly proofIndex: number;
319
- } | {
320
- /** The proof's verification method is not a valid DID URL. */readonly type: "unsupportedVerificationMethod"; /** The zero-based index of the proof. */
321
- readonly proofIndex: number; /** The unsupported verification method. */
322
- readonly verificationMethod: URL;
323
- } | {
324
- /** The verification method DID does not match the portable ID authority. */readonly type: "verificationMethodMismatch"; /** The zero-based index of the proof. */
325
- readonly proofIndex: number; /** The portable object ID. */
326
- readonly objectId: URL; /** The mismatching verification method. */
327
- readonly verificationMethod: URL;
328
- };
329
- /**
330
- * The detailed result of {@link verifyPortableObjectProof}.
331
- * @since 2.4.0
332
- */
333
- type VerifyPortableObjectProofResult = {
334
- /** Whether every Object Integrity Proof was verified. */readonly verified: true; /** The public keys used by the verified proofs, in proof order. */
335
- readonly keys: readonly Multikey[];
336
- } | {
337
- /** Whether every Object Integrity Proof was verified. */readonly verified: false; /** Why portable proof verification did not succeed. */
338
- readonly reason: VerifyPortableObjectProofFailureReason;
339
- };
340
- /**
341
- * Verifies the given proof for the object.
342
- * @param jsonLd The JSON-LD object to verify the proof for. Its proof
343
- * properties are excluded from the message, but matching proof
344
- * occurrences are used to authenticate the received proof
345
- * configuration.
346
- * @param proof The proof to verify.
347
- * @param options Additional options. See also {@link VerifyProofOptions}.
348
- * @returns The public key that was used to sign the proof, or `null` if the
349
- * proof is invalid.
350
- * @since 0.10.0
351
- * @since 2.4.0 Matching proof configurations are authenticated.
352
- */
353
- declare function verifyProof(jsonLd: unknown, proof: DataIntegrityProof, options?: VerifyProofOptions): Promise<Multikey | null>;
354
- /**
355
- * Verifies the FEP-ef61 Object Integrity Proof policy for a portable object.
356
- *
357
- * This applies the FEP-2277 core-type classification to the top-level JSON-LD
358
- * node. Portable actors, activities, and objects require proofs. A portable
359
- * collection without a proof is reported separately so a caller can apply a
360
- * gateway trust policy. Embedded portable objects are not traversed.
361
- *
362
- * A portable object is a document whose ID is an `ap:` or `ap+ef61:` URI, or
363
- * an [FEP-ef61] compatible identifier such as
364
- * `https://gw.example/.well-known/apgateway/did:key:z6Mk…/actor`, which
365
- * stands for the portable ID `ap+ef61://did:key:z6Mk…/actor`.
366
- *
367
- * Every proof must use a DID URL whose DID matches the portable object's
368
- * authority, i.e., the DID of its canonical portable ID, and every proof must
369
- * pass {@link verifyProof}. A portable actor must also have a non-empty
370
- * `gateways` list whose items are all HTTP(S) URIs with an empty path, query,
371
- * and fragment; otherwise, it is rejected with the `invalidGateways` reason
372
- * before its proofs are verified. The proofs are verified over the document as
373
- * given; a compatible identifier is never rewritten into a portable ID.
374
- *
375
- * [FEP-ef61]: https://w3id.org/fep/ef61
376
- *
377
- * @param jsonLd The JSON-LD document to verify.
378
- * @param options Additional options. See also
379
- * {@link VerifyPortableObjectProofOptions}.
380
- * @returns The detailed portable proof-policy result.
381
- * @throws {TypeError} If the input is not a single JSON-LD object or has a
382
- * malformed portable ID or compatible identifier.
383
- * @since 2.4.0
384
- */
385
- declare function verifyPortableObjectProof(jsonLd: unknown, options?: VerifyPortableObjectProofOptions): Promise<VerifyPortableObjectProofResult>;
386
- /**
387
- * Options for {@link verifyObject}.
388
- * @since 0.10.0
389
- */
390
- interface VerifyObjectOptions extends VerifyProofOptions {
391
- /**
392
- * The default [FEP-ef61] portable object verifier for the property
393
- * accessors of the returned object and the objects obtained from it, e.g.,
394
- * `Context.verifyPortableObject`. It is not used to verify the given
395
- * object itself.
396
- *
397
- * [FEP-ef61]: https://w3id.org/fep/ef61
398
- * @since 2.4.0
399
- */
400
- verifyPortableObject?: PortableObjectVerifier;
401
- }
402
- /**
403
- * Verifies the given object. It will verify all the proofs in the object,
404
- * and succeed only if all the proofs are valid and all attributions and
405
- * actors are authenticated by the proofs.
406
- * @template T The type of the object to verify.
407
- * @param cls The class of the object to verify. It must be a subclass of
408
- * the {@link Object}.
409
- * @param jsonLd The JSON-LD object to verify. It's assumed that the object
410
- * is a compacted JSON-LD representation of a `T` with `@context`.
411
- * @param options Additional options. See also {@link VerifyObjectOptions}.
412
- * @returns The object if it's verified, or `null` if it's not.
413
- * @throws {TypeError} If the object is invalid or unsupported.
414
- * @since 0.10.0
415
- */
416
- declare function verifyObject<T extends Object$1>(cls: (new (...args: any[]) => T) & {
417
- fromJsonLd(jsonLd: unknown, options: VerifyObjectOptions): Promise<T>;
418
- }, jsonLd: unknown, options?: VerifyObjectOptions): Promise<T | null>;
419
- //#endregion
420
172
  //#region src/sig/portable-collection.d.ts
421
173
  /**
422
174
  * Options for {@link verifyPortableObject}.
@@ -565,4 +317,4 @@ type VerifyPortableObjectResult = {
565
317
  */
566
318
  declare function verifyPortableObject(jsonLd: unknown, options?: VerifyPortableObjectOptions): Promise<VerifyPortableObjectResult>;
567
319
  //#endregion
568
- export { createSignature as C, verifyJsonLd as D, signJsonLd as E, verifySignature as O, attachSignature as S, hasSignatureLike as T, verifyProof as _, CreateProofOptions as a, VerifyJsonLdOptions as b, VerifyPortableObjectProofFailureReason as c, VerifyProofOptions as d, createProof as f, verifyPortableObjectProof as g, verifyObject as h, verifyPortableObject as i, VerifyPortableObjectProofOptions as l, signObject as m, VerifyPortableObjectOptions as n, SignObjectOptions as o, hasProofLike as p, VerifyPortableObjectResult as r, VerifyObjectOptions as s, VerifyPortableObjectFailureReason as t, VerifyPortableObjectProofResult as u, CreateSignatureOptions as v, detachSignature as w, VerifySignatureOptions as x, SignJsonLdOptions as y };
320
+ export { CreateSignatureOptions as a, VerifySignatureOptions as c, detachSignature as d, hasSignatureLike as f, verifySignature as h, verifyPortableObject as i, attachSignature as l, verifyJsonLd as m, VerifyPortableObjectOptions as n, SignJsonLdOptions as o, signJsonLd as p, VerifyPortableObjectResult as r, VerifyJsonLdOptions as s, VerifyPortableObjectFailureReason as t, createSignature as u };
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-DGx0KOws.js";
2
+ import { b as HttpMessageSignaturesSpecDeterminer } from "./key-C1nv7_jD.js";
3
3
  import { n as KvStore, t as KvKey } from "./kv-B2mzK5tl.js";
4
4
  import { t as DocumentFetchKind } from "./metrics-DoRtI0qU.js";
5
5
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-BrwKINQn.cjs";
2
+ import { b as HttpMessageSignaturesSpecDeterminer } from "./key-DYxuyd-s.cjs";
3
3
  import { n as KvStore, t as KvKey } from "./kv-B2mzK5tl.cjs";
4
4
  import { t as DocumentFetchKind } from "./metrics-DVKYY6K1.cjs";
5
5
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-CtI307_A.js";
2
+ import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-7NyiqIcg.js";
3
3
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
4
4
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
5
5
 
package/dist/mod.cjs CHANGED
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./rolldown-runtime-Dmm3t92W.cjs");
4
4
  const require_transformers = require("./transformers-BalCrSsr.cjs");
5
5
  require("./compat/mod.cjs");
6
- const require_http = require("./http-Bp0MKAK3.cjs");
7
- const require_federation = require("./federation-B858-Ylk.cjs");
6
+ const require_http = require("./http-Cki-npuA.cjs");
7
+ const require_federation = require("./federation-D6giSGUT.cjs");
8
8
  const require_types = require("./types-poIao40f.cjs");
9
- const require_portable_collection = require("./portable-collection-DhEA_nWT.cjs");
10
- const require_kv_cache = require("./kv-cache-BnWemxH2.cjs");
9
+ const require_portable_collection = require("./portable-collection-DqTUBKY7.cjs");
10
+ const require_kv_cache = require("./kv-cache-D73yVcE5.cjs");
11
11
  require("./nodeinfo/mod.cjs");
12
12
  require("./runtime/mod.cjs");
13
13
  require("./sig/mod.cjs");