@fedify/fedify 2.0.7-pr.639.14 → 2.0.8

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 (49) hide show
  1. package/dist/{builder-DDJvNdF6.js → builder-B5cKln9v.js} +3 -3
  2. package/dist/compat/transformers.test.js +12 -12
  3. package/dist/{deno-DRNouYGU.js → deno-4w047OFk.js} +1 -1
  4. package/dist/{docloader-azyNM4Y1.js → docloader-CBHh0rC5.js} +2 -2
  5. package/dist/federation/builder.test.js +3 -3
  6. package/dist/federation/handler.test.js +12 -12
  7. package/dist/federation/idempotency.test.js +12 -12
  8. package/dist/federation/inbox.test.js +2 -2
  9. package/dist/federation/keycache.test.js +5 -1
  10. package/dist/federation/middleware.test.js +12 -12
  11. package/dist/federation/mod.cjs +4 -4
  12. package/dist/federation/mod.js +4 -4
  13. package/dist/federation/send.test.js +5 -5
  14. package/dist/federation/webfinger.test.js +12 -12
  15. package/dist/{http-EGn7FcIM.js → http-Br3-1dRf.js} +18 -6
  16. package/dist/{http-BH8CU4ao.js → http-C_RwU_oN.js} +17 -6
  17. package/dist/{http-BYYABt7k.cjs → http-DGs_78tx.cjs} +17 -6
  18. package/dist/{inbox-CnmCW_8k.js → inbox-3bZUqDLE.js} +1 -1
  19. package/dist/{key-D0avVSWO.js → key-D7Y_J9kt.js} +1 -1
  20. package/dist/{keycache-DRxpZ5r9.js → keycache-BASM0rrX.js} +10 -1
  21. package/dist/{kv-cache-BKJvu3Pa.cjs → kv-cache-9PANi4tA.cjs} +1 -1
  22. package/dist/{kv-cache-CoNCzZp2.js → kv-cache-CMM5VJsc.js} +1 -1
  23. package/dist/{ld-CJtCj7TF.js → ld-Bjq9Z4St.js} +2 -2
  24. package/dist/{middleware-Dwcyv5Jd.js → middleware-B73ZyDmk.js} +4 -4
  25. package/dist/{middleware-CY9EW5RW.js → middleware-Bj30TZll.js} +15 -6
  26. package/dist/{middleware-C7IMURKV.cjs → middleware-CQeA5yF7.cjs} +15 -6
  27. package/dist/{middleware-CIiMan37.js → middleware-DozhKfB6.js} +11 -11
  28. package/dist/middleware-Dr61i4Jo.cjs +12 -0
  29. package/dist/{middleware-BdfGWA3u.js → middleware-_1PYruC5.js} +12 -12
  30. package/dist/mod.cjs +4 -4
  31. package/dist/mod.js +4 -4
  32. package/dist/nodeinfo/handler.test.js +12 -12
  33. package/dist/{owner-BNhqTvp9.js → owner-CImU2dKz.js} +1 -1
  34. package/dist/{proof-Cl9IbZ-7.js → proof-BygvN4r5.js} +2 -2
  35. package/dist/{proof-CxmA6b9R.js → proof-DLL0MLmV.js} +2 -2
  36. package/dist/{proof-DTDfsYzH.cjs → proof-UhA5do8k.cjs} +2 -2
  37. package/dist/{send-wVMWF0hP.js → send-DbW03azY.js} +2 -2
  38. package/dist/sig/http.test.js +46 -3
  39. package/dist/sig/key.test.js +2 -2
  40. package/dist/sig/ld.test.js +3 -3
  41. package/dist/sig/mod.cjs +2 -2
  42. package/dist/sig/mod.js +2 -2
  43. package/dist/sig/owner.test.js +3 -3
  44. package/dist/sig/proof.test.js +3 -3
  45. package/dist/utils/docloader.test.js +4 -4
  46. package/dist/utils/mod.cjs +2 -2
  47. package/dist/utils/mod.js +2 -2
  48. package/package.json +5 -5
  49. package/dist/middleware-CSMjcpDB.cjs +0 -12
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-DRNouYGU.js";
7
- import { fetchKey, validateCryptoKey } from "./key-D0avVSWO.js";
6
+ import { deno_default } from "./deno-4w047OFk.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-D7Y_J9kt.js";
8
8
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
9
9
  import { getDocumentLoader } from "@fedify/vocab-runtime";
10
10
  import { getLogger } from "@logtape/logtape";
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
5
  import "./transformers-C3FLHUd6.js";
6
- import "./http-BH8CU4ao.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-CY9EW5RW.js";
8
- import "./proof-Cl9IbZ-7.js";
6
+ import "./http-C_RwU_oN.js";
7
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Bj30TZll.js";
8
+ import "./proof-BygvN4r5.js";
9
9
  import "./types-C93Ob9cU.js";
10
- import "./kv-cache-CoNCzZp2.js";
10
+ import "./kv-cache-CMM5VJsc.js";
11
11
 
12
12
  export { FederationImpl };
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
5
  import { getDefaultActivityTransformers } from "./transformers-C3FLHUd6.js";
6
- import { deno_default, doubleKnock, exportJwk, importJwk, validateCryptoKey, verifyRequest } from "./http-BH8CU4ao.js";
7
- import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-Cl9IbZ-7.js";
6
+ import { deno_default, doubleKnock, exportJwk, importJwk, validateCryptoKey, verifyRequest } from "./http-C_RwU_oN.js";
7
+ import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-BygvN4r5.js";
8
8
  import { getNodeInfo, nodeInfoToJson } from "./types-C93Ob9cU.js";
9
- import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CoNCzZp2.js";
9
+ import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CMM5VJsc.js";
10
10
  import { getLogger, withContext } from "@logtape/logtape";
11
11
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
12
12
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -14,8 +14,8 @@ import { cloneDeep } from "es-toolkit";
14
14
  import { Router } from "uri-template-router";
15
15
  import { parseTemplate } from "url-template";
16
16
  import { encodeHex } from "byte-encodings/hex";
17
- import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
18
17
  import { getDocumentLoader } from "@fedify/vocab-runtime";
18
+ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
19
19
  import { lookupWebFinger } from "@fedify/webfinger";
20
20
  import { domainToASCII } from "node:url";
21
21
 
@@ -338,7 +338,7 @@ var FederationBuilderImpl = class {
338
338
  this.collectionTypeIds = {};
339
339
  }
340
340
  async build(options) {
341
- const { FederationImpl: FederationImpl$1 } = await import("./middleware-Dwcyv5Jd.js");
341
+ const { FederationImpl: FederationImpl$1 } = await import("./middleware-B73ZyDmk.js");
342
342
  const f = new FederationImpl$1(options);
343
343
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
344
344
  f.router = this.router.clone();
@@ -865,6 +865,11 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
865
865
 
866
866
  //#endregion
867
867
  //#region src/federation/keycache.ts
868
+ const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
869
+ const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
870
+ function isNullKeyCacheValue(value) {
871
+ return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
872
+ }
868
873
  var KvKeyCache = class {
869
874
  kv;
870
875
  prefix;
@@ -880,6 +885,10 @@ var KvKeyCache = class {
880
885
  if (this.nullKeys.has(keyId.href)) return null;
881
886
  const serialized = await this.kv.get([...this.prefix, keyId.href]);
882
887
  if (serialized == null) return void 0;
888
+ if (isNullKeyCacheValue(serialized)) {
889
+ this.nullKeys.add(keyId.href);
890
+ return null;
891
+ }
883
892
  try {
884
893
  return await CryptographicKey.fromJsonLd(serialized, this.options);
885
894
  } catch {
@@ -894,7 +903,7 @@ var KvKeyCache = class {
894
903
  async set(keyId, key) {
895
904
  if (key == null) {
896
905
  this.nullKeys.add(keyId.href);
897
- await this.kv.delete([...this.prefix, keyId.href]);
906
+ await this.kv.set([...this.prefix, keyId.href], NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
898
907
  return;
899
908
  }
900
909
  this.nullKeys.delete(keyId.href);
@@ -4,10 +4,10 @@
4
4
 
5
5
  const require_chunk = require('./chunk-CGaQZ11T.cjs');
6
6
  const require_transformers = require('./transformers-3g8GZwkZ.cjs');
7
- const require_http = require('./http-BYYABt7k.cjs');
8
- const require_proof = require('./proof-DTDfsYzH.cjs');
7
+ const require_http = require('./http-DGs_78tx.cjs');
8
+ const require_proof = require('./proof-UhA5do8k.cjs');
9
9
  const require_types = require('./types-Cd_hszr_.cjs');
10
- const require_kv_cache = require('./kv-cache-BKJvu3Pa.cjs');
10
+ const require_kv_cache = require('./kv-cache-9PANi4tA.cjs');
11
11
  const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
12
12
  const __fedify_vocab = require_chunk.__toESM(require("@fedify/vocab"));
13
13
  const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
@@ -15,8 +15,8 @@ const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
15
15
  const uri_template_router = require_chunk.__toESM(require("uri-template-router"));
16
16
  const url_template = require_chunk.__toESM(require("url-template"));
17
17
  const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
18
- const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
19
18
  const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
19
+ const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
20
20
  const __fedify_webfinger = require_chunk.__toESM(require("@fedify/webfinger"));
21
21
  const node_url = require_chunk.__toESM(require("node:url"));
22
22
 
@@ -339,7 +339,7 @@ var FederationBuilderImpl = class {
339
339
  this.collectionTypeIds = {};
340
340
  }
341
341
  async build(options) {
342
- const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-CSMjcpDB.cjs"));
342
+ const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-Dr61i4Jo.cjs"));
343
343
  const f = new FederationImpl$1(options);
344
344
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
345
345
  f.router = this.router.clone();
@@ -866,6 +866,11 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
866
866
 
867
867
  //#endregion
868
868
  //#region src/federation/keycache.ts
869
+ const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
870
+ const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
871
+ function isNullKeyCacheValue(value) {
872
+ return typeof value === "object" && value != null && "_fedify" in value && value._fedify === NULL_KEY_CACHE_VALUE._fedify;
873
+ }
869
874
  var KvKeyCache = class {
870
875
  kv;
871
876
  prefix;
@@ -881,6 +886,10 @@ var KvKeyCache = class {
881
886
  if (this.nullKeys.has(keyId.href)) return null;
882
887
  const serialized = await this.kv.get([...this.prefix, keyId.href]);
883
888
  if (serialized == null) return void 0;
889
+ if (isNullKeyCacheValue(serialized)) {
890
+ this.nullKeys.add(keyId.href);
891
+ return null;
892
+ }
884
893
  try {
885
894
  return await __fedify_vocab.CryptographicKey.fromJsonLd(serialized, this.options);
886
895
  } catch {
@@ -895,7 +904,7 @@ var KvKeyCache = class {
895
904
  async set(keyId, key) {
896
905
  if (key == null) {
897
906
  this.nullKeys.add(keyId.href);
898
- await this.kv.delete([...this.prefix, keyId.href]);
907
+ await this.kv.set([...this.prefix, keyId.href], NULL_KEY_CACHE_VALUE, { ttl: NULL_KEY_CACHE_TTL });
899
908
  return;
900
909
  }
901
910
  this.nullKeys.delete(keyId.href);
@@ -3,24 +3,24 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-DRNouYGU.js";
6
+ import { deno_default } from "./deno-4w047OFk.js";
7
7
  import { getNodeInfo } from "./client-CoCIaTNO.js";
8
8
  import { RouterError } from "./router-D9eI0s4b.js";
9
9
  import { nodeInfoToJson } from "./types-CPz01LGH.js";
10
- import { exportJwk, importJwk, validateCryptoKey } from "./key-D0avVSWO.js";
11
- import { verifyRequest } from "./http-EGn7FcIM.js";
12
- import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-CJtCj7TF.js";
13
- import { doesActorOwnKey, getKeyOwner } from "./owner-BNhqTvp9.js";
14
- import { signObject, verifyObject } from "./proof-CxmA6b9R.js";
15
- import { getAuthenticatedDocumentLoader } from "./docloader-azyNM4Y1.js";
10
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-D7Y_J9kt.js";
11
+ import { verifyRequest } from "./http-Br3-1dRf.js";
12
+ import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-Bjq9Z4St.js";
13
+ import { doesActorOwnKey, getKeyOwner } from "./owner-CImU2dKz.js";
14
+ import { signObject, verifyObject } from "./proof-DLL0MLmV.js";
15
+ import { getAuthenticatedDocumentLoader } from "./docloader-CBHh0rC5.js";
16
16
  import { kvCache } from "./kv-cache-El7We5sy.js";
17
- import { routeActivity } from "./inbox-CnmCW_8k.js";
18
- import { FederationBuilderImpl } from "./builder-DDJvNdF6.js";
17
+ import { routeActivity } from "./inbox-3bZUqDLE.js";
18
+ import { FederationBuilderImpl } from "./builder-B5cKln9v.js";
19
19
  import { buildCollectionSynchronizationHeader } from "./collection-CcnIw1qY.js";
20
- import { KvKeyCache } from "./keycache-DRxpZ5r9.js";
20
+ import { KvKeyCache } from "./keycache-BASM0rrX.js";
21
21
  import { acceptsJsonLd } from "./negotiation-5NPJL6zp.js";
22
22
  import { createExponentialBackoffPolicy } from "./retry-D4GJ670a.js";
23
- import { SendActivityError, extractInboxes, sendActivity } from "./send-wVMWF0hP.js";
23
+ import { SendActivityError, extractInboxes, sendActivity } from "./send-DbW03azY.js";
24
24
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
25
25
  import { getDocumentLoader } from "@fedify/vocab-runtime";
26
26
  import { lookupWebFinger } from "@fedify/webfinger";
@@ -0,0 +1,12 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ require('./transformers-3g8GZwkZ.cjs');
6
+ require('./http-DGs_78tx.cjs');
7
+ const require_middleware = require('./middleware-CQeA5yF7.cjs');
8
+ require('./proof-UhA5do8k.cjs');
9
+ require('./types-Cd_hszr_.cjs');
10
+ require('./kv-cache-9PANi4tA.cjs');
11
+
12
+ exports.FederationImpl = require_middleware.FederationImpl;
@@ -3,24 +3,24 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "./deno-DRNouYGU.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-CIiMan37.js";
6
+ import "./deno-4w047OFk.js";
7
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-DozhKfB6.js";
8
8
  import "./client-CoCIaTNO.js";
9
9
  import "./router-D9eI0s4b.js";
10
10
  import "./types-CPz01LGH.js";
11
- import "./key-D0avVSWO.js";
12
- import "./http-EGn7FcIM.js";
13
- import "./ld-CJtCj7TF.js";
14
- import "./owner-BNhqTvp9.js";
15
- import "./proof-CxmA6b9R.js";
16
- import "./docloader-azyNM4Y1.js";
11
+ import "./key-D7Y_J9kt.js";
12
+ import "./http-Br3-1dRf.js";
13
+ import "./ld-Bjq9Z4St.js";
14
+ import "./owner-CImU2dKz.js";
15
+ import "./proof-DLL0MLmV.js";
16
+ import "./docloader-CBHh0rC5.js";
17
17
  import "./kv-cache-El7We5sy.js";
18
- import "./inbox-CnmCW_8k.js";
19
- import "./builder-DDJvNdF6.js";
18
+ import "./inbox-3bZUqDLE.js";
19
+ import "./builder-B5cKln9v.js";
20
20
  import "./collection-CcnIw1qY.js";
21
- import "./keycache-DRxpZ5r9.js";
21
+ import "./keycache-BASM0rrX.js";
22
22
  import "./negotiation-5NPJL6zp.js";
23
23
  import "./retry-D4GJ670a.js";
24
- import "./send-wVMWF0hP.js";
24
+ import "./send-DbW03azY.js";
25
25
 
26
26
  export { FederationImpl };
package/dist/mod.cjs CHANGED
@@ -5,12 +5,12 @@
5
5
  const require_chunk = require('./chunk-CGaQZ11T.cjs');
6
6
  const require_transformers = require('./transformers-3g8GZwkZ.cjs');
7
7
  require('./compat-DmDDELst.cjs');
8
- const require_http = require('./http-BYYABt7k.cjs');
9
- const require_middleware = require('./middleware-C7IMURKV.cjs');
10
- const require_proof = require('./proof-DTDfsYzH.cjs');
8
+ const require_http = require('./http-DGs_78tx.cjs');
9
+ const require_middleware = require('./middleware-CQeA5yF7.cjs');
10
+ const require_proof = require('./proof-UhA5do8k.cjs');
11
11
  const require_federation = require('./federation-Bp3HI26G.cjs');
12
12
  const require_types = require('./types-Cd_hszr_.cjs');
13
- const require_kv_cache = require('./kv-cache-BKJvu3Pa.cjs');
13
+ const require_kv_cache = require('./kv-cache-9PANi4tA.cjs');
14
14
  require('./nodeinfo-DuMYTpbZ.cjs');
15
15
  const require_runtime = require('./runtime-c2Njxsry.cjs');
16
16
  require('./sig-vX39WyWI.cjs');
package/dist/mod.js CHANGED
@@ -5,12 +5,12 @@
5
5
  import { __export, __reExport } from "./chunk-DJNbSFdH.js";
6
6
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-C3FLHUd6.js";
7
7
  import "./compat-Bb4NuTUO.js";
8
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-BH8CU4ao.js";
9
- import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-CY9EW5RW.js";
10
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-Cl9IbZ-7.js";
8
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-C_RwU_oN.js";
9
+ import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-Bj30TZll.js";
10
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-BygvN4r5.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-DaMfqRm4.js";
12
12
  import { getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./types-C93Ob9cU.js";
13
- import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CoNCzZp2.js";
13
+ import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CMM5VJsc.js";
14
14
  import "./nodeinfo-DoESQxq5.js";
15
15
  import { runtime_exports } from "./runtime-poamPCMb.js";
16
16
  import "./sig-BNhspNOf.js";
@@ -7,25 +7,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
7
  import "../assert-MZs1qjMx.js";
8
8
  import "../assert_instance_of-DHz7EHNU.js";
9
9
  import { MemoryKvStore } from "../kv-QzKcOQgP.js";
10
- import "../deno-DRNouYGU.js";
11
- import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-CIiMan37.js";
10
+ import "../deno-4w047OFk.js";
11
+ import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-DozhKfB6.js";
12
12
  import "../client-CoCIaTNO.js";
13
13
  import "../router-D9eI0s4b.js";
14
14
  import "../types-CPz01LGH.js";
15
- import "../key-D0avVSWO.js";
16
- import "../http-EGn7FcIM.js";
17
- import "../ld-CJtCj7TF.js";
18
- import "../owner-BNhqTvp9.js";
19
- import "../proof-CxmA6b9R.js";
20
- import "../docloader-azyNM4Y1.js";
15
+ import "../key-D7Y_J9kt.js";
16
+ import "../http-Br3-1dRf.js";
17
+ import "../ld-Bjq9Z4St.js";
18
+ import "../owner-CImU2dKz.js";
19
+ import "../proof-DLL0MLmV.js";
20
+ import "../docloader-CBHh0rC5.js";
21
21
  import "../kv-cache-El7We5sy.js";
22
- import "../inbox-CnmCW_8k.js";
23
- import "../builder-DDJvNdF6.js";
22
+ import "../inbox-3bZUqDLE.js";
23
+ import "../builder-B5cKln9v.js";
24
24
  import "../collection-CcnIw1qY.js";
25
- import "../keycache-DRxpZ5r9.js";
25
+ import "../keycache-BASM0rrX.js";
26
26
  import "../negotiation-5NPJL6zp.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-wVMWF0hP.js";
28
+ import "../send-DbW03azY.js";
29
29
  import "../std__assert-DWivtrGR.js";
30
30
  import "../assert_rejects-Ce45JcFg.js";
31
31
  import "../assert_throws-BNXdRGWP.js";
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-DRNouYGU.js";
6
+ import { deno_default } from "./deno-4w047OFk.js";
7
7
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -2,13 +2,13 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { deno_default, fetchKey, validateCryptoKey } from "./http-BH8CU4ao.js";
5
+ import { deno_default, fetchKey, validateCryptoKey } from "./http-C_RwU_oN.js";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { encodeHex } from "byte-encodings/hex";
10
- import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
11
10
  import { getDocumentLoader } from "@fedify/vocab-runtime";
11
+ import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
12
12
  import jsonld from "@fedify/vocab-runtime/jsonld";
13
13
  import serialize from "json-canon";
14
14
 
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-DRNouYGU.js";
7
- import { fetchKey, validateCryptoKey } from "./key-D0avVSWO.js";
6
+ import { deno_default } from "./deno-4w047OFk.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-D7Y_J9kt.js";
8
8
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -3,13 +3,13 @@
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
5
  const require_chunk = require('./chunk-CGaQZ11T.cjs');
6
- const require_http = require('./http-BYYABt7k.cjs');
6
+ const require_http = require('./http-DGs_78tx.cjs');
7
7
  const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
8
8
  const __fedify_vocab = require_chunk.__toESM(require("@fedify/vocab"));
9
9
  const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
10
10
  const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
11
- const byte_encodings_base64 = require_chunk.__toESM(require("byte-encodings/base64"));
12
11
  const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
12
+ const byte_encodings_base64 = require_chunk.__toESM(require("byte-encodings/base64"));
13
13
  const __fedify_vocab_runtime_jsonld = require_chunk.__toESM(require("@fedify/vocab-runtime/jsonld"));
14
14
  const json_canon = require_chunk.__toESM(require("json-canon"));
15
15
 
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-DRNouYGU.js";
7
- import { doubleKnock } from "./http-EGn7FcIM.js";
6
+ import { deno_default } from "./deno-4w047OFk.js";
7
+ import { doubleKnock } from "./http-Br3-1dRf.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
 
@@ -7,9 +7,9 @@ import { esm_default } from "../esm-nLm00z9V.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 "../deno-DRNouYGU.js";
11
- import { exportJwk } from "../key-D0avVSWO.js";
12
- import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-EGn7FcIM.js";
10
+ import "../deno-4w047OFk.js";
11
+ import { exportJwk } from "../key-D7Y_J9kt.js";
12
+ import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-Br3-1dRf.js";
13
13
  import { assertExists, assertStringIncludes } from "../std__assert-DWivtrGR.js";
14
14
  import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
15
15
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
@@ -855,6 +855,49 @@ test("doubleKnock() complex redirect chain test", async () => {
855
855
  for (const loggedReq of logs) assert(loggedReq.headers.has("Signature-Input") || loggedReq.headers.has("Signature"), "Each request should be signed with either RFC 9421 or draft-cavage");
856
856
  esm_default.hardReset();
857
857
  });
858
+ test("doubleKnock() throws on too many redirects", async () => {
859
+ esm_default.spyGlobal();
860
+ let requestCount = 0;
861
+ esm_default.post("begin:https://example.com/too-many-redirects/", (cl) => {
862
+ requestCount++;
863
+ const index = Number(cl.url.split("/").at(-1));
864
+ return Response.redirect(`https://example.com/too-many-redirects/${index + 1}`, 302);
865
+ });
866
+ const request = new Request("https://example.com/too-many-redirects/0", {
867
+ method: "POST",
868
+ body: "Redirect loop",
869
+ headers: { "Content-Type": "text/plain" }
870
+ });
871
+ await assertRejects(() => doubleKnock(request, {
872
+ keyId: rsaPublicKey2.id,
873
+ privateKey: rsaPrivateKey2
874
+ }), Error, "Too many redirections");
875
+ assertEquals(requestCount, 21);
876
+ esm_default.hardReset();
877
+ });
878
+ test("doubleKnock() detects redirect loops", async () => {
879
+ esm_default.spyGlobal();
880
+ let requestCount = 0;
881
+ esm_default.post("https://example.com/redirect-loop-a", () => {
882
+ requestCount++;
883
+ return Response.redirect("https://example.com/redirect-loop-b", 302);
884
+ });
885
+ esm_default.post("https://example.com/redirect-loop-b", () => {
886
+ requestCount++;
887
+ return Response.redirect("https://example.com/redirect-loop-a", 302);
888
+ });
889
+ const request = new Request("https://example.com/redirect-loop-a", {
890
+ method: "POST",
891
+ body: "Redirect loop",
892
+ headers: { "Content-Type": "text/plain" }
893
+ });
894
+ await assertRejects(() => doubleKnock(request, {
895
+ keyId: rsaPublicKey2.id,
896
+ privateKey: rsaPrivateKey2
897
+ }), Error, "Redirect loop detected");
898
+ assertEquals(requestCount, 2);
899
+ esm_default.hardReset();
900
+ });
858
901
  test("doubleKnock() async specDeterminer test", async () => {
859
902
  esm_default.spyGlobal();
860
903
  let requestCount = 0;
@@ -6,8 +6,8 @@
6
6
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
7
  import "../assert-MZs1qjMx.js";
8
8
  import "../assert_instance_of-DHz7EHNU.js";
9
- import "../deno-DRNouYGU.js";
10
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-D0avVSWO.js";
9
+ import "../deno-4w047OFk.js";
10
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-D7Y_J9kt.js";
11
11
  import "../std__assert-DWivtrGR.js";
12
12
  import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
13
13
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
@@ -5,9 +5,9 @@
5
5
 
6
6
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
7
  import { assert } from "../assert-MZs1qjMx.js";
8
- import "../deno-DRNouYGU.js";
9
- import { generateCryptoKeyPair } from "../key-D0avVSWO.js";
10
- import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-CJtCj7TF.js";
8
+ import "../deno-4w047OFk.js";
9
+ import { generateCryptoKeyPair } from "../key-D7Y_J9kt.js";
10
+ import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-Bjq9Z4St.js";
11
11
  import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
12
12
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
13
13
  import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-ZbcByPg9.js";
package/dist/sig/mod.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- const require_http = require('../http-BYYABt7k.cjs');
6
- const require_proof = require('../proof-DTDfsYzH.cjs');
5
+ const require_http = require('../http-DGs_78tx.cjs');
6
+ const require_proof = require('../proof-UhA5do8k.cjs');
7
7
  require('../sig-vX39WyWI.cjs');
8
8
 
9
9
  exports.attachSignature = require_proof.attachSignature;
package/dist/sig/mod.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-BH8CU4ao.js";
6
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-Cl9IbZ-7.js";
5
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-C_RwU_oN.js";
6
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-BygvN4r5.js";
7
7
  import "../sig-BNhspNOf.js";
8
8
 
9
9
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
@@ -6,9 +6,9 @@
6
6
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
7
  import { assert } from "../assert-MZs1qjMx.js";
8
8
  import "../assert_instance_of-DHz7EHNU.js";
9
- import "../deno-DRNouYGU.js";
10
- import "../key-D0avVSWO.js";
11
- import { doesActorOwnKey, getKeyOwner } from "../owner-BNhqTvp9.js";
9
+ import "../deno-4w047OFk.js";
10
+ import "../key-D7Y_J9kt.js";
11
+ import { doesActorOwnKey, getKeyOwner } from "../owner-CImU2dKz.js";
12
12
  import "../std__assert-DWivtrGR.js";
13
13
  import { assertFalse } from "../assert_rejects-Ce45JcFg.js";
14
14
  import "../assert_throws-BNXdRGWP.js";
@@ -6,9 +6,9 @@
6
6
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
7
  import "../assert-MZs1qjMx.js";
8
8
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
9
- import "../deno-DRNouYGU.js";
10
- import "../key-D0avVSWO.js";
11
- import { createProof, signObject, verifyObject, verifyProof } from "../proof-CxmA6b9R.js";
9
+ import "../deno-4w047OFk.js";
10
+ import "../key-D7Y_J9kt.js";
11
+ import { createProof, signObject, verifyObject, verifyProof } from "../proof-DLL0MLmV.js";
12
12
  import "../std__assert-DWivtrGR.js";
13
13
  import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
14
14
  import "../assert_throws-BNXdRGWP.js";
@@ -7,10 +7,10 @@ import { esm_default } from "../esm-nLm00z9V.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 "../deno-DRNouYGU.js";
11
- import "../key-D0avVSWO.js";
12
- import { verifyRequest } from "../http-EGn7FcIM.js";
13
- import { getAuthenticatedDocumentLoader } from "../docloader-azyNM4Y1.js";
10
+ import "../deno-4w047OFk.js";
11
+ import "../key-D7Y_J9kt.js";
12
+ import { verifyRequest } from "../http-Br3-1dRf.js";
13
+ import { getAuthenticatedDocumentLoader } from "../docloader-CBHh0rC5.js";
14
14
  import "../std__assert-DWivtrGR.js";
15
15
  import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
16
16
  import "../assert_throws-BNXdRGWP.js";
@@ -2,8 +2,8 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- require('../http-BYYABt7k.cjs');
6
- const require_kv_cache = require('../kv-cache-BKJvu3Pa.cjs');
5
+ require('../http-DGs_78tx.cjs');
6
+ const require_kv_cache = require('../kv-cache-9PANi4tA.cjs');
7
7
  require('../utils-BQ9KqEK9.cjs');
8
8
 
9
9
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
package/dist/utils/mod.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../http-BH8CU4ao.js";
6
- import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-CoNCzZp2.js";
5
+ import "../http-C_RwU_oN.js";
6
+ import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-CMM5VJsc.js";
7
7
  import "../utils-Dn5OPdSW.js";
8
8
 
9
9
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.0.7-pr.639.14+40546420",
3
+ "version": "2.0.8",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -144,9 +144,9 @@
144
144
  "uri-template-router": "^1.0.0",
145
145
  "url-template": "^3.1.1",
146
146
  "urlpattern-polyfill": "^10.1.0",
147
- "@fedify/vocab": "2.0.7-pr.639.14+40546420",
148
- "@fedify/vocab-runtime": "2.0.7-pr.639.14+40546420",
149
- "@fedify/webfinger": "2.0.7-pr.639.14+40546420"
147
+ "@fedify/vocab": "2.0.8",
148
+ "@fedify/webfinger": "2.0.8",
149
+ "@fedify/vocab-runtime": "2.0.8"
150
150
  },
151
151
  "devDependencies": {
152
152
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -159,7 +159,7 @@
159
159
  "typescript": "^5.9.3",
160
160
  "wrangler": "^4.17.0",
161
161
  "@fedify/fixture": "2.0.0",
162
- "@fedify/vocab-tools": "^2.0.7-pr.639.14+40546420"
162
+ "@fedify/vocab-tools": "^2.0.8"
163
163
  },
164
164
  "scripts": {
165
165
  "build:self": "tsdown",
@@ -1,12 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- require('./transformers-3g8GZwkZ.cjs');
6
- require('./http-BYYABt7k.cjs');
7
- const require_middleware = require('./middleware-C7IMURKV.cjs');
8
- require('./proof-DTDfsYzH.cjs');
9
- require('./types-Cd_hszr_.cjs');
10
- require('./kv-cache-BKJvu3Pa.cjs');
11
-
12
- exports.FederationImpl = require_middleware.FederationImpl;