@fedify/fedify 1.9.0-pr.387.1423 → 1.9.0-pr.388.1456

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 (87) hide show
  1. package/README.md +18 -14
  2. package/dist/{actor-DUaSUqb5.js → actor-Bj4E2JRg.js} +1 -1
  3. package/dist/{actor-BQmgYclf.js → actor-DEUcppZT.js} +187 -187
  4. package/dist/{authdocloader-DXJhK0Kr.js → authdocloader-CmFtuaWu.js} +3 -3
  5. package/dist/{authdocloader-BZn07D4c.js → authdocloader-Dx6uHSEc.js} +3 -3
  6. package/dist/{builder-WOmlWRLq.js → builder-CxPGY_jN.js} +4 -4
  7. package/dist/{client-BBArfMe1.js → client-iVnypF2y.js} +1 -1
  8. package/dist/compat/transformers.test.js +16 -16
  9. package/dist/{denokv-2x6-IpXO.js → denokv-C-wcHaX0.js} +4 -0
  10. package/dist/{docloader-CWkHs9uk.js → docloader-dcX6wT70.js} +2 -2
  11. package/dist/{esm-BPIGCIPl.js → esm-BczgbYY7.js} +1 -1
  12. package/dist/federation/builder.test.js +5 -5
  13. package/dist/federation/collection.test.js +3 -3
  14. package/dist/federation/handler.test.js +17 -17
  15. package/dist/federation/inbox.test.js +4 -4
  16. package/dist/federation/keycache.test.js +4 -4
  17. package/dist/federation/kv.test.js +3 -3
  18. package/dist/federation/middleware.test.js +18 -18
  19. package/dist/federation/mod.js +10 -10
  20. package/dist/federation/mq.test.js +5 -5
  21. package/dist/federation/retry.test.js +3 -3
  22. package/dist/federation/router.test.js +3 -3
  23. package/dist/federation/send.test.js +10 -10
  24. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +24 -0
  25. package/dist/{http-DFX1Uz6Q.js → http-BgBStUQn.js} +50 -4
  26. package/dist/{http-CVEhR0GX.js → http-DLDZw5Or.js} +51 -5
  27. package/dist/{inbox-CvdfJsr4.js → inbox-DdQaBIzA.js} +1 -1
  28. package/dist/{key-DJH_wh0D.js → key-BRTdSnMG.js} +3 -3
  29. package/dist/{key-CbmNnbO0.js → key-BgPXFh5H.js} +2 -2
  30. package/dist/{key-D7-bV4Xg.js → key-Bogxf4NW.js} +2 -2
  31. package/dist/{key-zYGyf1nv.js → key-C_wDZpcY.js} +4 -4
  32. package/dist/{keycache-CE1T-kF7.js → keycache-C4SeJJRt.js} +1 -1
  33. package/dist/{keys-zgjXdnwi.js → keys-BaR7xMh1.js} +1 -1
  34. package/dist/{ld-BIHHWSg3.js → ld-B3_WG7GN.js} +2 -2
  35. package/dist/{lookup-D7mhJunn.js → lookup-DYiszLvp.js} +1 -1
  36. package/dist/{lookup-Da6Ndr93.js → lookup-Dpul0cUe.js} +1 -1
  37. package/dist/{middleware-D9T3H7Lc.js → middleware-BkT88swb.js} +13 -13
  38. package/dist/middleware-GyK1UpCo.js +17 -0
  39. package/dist/middleware-WfGCcPDI.js +26 -0
  40. package/dist/{middleware-BQQ98Smk.js → middleware-hKurpsy6.js} +10 -10
  41. package/dist/mod.js +10 -10
  42. package/dist/nodeinfo/client.test.js +5 -5
  43. package/dist/nodeinfo/handler.test.js +16 -16
  44. package/dist/nodeinfo/mod.js +2 -2
  45. package/dist/nodeinfo/semver.test.js +3 -3
  46. package/dist/nodeinfo/types.test.js +3 -3
  47. package/dist/{owner-C_xbpZKr.js → owner-DBEblO3I.js} +2 -2
  48. package/dist/{proof-DFrbEuMh.js → proof-Zk7ECIIN.js} +2 -2
  49. package/dist/{proof-CqSkPg1W.js → proof-e2T8mSSn.js} +3 -3
  50. package/dist/runtime/authdocloader.test.js +9 -9
  51. package/dist/runtime/docloader.test.js +28 -4
  52. package/dist/runtime/key.test.js +5 -5
  53. package/dist/runtime/langstr.test.js +3 -3
  54. package/dist/runtime/mod.js +6 -6
  55. package/dist/runtime/multibase/multibase.test.js +3 -3
  56. package/dist/runtime/url.test.js +3 -3
  57. package/dist/{send-BpWvSj7e.js → send-DiNom3JD.js} +2 -2
  58. package/dist/sig/http.test.js +24 -8
  59. package/dist/sig/key.test.js +6 -6
  60. package/dist/sig/ld.test.js +7 -7
  61. package/dist/sig/mod.js +6 -6
  62. package/dist/sig/owner.test.js +7 -7
  63. package/dist/sig/proof.test.js +7 -7
  64. package/dist/testing/docloader.test.js +3 -3
  65. package/dist/testing/mod.js +3 -3
  66. package/dist/{testing-na6lpilo.js → testing-oIthntGQ.js} +2 -2
  67. package/dist/{type-Bo8yJ-US.js → type-aO0QESjd.js} +187 -187
  68. package/dist/{types-CsDgJZle.js → types-DlmitN02.js} +1 -1
  69. package/dist/vocab/actor.test.js +5 -5
  70. package/dist/vocab/lookup.test.js +4 -4
  71. package/dist/vocab/mod.js +4 -4
  72. package/dist/vocab/type.test.js +3 -3
  73. package/dist/vocab/vocab.test.js +4 -4
  74. package/dist/{vocab-DjEvVueF.js → vocab-Drpu6tmF.js} +3 -3
  75. package/dist/webfinger/handler.test.js +16 -16
  76. package/dist/webfinger/lookup.test.js +4 -4
  77. package/dist/webfinger/mod.js +2 -2
  78. package/dist/x/cfworkers.d.ts +8 -0
  79. package/dist/x/cfworkers.js +8 -0
  80. package/dist/x/cfworkers.test.js +11 -3
  81. package/dist/x/hono.d.ts +8 -0
  82. package/dist/x/hono.js +4 -0
  83. package/dist/x/sveltekit.d.ts +4 -0
  84. package/dist/x/sveltekit.js +4 -0
  85. package/package.json +1 -1
  86. package/dist/middleware-BGn_or6S.js +0 -26
  87. package/dist/middleware-STzvYJ0Y.js +0 -17
@@ -2,9 +2,9 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-CWkHs9uk.js";
6
- import { validateCryptoKey } from "./key-CbmNnbO0.js";
7
- import { doubleKnock } from "./http-CVEhR0GX.js";
5
+ import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-dcX6wT70.js";
6
+ import { validateCryptoKey } from "./key-BgPXFh5H.js";
7
+ import { doubleKnock } from "./http-DLDZw5Or.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
 
10
10
  //#region src/runtime/authdocloader.ts
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-Bo8yJ-US.js";
7
- import { validateCryptoKey } from "./key-D7-bV4Xg.js";
8
- import { doubleKnock } from "./http-DFX1Uz6Q.js";
6
+ import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-aO0QESjd.js";
7
+ import { validateCryptoKey } from "./key-Bogxf4NW.js";
8
+ import { doubleKnock } from "./http-BgBStUQn.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
 
11
11
  //#region src/runtime/authdocloader.ts
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default, getTypeId } from "./type-Bo8yJ-US.js";
7
- import { Router, RouterError } from "./lookup-Da6Ndr93.js";
8
- import { InboxListenerSet } from "./inbox-CvdfJsr4.js";
6
+ import { deno_default, getTypeId } from "./type-aO0QESjd.js";
7
+ import { Router, RouterError } from "./lookup-Dpul0cUe.js";
8
+ import { InboxListenerSet } from "./inbox-DdQaBIzA.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
11
11
 
@@ -41,7 +41,7 @@ var FederationBuilderImpl = class {
41
41
  this.collectionTypeIds = {};
42
42
  }
43
43
  async build(options) {
44
- const { FederationImpl } = await import("./middleware-BGn_or6S.js");
44
+ const { FederationImpl } = await import("./middleware-WfGCcPDI.js");
45
45
  const f = new FederationImpl(options);
46
46
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
47
47
  f.router = this.router.clone();
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getUserAgent } from "./type-Bo8yJ-US.js";
6
+ import { getUserAgent } from "./type-aO0QESjd.js";
7
7
  import { parseSemVer } from "./semver-dArNLkR9.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
 
@@ -3,30 +3,30 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Follow, Person } from "../type-Bo8yJ-US.js";
6
+ import { Follow, Person } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-D9T3H7Lc.js";
11
+ import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-BkT88swb.js";
12
12
  import "../semver-dArNLkR9.js";
13
- import "../client-BBArfMe1.js";
14
- import "../lookup-Da6Ndr93.js";
13
+ import "../client-iVnypF2y.js";
14
+ import "../lookup-Dpul0cUe.js";
15
15
  import "../types-BIgY6c-l.js";
16
- import "../actor-DUaSUqb5.js";
17
- import "../key-D7-bV4Xg.js";
18
- import "../http-DFX1Uz6Q.js";
19
- import "../authdocloader-BZn07D4c.js";
20
- import "../ld-BIHHWSg3.js";
21
- import "../owner-C_xbpZKr.js";
22
- import "../proof-DFrbEuMh.js";
23
- import "../inbox-CvdfJsr4.js";
24
- import "../builder-WOmlWRLq.js";
16
+ import "../actor-Bj4E2JRg.js";
17
+ import "../key-Bogxf4NW.js";
18
+ import "../http-BgBStUQn.js";
19
+ import "../authdocloader-Dx6uHSEc.js";
20
+ import "../ld-B3_WG7GN.js";
21
+ import "../owner-DBEblO3I.js";
22
+ import "../proof-Zk7ECIIN.js";
23
+ import "../inbox-DdQaBIzA.js";
24
+ import "../builder-CxPGY_jN.js";
25
25
  import "../collection-CSzG2j1P.js";
26
- import "../keycache-CE1T-kF7.js";
26
+ import "../keycache-C4SeJJRt.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-BpWvSj7e.js";
29
- import { test } from "../testing-na6lpilo.js";
28
+ import "../send-DiNom3JD.js";
29
+ import { test } from "../testing-oIthntGQ.js";
30
30
 
31
31
  //#region src/compat/transformers.test.ts
32
32
  const federation = new FederationImpl({ kv: new MemoryKvStore() });
@@ -8,6 +8,10 @@ import { isEqual } from "es-toolkit";
8
8
  //#region src/x/denokv.ts
9
9
  /**
10
10
  * Represents a message queue adapter that uses Deno KV store.
11
+ *
12
+ * @deprecated This class has been moved to `@fedify/denokv` package.
13
+ * Import `DenoKvMessageQueue` from `@fedify/denokv` instead.
14
+ * This class will be removed in Fedify v2.0.
11
15
  */
12
16
  var DenoKvMessageQueue = class {
13
17
  #kv;
@@ -10,7 +10,7 @@ import { isIP } from "node:net";
10
10
 
11
11
  //#region deno.json
12
12
  var name = "@fedify/fedify";
13
- var version = "1.9.0-pr.387.1423+2ff7aa0b";
13
+ var version = "1.9.0-pr.388.1456+c8cbdb88";
14
14
  var license = "MIT";
15
15
  var exports = {
16
16
  ".": "./src/mod.ts",
@@ -4446,7 +4446,7 @@ async function getRemoteDocument(url, response, fetch$1) {
4446
4446
  }
4447
4447
  let document;
4448
4448
  if (!jsonLd && (contentType === "text/html" || contentType?.startsWith("text/html;") || contentType === "application/xhtml+xml" || contentType?.startsWith("application/xhtml+xml;"))) {
4449
- const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\/?>/gi;
4449
+ const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\s*\/?>/gi;
4450
4450
  const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/gi;
4451
4451
  const html = await response.text();
4452
4452
  let m;
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { __commonJS, __toESM } from "./type-Bo8yJ-US.js";
6
+ import { __commonJS, __toESM } from "./type-aO0QESjd.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
9
9
  var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports, module) {
@@ -3,16 +3,16 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Note, Person } from "../type-Bo8yJ-US.js";
6
+ import { Activity, Note, Person } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
11
  import { parseSemVer } from "../semver-dArNLkR9.js";
12
- import "../lookup-Da6Ndr93.js";
13
- import "../inbox-CvdfJsr4.js";
14
- import { createFederationBuilder } from "../builder-WOmlWRLq.js";
15
- import { test } from "../testing-na6lpilo.js";
12
+ import "../lookup-Dpul0cUe.js";
13
+ import "../inbox-DdQaBIzA.js";
14
+ import { createFederationBuilder } from "../builder-CxPGY_jN.js";
15
+ import { test } from "../testing-oIthntGQ.js";
16
16
  import { assertExists } from "../std__assert-X-_kMxKM.js";
17
17
  import "../assert_rejects-DiIiJbZn.js";
18
18
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,13 +3,13 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-Bo8yJ-US.js";
6
+ import "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-Da6Ndr93.js";
10
+ import "../lookup-Dpul0cUe.js";
11
11
  import { buildCollectionSynchronizationHeader, digest } from "../collection-CSzG2j1P.js";
12
- import { test } from "../testing-na6lpilo.js";
12
+ import { test } from "../testing-oIthntGQ.js";
13
13
  import "../std__assert-X-_kMxKM.js";
14
14
  import "../assert_rejects-DiIiJbZn.js";
15
15
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,36 +3,36 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Create, Note, Person } from "../type-Bo8yJ-US.js";
6
+ import { Create, Note, Person } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-D9T3H7Lc.js";
11
+ import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-BkT88swb.js";
12
12
  import "../semver-dArNLkR9.js";
13
- import "../client-BBArfMe1.js";
14
- import "../lookup-Da6Ndr93.js";
13
+ import "../client-iVnypF2y.js";
14
+ import "../lookup-Dpul0cUe.js";
15
15
  import "../types-BIgY6c-l.js";
16
- import "../actor-DUaSUqb5.js";
17
- import "../key-D7-bV4Xg.js";
18
- import { signRequest } from "../http-DFX1Uz6Q.js";
19
- import "../authdocloader-BZn07D4c.js";
20
- import "../ld-BIHHWSg3.js";
21
- import "../owner-C_xbpZKr.js";
22
- import "../proof-DFrbEuMh.js";
23
- import { InboxListenerSet } from "../inbox-CvdfJsr4.js";
24
- import "../builder-WOmlWRLq.js";
16
+ import "../actor-Bj4E2JRg.js";
17
+ import "../key-Bogxf4NW.js";
18
+ import { signRequest } from "../http-BgBStUQn.js";
19
+ import "../authdocloader-Dx6uHSEc.js";
20
+ import "../ld-B3_WG7GN.js";
21
+ import "../owner-DBEblO3I.js";
22
+ import "../proof-Zk7ECIIN.js";
23
+ import { InboxListenerSet } from "../inbox-DdQaBIzA.js";
24
+ import "../builder-CxPGY_jN.js";
25
25
  import "../collection-CSzG2j1P.js";
26
- import "../keycache-CE1T-kF7.js";
26
+ import "../keycache-C4SeJJRt.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-BpWvSj7e.js";
29
- import { createInboxContext, createRequestContext, mockDocumentLoader, test } from "../testing-na6lpilo.js";
28
+ import "../send-DiNom3JD.js";
29
+ import { createInboxContext, createRequestContext, mockDocumentLoader, test } from "../testing-oIthntGQ.js";
30
30
  import "../std__assert-X-_kMxKM.js";
31
31
  import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
32
32
  import "../assert_is_error-BPGph1Jx.js";
33
33
  import "../assert_not_equals-f3m3epl3.js";
34
34
  import "../assert_throws-BOO88avQ.js";
35
- import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-zgjXdnwi.js";
35
+ import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-BaR7xMh1.js";
36
36
 
37
37
  //#region src/federation/handler.test.ts
38
38
  test("acceptsJsonLd()", () => {
@@ -3,11 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Create, Invite, Offer, Update } from "../type-Bo8yJ-US.js";
6
+ import { Activity, Create, Invite, Offer, Update } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import "../lookup-Da6Ndr93.js";
9
- import { InboxListenerSet } from "../inbox-CvdfJsr4.js";
10
- import { test } from "../testing-na6lpilo.js";
8
+ import "../lookup-Dpul0cUe.js";
9
+ import { InboxListenerSet } from "../inbox-DdQaBIzA.js";
10
+ import { test } from "../testing-oIthntGQ.js";
11
11
  import "../assert_is_error-BPGph1Jx.js";
12
12
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
13
13
 
@@ -3,14 +3,14 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { CryptographicKey, Multikey } from "../type-Bo8yJ-US.js";
6
+ import { CryptographicKey, Multikey } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import "../lookup-Da6Ndr93.js";
12
- import { KvKeyCache } from "../keycache-CE1T-kF7.js";
13
- import { test } from "../testing-na6lpilo.js";
11
+ import "../lookup-Dpul0cUe.js";
12
+ import { KvKeyCache } from "../keycache-C4SeJJRt.js";
13
+ import { test } from "../testing-oIthntGQ.js";
14
14
 
15
15
  //#region src/federation/keycache.test.ts
16
16
  test("KvKeyCache.set()", async () => {
@@ -3,13 +3,13 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-Bo8yJ-US.js";
6
+ import "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import "../lookup-Da6Ndr93.js";
12
- import { test } from "../testing-na6lpilo.js";
11
+ import "../lookup-Dpul0cUe.js";
12
+ import { test } from "../testing-oIthntGQ.js";
13
13
  import "../std__assert-X-_kMxKM.js";
14
14
  import "../assert_rejects-DiIiJbZn.js";
15
15
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,37 +3,37 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Announce, Create, FetchError, Invite, Multikey, Note, Object as Object$1, Offer, Person, fetchDocumentLoader, getTypeId } from "../type-Bo8yJ-US.js";
6
+ import { Activity, Announce, Create, FetchError, Invite, Multikey, Note, Object as Object$1, Offer, Person, fetchDocumentLoader, getTypeId } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-D9T3H7Lc.js";
11
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-BkT88swb.js";
12
12
  import "../semver-dArNLkR9.js";
13
- import "../client-BBArfMe1.js";
14
- import { RouterError, lookupObject } from "../lookup-Da6Ndr93.js";
13
+ import "../client-iVnypF2y.js";
14
+ import { RouterError, lookupObject } from "../lookup-Dpul0cUe.js";
15
15
  import "../types-BIgY6c-l.js";
16
- import "../actor-DUaSUqb5.js";
17
- import "../key-D7-bV4Xg.js";
18
- import { signRequest, verifyRequest } from "../http-DFX1Uz6Q.js";
19
- import { getAuthenticatedDocumentLoader } from "../authdocloader-BZn07D4c.js";
20
- import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-BIHHWSg3.js";
21
- import { doesActorOwnKey } from "../owner-C_xbpZKr.js";
22
- import { signObject, verifyObject } from "../proof-DFrbEuMh.js";
23
- import "../inbox-CvdfJsr4.js";
24
- import "../builder-WOmlWRLq.js";
16
+ import "../actor-Bj4E2JRg.js";
17
+ import "../key-Bogxf4NW.js";
18
+ import { signRequest, verifyRequest } from "../http-BgBStUQn.js";
19
+ import { getAuthenticatedDocumentLoader } from "../authdocloader-Dx6uHSEc.js";
20
+ import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-B3_WG7GN.js";
21
+ import { doesActorOwnKey } from "../owner-DBEblO3I.js";
22
+ import { signObject, verifyObject } from "../proof-Zk7ECIIN.js";
23
+ import "../inbox-DdQaBIzA.js";
24
+ import "../builder-CxPGY_jN.js";
25
25
  import "../collection-CSzG2j1P.js";
26
- import "../keycache-CE1T-kF7.js";
26
+ import "../keycache-C4SeJJRt.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-BpWvSj7e.js";
29
- import { mockDocumentLoader, test } from "../testing-na6lpilo.js";
28
+ import "../send-DiNom3JD.js";
29
+ import { mockDocumentLoader, test } from "../testing-oIthntGQ.js";
30
30
  import { assertStrictEquals } from "../std__assert-X-_kMxKM.js";
31
31
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
32
32
  import "../assert_is_error-BPGph1Jx.js";
33
33
  import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
34
34
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
35
- import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-zgjXdnwi.js";
36
- import { esm_default } from "../esm-BPIGCIPl.js";
35
+ import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-BaR7xMh1.js";
36
+ import { esm_default } from "../esm-BczgbYY7.js";
37
37
 
38
38
  //#region src/testing/fixtures/example.com/person.json
39
39
  var __context$1 = ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"];
@@ -3,16 +3,16 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
5
  import "../transformers-Dna8Fg7k.js";
6
- import "../docloader-CWkHs9uk.js";
7
- import "../actor-BQmgYclf.js";
8
- import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-BQQ98Smk.js";
9
- import "../lookup-D7mhJunn.js";
10
- import "../key-CbmNnbO0.js";
11
- import "../http-CVEhR0GX.js";
12
- import "../proof-CqSkPg1W.js";
6
+ import "../docloader-dcX6wT70.js";
7
+ import "../actor-DEUcppZT.js";
8
+ import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-hKurpsy6.js";
9
+ import "../lookup-DYiszLvp.js";
10
+ import "../key-BgPXFh5H.js";
11
+ import "../http-DLDZw5Or.js";
12
+ import "../proof-e2T8mSSn.js";
13
13
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-CMX7WzeL.js";
14
- import "../types-CsDgJZle.js";
15
- import "../authdocloader-DXJhK0Kr.js";
16
- import "../vocab-DjEvVueF.js";
14
+ import "../types-DlmitN02.js";
15
+ import "../authdocloader-CmFtuaWu.js";
16
+ import "../vocab-Drpu6tmF.js";
17
17
 
18
18
  export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-Bo8yJ-US.js";
6
+ import "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-Da6Ndr93.js";
11
- import { test } from "../testing-na6lpilo.js";
10
+ import "../lookup-Dpul0cUe.js";
11
+ import { test } from "../testing-oIthntGQ.js";
12
12
  import { assertGreater, assertGreaterOrEqual } from "../std__assert-X-_kMxKM.js";
13
13
  import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
@@ -227,7 +227,7 @@ test("InProcessMessageQueue", async (t) => {
227
227
  });
228
228
  test("MessageQueue.nativeRetrial", async (t) => {
229
229
  if ("Deno" in globalThis && "openKv" in globalThis.Deno && typeof globalThis.Deno.openKv === "function") await t.step("DenoKvMessageQueue", async () => {
230
- const { DenoKvMessageQueue } = await import("../denokv-2x6-IpXO.js");
230
+ const { DenoKvMessageQueue } = await import("../denokv-C-wcHaX0.js");
231
231
  const mq = new DenoKvMessageQueue(await globalThis.Deno.openKv(":memory:"));
232
232
  assert(mq.nativeRetrial);
233
233
  if (Symbol.dispose in mq) {
@@ -266,7 +266,7 @@ test("MessageQueue.nativeRetrial", async (t) => {
266
266
  });
267
267
  const queues = { InProcessMessageQueue: () => Promise.resolve(new InProcessMessageQueue()) };
268
268
  if ("Deno" in globalThis && "openKv" in globalThis.Deno && typeof globalThis.Deno.openKv === "function") {
269
- const { DenoKvMessageQueue } = await import("../denokv-2x6-IpXO.js");
269
+ const { DenoKvMessageQueue } = await import("../denokv-C-wcHaX0.js");
270
270
  queues.DenoKvMessageQueue = async () => new DenoKvMessageQueue(await globalThis.Deno.openKv(":memory:"));
271
271
  }
272
272
  for (const mqName in queues) test({
@@ -3,11 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-Bo8yJ-US.js";
6
+ import "../type-aO0QESjd.js";
7
7
  import { AssertionError, assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import "../lookup-Da6Ndr93.js";
8
+ import "../lookup-Dpul0cUe.js";
9
9
  import { createExponentialBackoffPolicy } from "../retry-D4GJ670a.js";
10
- import { test } from "../testing-na6lpilo.js";
10
+ import { test } from "../testing-oIthntGQ.js";
11
11
  import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
12
12
 
13
13
  //#region src/federation/retry.test.ts
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-Bo8yJ-US.js";
6
+ import "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import { Router, RouterError } from "../lookup-Da6Ndr93.js";
11
- import { test } from "../testing-na6lpilo.js";
10
+ import { Router, RouterError } from "../lookup-Dpul0cUe.js";
11
+ import { test } from "../testing-oIthntGQ.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,24 +3,24 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Application, Endpoints, Group, Person, Service } from "../type-Bo8yJ-US.js";
6
+ import { Activity, Application, Endpoints, Group, Person, Service } from "../type-aO0QESjd.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-Da6Ndr93.js";
11
- import "../actor-DUaSUqb5.js";
12
- import "../key-D7-bV4Xg.js";
13
- import { verifyRequest } from "../http-DFX1Uz6Q.js";
14
- import { doesActorOwnKey } from "../owner-C_xbpZKr.js";
15
- import { extractInboxes, sendActivity } from "../send-BpWvSj7e.js";
16
- import { mockDocumentLoader, test } from "../testing-na6lpilo.js";
10
+ import "../lookup-Dpul0cUe.js";
11
+ import "../actor-Bj4E2JRg.js";
12
+ import "../key-Bogxf4NW.js";
13
+ import { verifyRequest } from "../http-BgBStUQn.js";
14
+ import { doesActorOwnKey } from "../owner-DBEblO3I.js";
15
+ import { extractInboxes, sendActivity } from "../send-DiNom3JD.js";
16
+ import { mockDocumentLoader, test } from "../testing-oIthntGQ.js";
17
17
  import "../std__assert-X-_kMxKM.js";
18
18
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
19
19
  import "../assert_is_error-BPGph1Jx.js";
20
20
  import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
21
21
  import "../assert_throws-BOO88avQ.js";
22
- import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-zgjXdnwi.js";
23
- import { esm_default } from "../esm-BPIGCIPl.js";
22
+ import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-BaR7xMh1.js";
23
+ import { esm_default } from "../esm-BczgbYY7.js";
24
24
 
25
25
  //#region src/federation/send.test.ts
26
26
  test("extractInboxes()", () => {
@@ -0,0 +1,24 @@
1
+ {
2
+ "@context": [
3
+ "https://www.w3.org/ns/activitystreams",
4
+ "https://w3id.org/security/v1"
5
+ ],
6
+ "id": "https://oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd",
7
+ "type": "Person",
8
+ "preferredUsername": "hongminhee",
9
+ "name": "洪兔",
10
+ "inbox": "https://oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd/inbox",
11
+ "outbox": "https://oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd/outbox",
12
+ "publicKey": {
13
+ "id": "https://oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd#main-key",
14
+ "owner": "https://oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd",
15
+ "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAowJfOzpA/nAYyL0bVDTm\niCAOlhFCIBnqwk1jvGrbkDhMzxlsgyoDqUSlmcJdKaPwu24YdFajDtJIgto27Ju7\nIC3hB7OFchnZ4JZrdYFo7CJABOzK58o12sdmmkCdY5hXWf1604E+mzyIdBAJ1FFJ\nL8vP07VEUsZ7yo9x0iVNg7HpCOK+y6BqI2GHS2dq9qkqQEIhC2TKHXn/RQVXwYB6\nG+YQmVUtcsbCVKdcWyTKhItLRGnepu3BqBSbieLxV27B1O9NFSoPu8xiBUnYwMoe\nsUQCE5tGcqxc75HzcVCbq7PqVqHZ1NW9RYssaSUqi4FYcjXxQrR08DrAl8rR4eXT\n4QIDAQAB\n-----END PUBLIC KEY-----\n"
16
+ },
17
+ "endpoints": {
18
+ "type": "as:Endpoints",
19
+ "sharedInbox": "https://oeee.cafe/inbox"
20
+ },
21
+ "followers": "https://oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd/followers",
22
+ "manuallyApprovesFollowers": false,
23
+ "url": "https://oeee.cafe/@hongminhee"
24
+ }
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { CryptographicKey, deno_default } from "./type-Bo8yJ-US.js";
7
- import { fetchKey, validateCryptoKey } from "./key-D7-bV4Xg.js";
6
+ import { CryptographicKey, deno_default } from "./type-aO0QESjd.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-Bogxf4NW.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
@@ -366,7 +366,7 @@ async function verifyRequestDraft(request, span, { documentLoader, contextLoader
366
366
  return null;
367
367
  }
368
368
  }
369
- const sigValues = Object.fromEntries(sigHeader.split(",").map((pair) => pair.match(/^\s*([A-Za-z]+)="([^"]*)"\s*$/)).filter((m) => m != null).map((m) => m.slice(1, 3)));
369
+ const sigValues = Object.fromEntries(sigHeader.split(",").map((pair) => pair.match(/^\s*([A-Za-z]+)=(?:"([^"]*)"|(\d+))\s*$/)).filter((m) => m != null).map((m) => [m[1], m[2] ?? m[3]]));
370
370
  if (!("keyId" in sigValues)) {
371
371
  logger.debug("Failed to verify; no keyId field found in the Signature header.", { signature: sigHeader });
372
372
  return null;
@@ -377,6 +377,52 @@ async function verifyRequestDraft(request, span, { documentLoader, contextLoader
377
377
  logger.debug("Failed to verify; no signature field found in the Signature header.", { signature: sigHeader });
378
378
  return null;
379
379
  }
380
+ if ("expires" in sigValues) {
381
+ const expiresSeconds = parseInt(sigValues.expires);
382
+ if (!Number.isInteger(expiresSeconds)) {
383
+ logger.debug("Failed to verify; invalid expires field in the Signature header: {expires}.", {
384
+ expires: sigValues.expires,
385
+ signature: sigHeader
386
+ });
387
+ return null;
388
+ }
389
+ const expires = Temporal.Instant.fromEpochMilliseconds(expiresSeconds * 1e3);
390
+ if (Temporal.Instant.compare(now, expires) > 0) {
391
+ logger.debug("Failed to verify; signature expired at {expires} (now: {now}).", {
392
+ expires: expires.toString(),
393
+ now: now.toString(),
394
+ signature: sigHeader
395
+ });
396
+ return null;
397
+ }
398
+ }
399
+ if ("created" in sigValues) {
400
+ const createdSeconds = parseInt(sigValues.created);
401
+ if (!Number.isInteger(createdSeconds)) {
402
+ logger.debug("Failed to verify; invalid created field in the Signature header: {created}.", {
403
+ created: sigValues.created,
404
+ signature: sigHeader
405
+ });
406
+ return null;
407
+ }
408
+ if (timeWindow !== false) {
409
+ const created = Temporal.Instant.fromEpochMilliseconds(createdSeconds * 1e3);
410
+ const tw = timeWindow ?? { minutes: 1 };
411
+ if (Temporal.Instant.compare(created, now.add(tw)) > 0) {
412
+ logger.debug("Failed to verify; created is too far in the future.", {
413
+ created: created.toString(),
414
+ now: now.toString()
415
+ });
416
+ return null;
417
+ } else if (Temporal.Instant.compare(created, now.subtract(tw)) < 0) {
418
+ logger.debug("Failed to verify; created is too far in the past.", {
419
+ created: created.toString(),
420
+ now: now.toString()
421
+ });
422
+ return null;
423
+ }
424
+ }
425
+ }
380
426
  const { keyId, headers, signature } = sigValues;
381
427
  span?.setAttribute("http_signatures.key_id", keyId);
382
428
  if ("algorithm" in sigValues) span?.setAttribute("http_signatures.algorithm", sigValues.algorithm);
@@ -396,7 +442,7 @@ async function verifyRequestDraft(request, span, { documentLoader, contextLoader
396
442
  logger.debug("Failed to verify; required headers missing in the Signature header: {headers}.", { headers });
397
443
  return null;
398
444
  }
399
- const message = headerNames.map((name) => `${name}: ` + (name == "(request-target)" ? `${request.method.toLowerCase()} ${new URL(request.url).pathname}` : name == "host" ? request.headers.get("host") ?? new URL(request.url).host : request.headers.get(name))).join("\n");
445
+ const message = headerNames.map((name) => `${name}: ` + (name === "(request-target)" ? `${request.method.toLowerCase()} ${new URL(request.url).pathname}` : name === "(created)" ? sigValues.created ?? "" : name === "(expires)" ? sigValues.expires ?? "" : name === "host" ? request.headers.get("host") ?? new URL(request.url).host : request.headers.get(name))).join("\n");
400
446
  const sig = decodeBase64(signature);
401
447
  span?.setAttribute("http_signatures.signature", encodeHex(sig));
402
448
  const verified = await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, sig, new TextEncoder().encode(message));