@fedify/fedify 2.4.5-dev.2462 → 2.4.5

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 (119) hide show
  1. package/README.md +3 -0
  2. package/dist/{builder-BBUGd9wr.mjs → builder-CUAVOHg6.mjs} +2 -2
  3. package/dist/{client-D-XP_Ccb.d.cts → client-3InDZbba.d.cts} +0 -1
  4. package/dist/{client-D-XP_Ccb.d.ts → client-3InDZbba.d.ts} +0 -1
  5. package/dist/{client-CEnNz8O7.mjs → client-5SIFzW3q.mjs} +113 -64
  6. package/dist/compat/mod.d.cts +1 -1
  7. package/dist/compat/mod.d.ts +1 -1
  8. package/dist/compat/transformers.test.mjs +1 -1
  9. package/dist/{compound-proof-CariICma.mjs → compound-proof-BNjXclzO.mjs} +2 -2
  10. package/dist/{context-7NyiqIcg.d.ts → context-CVOOd9pD.d.ts} +28 -2
  11. package/dist/{context-tsYPJ2Ew.d.cts → context-D0gFIgev.d.cts} +28 -2
  12. package/dist/{deno-BO7-a3hz.mjs → deno-DcJISdwu.mjs} +1 -1
  13. package/dist/docloader-CP1UxMLL.mjs +136 -0
  14. package/dist/federation/builder.test.mjs +1 -1
  15. package/dist/federation/compound-fanout.test.mjs +6 -3
  16. package/dist/federation/handler-compound-proof.test.mjs +3 -3
  17. package/dist/federation/handler.test.mjs +4 -4
  18. package/dist/federation/hashlink-media.test.mjs +2 -2
  19. package/dist/federation/idempotency.test.mjs +2 -2
  20. package/dist/federation/inbox-report.test.mjs +5 -5
  21. package/dist/federation/inbox.test.mjs +1 -1
  22. package/dist/federation/metrics.test.mjs +1 -1
  23. package/dist/federation/middleware.test.mjs +465 -32
  24. package/dist/federation/mod.cjs +1 -1
  25. package/dist/federation/mod.d.cts +3 -3
  26. package/dist/federation/mod.d.ts +3 -3
  27. package/dist/federation/mod.js +1 -1
  28. package/dist/federation/outgoing-proof.test.mjs +9 -6
  29. package/dist/federation/portable-actor.test.mjs +3 -3
  30. package/dist/federation/portable-chain.test.mjs +3 -3
  31. package/dist/federation/portable-collection.test.mjs +4 -4
  32. package/dist/federation/portable-delivery.test.mjs +2 -2
  33. package/dist/federation/portable-gateway-keys.test.mjs +11 -5
  34. package/dist/federation/portable-inbox.test.mjs +4 -4
  35. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  36. package/dist/federation/portable-route-activity.test.mjs +2 -2
  37. package/dist/federation/portable.test.mjs +3 -3
  38. package/dist/federation/send.test.mjs +498 -88
  39. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  40. package/dist/federation/tasks/tasks.test.mjs +2 -2
  41. package/dist/federation/temporal.test.mjs +1 -1
  42. package/dist/federation/webfinger.test.mjs +1 -1
  43. package/dist/{federation-Dd9IwOEi.cjs → federation-Bkfq2YpS.cjs} +240 -102
  44. package/dist/{http-DLf8QYD6.cjs → http-DHVH0DqC.cjs} +179 -110
  45. package/dist/{http-D7L2pqLT.mjs → http-DuGmr8J8.mjs} +204 -106
  46. package/dist/{http-BVrOR6MG.js → http-R0ty0Udi.js} +178 -109
  47. package/dist/{inbox-DtEKOr3W.mjs → inbox-Bl1Y0s_A.mjs} +2 -2
  48. package/dist/{key-DYxuyd-s.d.cts → key-CyCcut3h.d.ts} +1 -2
  49. package/dist/{key-C1nv7_jD.d.ts → key-VEL1QqHF.d.cts} +1 -2
  50. package/dist/{kv-cache-Dkzuqs8B.cjs → kv-cache-BtBSBZi9.cjs} +72 -27
  51. package/dist/{kv-cache-m3RIr811.mjs → kv-cache-DAV2_U44.mjs} +1 -1
  52. package/dist/{kv-cache-DoZoRS9p.js → kv-cache-FnLtmATH.js} +73 -28
  53. package/dist/{ld-PJLGA2MJ.mjs → ld-Cy5GqbvS.mjs} +2 -2
  54. package/dist/{metrics-CGR9cI-Y.mjs → metrics-CW8LoN7n.mjs} +1 -1
  55. package/dist/{middleware-DPI-Jp9w.mjs → middleware-CdP-lz8Q.mjs} +1 -1
  56. package/dist/{middleware-ByanhTvb.mjs → middleware-D2fk45uN.mjs} +82 -42
  57. package/dist/{middleware-BxhBd7pw.js → middleware-D4rQARvq.js} +241 -103
  58. package/dist/{mod-DEZXwV6J.d.ts → mod-B1Qt5cQQ.d.ts} +2 -9
  59. package/dist/{mod-Xj5P4s4d.d.ts → mod-B5COx5Wd.d.ts} +1 -1
  60. package/dist/{mod-CavhAgLw.d.cts → mod-BTxJG7ZH.d.cts} +1 -1
  61. package/dist/{mod-CtpF2BU5.d.ts → mod-CpyjFA9s.d.ts} +1 -1
  62. package/dist/{mod-BojP2Bw3.d.cts → mod-makPMVMg.d.cts} +1 -1
  63. package/dist/{mod-Dw-nPxQh.d.cts → mod-ss0wBUH1.d.cts} +2 -9
  64. package/dist/mod.cjs +5 -5
  65. package/dist/mod.d.cts +6 -6
  66. package/dist/mod.d.ts +6 -6
  67. package/dist/mod.js +5 -5
  68. package/dist/nodeinfo/client.test.mjs +337 -19
  69. package/dist/nodeinfo/handler.test.mjs +1 -1
  70. package/dist/nodeinfo/mod.cjs +1 -1
  71. package/dist/nodeinfo/mod.d.cts +1 -1
  72. package/dist/nodeinfo/mod.d.ts +1 -1
  73. package/dist/nodeinfo/mod.js +1 -1
  74. package/dist/otel/exporter.test.mjs +292 -30
  75. package/dist/otel/mod.cjs +36 -30
  76. package/dist/otel/mod.d.cts +13 -0
  77. package/dist/otel/mod.d.ts +13 -0
  78. package/dist/otel/mod.js +36 -30
  79. package/dist/{owner-B5c276hH.mjs → owner-CbQZqFim.mjs} +3 -3
  80. package/dist/{portable-collection-BMZY9qT-.js → portable-collection-B5Aryi8I.js} +1 -1
  81. package/dist/{portable-collection-CR5uwjws.cjs → portable-collection-C_Kmvl3q.cjs} +1 -1
  82. package/dist/{portable-collection-C88tBiy0.mjs → portable-collection-D2JYDadi.mjs} +2 -2
  83. package/dist/{portable-key-DxTXUpCK.mjs → portable-key-Cc-ctNU2.mjs} +1 -1
  84. package/dist/{proof-DNu-qP0i.mjs → proof-UN4CW55z.mjs} +3 -3
  85. package/dist/{send-CdCifQs4.mjs → send-BzbX2e6v.mjs} +174 -76
  86. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  87. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  88. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  89. package/dist/sig/compound-proof.test.mjs +2 -2
  90. package/dist/sig/http.test.mjs +553 -2
  91. package/dist/sig/key.test.mjs +1 -1
  92. package/dist/sig/ld.test.mjs +1 -1
  93. package/dist/sig/mitra-receive-interop.test.mjs +4 -4
  94. package/dist/sig/mitra-send-interop.test.mjs +3 -3
  95. package/dist/sig/mod.cjs +2 -2
  96. package/dist/sig/mod.d.cts +2 -2
  97. package/dist/sig/mod.d.ts +2 -2
  98. package/dist/sig/mod.js +2 -2
  99. package/dist/sig/owner.test.mjs +1 -1
  100. package/dist/sig/portable-collection.test.mjs +1 -1
  101. package/dist/sig/portable-interop.test.mjs +3 -3
  102. package/dist/sig/portable-key.test.mjs +5 -5
  103. package/dist/sig/proof.test.mjs +4 -4
  104. package/dist/sig/tootik-request-interop.test.mjs +4 -4
  105. package/dist/sig/tootik-send-interop.test.mjs +3 -3
  106. package/dist/sig/verification.test.mjs +3 -3
  107. package/dist/{temporal-BuMu2bgP.mjs → temporal-B7Wvxrjs.mjs} +1 -1
  108. package/dist/testing/kv.test.mjs +1 -1
  109. package/dist/testing/mod.d.mts +26 -0
  110. package/dist/{types-_S2_MeLF.js → types-DUjZb4i6.js} +112 -63
  111. package/dist/{types-poIao40f.cjs → types-hKCCjii0.cjs} +111 -62
  112. package/dist/utils/docloader.test.mjs +344 -36
  113. package/dist/utils/kv-cache.test.mjs +1 -1
  114. package/dist/utils/mod.cjs +1 -1
  115. package/dist/utils/mod.d.cts +1 -1
  116. package/dist/utils/mod.d.ts +1 -1
  117. package/dist/utils/mod.js +1 -1
  118. package/package.json +7 -7
  119. package/dist/docloader-DQNRDYDb.mjs +0 -91
@@ -12,12 +12,14 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
12
12
  import "../std__assert-DvMDRPes.mjs";
13
13
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
14
14
  import { t as assert } from "../assert-D1Eafmd_.mjs";
15
- import { y as exportJwk } from "../ld-PJLGA2MJ.mjs";
16
- import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-D7L2pqLT.mjs";
15
+ import { y as exportJwk } from "../ld-Cy5GqbvS.mjs";
16
+ import { a as formatRfc9421SignatureParameters, c as parseRfc9421SignatureInput, d as timingSafeEqual, i as formatRfc9421Signature, l as selectRequestSignature, m as verifyRequestDetailed, n as doubleKnock, o as listRequestSignatures, p as verifyRequest, r as doubleKnockScoped, s as parseRfc9421Signature, t as createRfc9421SignatureBase, u as signRequest } from "../http-DuGmr8J8.mjs";
17
17
  import { a as rsaPrivateKey3, i as rsaPrivateKey2, l as rsaPublicKey5, n as ed25519PrivateKey, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
18
18
  import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
19
+ import { configure, reset } from "@logtape/logtape";
19
20
  import { FetchError, UrlError, exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
20
21
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
22
+ import { openDirectFetch } from "@fedify/vocab-runtime/internal";
21
23
  import { encodeBase64 } from "byte-encodings/base64";
22
24
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js
23
25
  /**
@@ -1878,6 +1880,472 @@ test("doubleKnock() async specDeterminer test", async () => {
1878
1880
  assertEquals(specUsed, "draft-cavage-http-signatures-12", "Should use spec from async determiner");
1879
1881
  esm_default.hardReset();
1880
1882
  });
1883
+ const lifecycleIdentity = {
1884
+ keyId: rsaPublicKey2.id,
1885
+ privateKey: rsaPrivateKey2
1886
+ };
1887
+ test("doubleKnockScoped() keeps challenge retries and fallback in the validated hop", async () => {
1888
+ const url = "https://example.com/lifecycle/challenge-fallback";
1889
+ const hops = recordHops((_, index) => index === 1 ? {
1890
+ status: 401,
1891
+ headers: { "Accept-Signature": "challenge=(\"@method\");nonce=\"challenge-nonce\"" },
1892
+ body: "Challenge"
1893
+ } : index === 2 ? {
1894
+ status: 401,
1895
+ body: "Unauthorized"
1896
+ } : {
1897
+ status: 202,
1898
+ body: "Accepted"
1899
+ });
1900
+ assertEquals(await doubleKnockScoped(new Request(url, {
1901
+ method: "POST",
1902
+ body: "activity"
1903
+ }), lifecycleIdentity, {}, hops.openHop, (response) => response.text()), "Accepted");
1904
+ assertEquals(hops.events, [
1905
+ `open ${url}`,
1906
+ `fetch #1 ${url}`,
1907
+ "cancel #1",
1908
+ `fetch #2 ${url}`,
1909
+ "cancel #2",
1910
+ `fetch #3 ${url}`,
1911
+ "consumed #3",
1912
+ `close ${url}`
1913
+ ]);
1914
+ assertStringIncludes(hops.requests[1].headers.get("Signature-Input"), "nonce=\"challenge-nonce\"");
1915
+ assertFalse(hops.requests[2].headers.has("Signature-Input"));
1916
+ hops.assertInvariants();
1917
+ });
1918
+ test("doubleKnockScoped() reopens the session after challenge redirects", async () => {
1919
+ const url = "https://example.com/lifecycle/challenge-redirect";
1920
+ const next = "https://other.example/lifecycle/final";
1921
+ const validated = [];
1922
+ const hops = recordHops((_, index) => index === 1 ? {
1923
+ status: 401,
1924
+ headers: { "Accept-Signature": "challenge=(\"@method\");created" },
1925
+ body: "Challenge"
1926
+ } : index === 2 ? {
1927
+ status: 307,
1928
+ headers: { Location: next },
1929
+ body: "Redirect"
1930
+ } : {
1931
+ status: 200,
1932
+ body: "Done"
1933
+ });
1934
+ assertEquals(await doubleKnockScoped(new Request(url, {
1935
+ method: "POST",
1936
+ body: "activity"
1937
+ }), lifecycleIdentity, { validateRedirect: (target) => {
1938
+ validated.push(target);
1939
+ } }, hops.openHop, (response) => response.text()), "Done");
1940
+ assertEquals(validated, [next]);
1941
+ assertEquals(hops.events, [
1942
+ `open ${url}`,
1943
+ `fetch #1 ${url}`,
1944
+ "cancel #1",
1945
+ `fetch #2 ${url}`,
1946
+ "cancel #2",
1947
+ `close ${url}`,
1948
+ `open ${next}`,
1949
+ `fetch #3 ${next}`,
1950
+ "consumed #3",
1951
+ `close ${next}`
1952
+ ]);
1953
+ assertEquals(await hops.requests[2].text(), "activity");
1954
+ hops.assertInvariants();
1955
+ });
1956
+ test("doubleKnockScoped() preserves maxRedirection across challenge redirects", async (t) => {
1957
+ for (const maxRedirection of [0, 1]) await t.step(`limit ${maxRedirection}`, async () => {
1958
+ const url = "https://example.com/lifecycle/challenge-limit";
1959
+ const hops = recordHops((request, index) => index % 2 === 1 ? {
1960
+ status: 401,
1961
+ headers: { "Accept-Signature": "challenge=(\"@method\");created" },
1962
+ body: "Challenge"
1963
+ } : {
1964
+ status: 307,
1965
+ headers: { Location: `${request.url}/next` },
1966
+ body: "Redirect"
1967
+ });
1968
+ await assertRejects(() => doubleKnockScoped(new Request(url, {
1969
+ method: "POST",
1970
+ body: "activity"
1971
+ }), lifecycleIdentity, { maxRedirection }, hops.openHop, (response) => response.text()), FetchError, `Too many redirections (${maxRedirection + 1})`);
1972
+ assertEquals(hops.requests.length, 2 * (maxRedirection + 1));
1973
+ assertEquals(hops.events.filter((event) => event.startsWith("open ")).length, maxRedirection + 1);
1974
+ assertEquals(hops.events.filter((event) => event.startsWith("cancel #")).length, hops.requests.length);
1975
+ hops.assertInvariants();
1976
+ });
1977
+ });
1978
+ test("doubleKnockScoped() detects loops after challenge redirects", async () => {
1979
+ const url = "https://example.com/lifecycle/challenge-loop";
1980
+ const hops = recordHops((_, index) => index === 1 ? {
1981
+ status: 401,
1982
+ headers: { "Accept-Signature": "challenge=(\"@method\");created" },
1983
+ body: "Challenge"
1984
+ } : {
1985
+ status: 307,
1986
+ headers: { Location: url },
1987
+ body: "Redirect"
1988
+ });
1989
+ await assertRejects(() => doubleKnockScoped(new Request(url, {
1990
+ method: "POST",
1991
+ body: "activity"
1992
+ }), lifecycleIdentity, {}, hops.openHop, (response) => response.text()), FetchError, "Redirect loop detected");
1993
+ assertEquals(hops.requests.length, 2);
1994
+ assertEquals(hops.events, [
1995
+ `open ${url}`,
1996
+ `fetch #1 ${url}`,
1997
+ "cancel #1",
1998
+ `fetch #2 ${url}`,
1999
+ "cancel #2",
2000
+ `close ${url}`
2001
+ ]);
2002
+ hops.assertInvariants();
2003
+ });
2004
+ test("doubleKnockScoped() closes the session when aborted while determining the spec", async () => {
2005
+ const url = "https://example.com/lifecycle/aborted-spec";
2006
+ const hops = recordHops(() => ({
2007
+ status: 202,
2008
+ body: "Accepted"
2009
+ }));
2010
+ const controller = new AbortController();
2011
+ const reason = /* @__PURE__ */ new Error("spec determination aborted");
2012
+ assertEquals(await assertRejects(() => doubleKnockScoped(new Request(url, {
2013
+ method: "POST",
2014
+ body: "activity"
2015
+ }), lifecycleIdentity, {
2016
+ signal: controller.signal,
2017
+ specDeterminer: {
2018
+ determineSpec() {
2019
+ controller.abort(reason);
2020
+ return Promise.resolve("rfc9421");
2021
+ },
2022
+ rememberSpec: () => Promise.resolve()
2023
+ }
2024
+ }, hops.openHop, (response) => response.text()), Error, "spec determination aborted"), reason);
2025
+ assertEquals(hops.events, [`open ${url}`, `close ${url}`]);
2026
+ assertEquals(hops.requests, []);
2027
+ hops.assertInvariants();
2028
+ });
2029
+ test("doubleKnockScoped() retries another spec on the same hop", async () => {
2030
+ const url = "https://example.com/lifecycle/retry";
2031
+ const hops = recordHops((_, index) => index === 1 ? {
2032
+ status: 401,
2033
+ body: "Unauthorized"
2034
+ } : {
2035
+ status: 202,
2036
+ body: "Accepted"
2037
+ });
2038
+ assertEquals(await doubleKnockScoped(new Request(url, {
2039
+ method: "POST",
2040
+ body: "activity"
2041
+ }), lifecycleIdentity, {}, hops.openHop, (response) => response.text()), "Accepted");
2042
+ assertEquals(hops.events, [
2043
+ `open ${url}`,
2044
+ `fetch #1 ${url}`,
2045
+ "cancel #1",
2046
+ `fetch #2 ${url}`,
2047
+ "consumed #2",
2048
+ `close ${url}`
2049
+ ]);
2050
+ assertEquals(hops.requests.map((r) => r.headers.has("Signature-Input")), [true, false]);
2051
+ hops.assertInvariants();
2052
+ });
2053
+ test("doubleKnockScoped() closes the retried hop before a redirect", async () => {
2054
+ const url = "https://example.com/lifecycle/retry-redirect";
2055
+ const next = "https://example.com/lifecycle/final";
2056
+ const hops = recordHops((_, index) => index === 1 ? {
2057
+ status: 401,
2058
+ body: "Unauthorized"
2059
+ } : index === 2 ? {
2060
+ status: 302,
2061
+ headers: { Location: next },
2062
+ body: "Found"
2063
+ } : {
2064
+ status: 200,
2065
+ body: "Done"
2066
+ });
2067
+ assertEquals(await doubleKnockScoped(new Request(url, {
2068
+ method: "POST",
2069
+ body: "activity"
2070
+ }), lifecycleIdentity, {}, hops.openHop, (response) => response.text()), "Done");
2071
+ assertEquals(hops.events, [
2072
+ `open ${url}`,
2073
+ `fetch #1 ${url}`,
2074
+ "cancel #1",
2075
+ `fetch #2 ${url}`,
2076
+ "cancel #2",
2077
+ `close ${url}`,
2078
+ `open ${next}`,
2079
+ `fetch #3 ${next}`,
2080
+ "consumed #3",
2081
+ `close ${next}`
2082
+ ]);
2083
+ assertEquals(await hops.requests[2].text(), "activity");
2084
+ hops.assertInvariants();
2085
+ });
2086
+ test("doubleKnockScoped() retries transport errors on the same hop", async (t) => {
2087
+ await t.step("GET", async () => {
2088
+ const url = "https://example.com/lifecycle/flaky";
2089
+ const hops = recordHops((_, index) => {
2090
+ if (index === 1) throw new TypeError("connection reset");
2091
+ return { body: "Success" };
2092
+ });
2093
+ assertEquals(await doubleKnockScoped(new Request(url), lifecycleIdentity, {}, hops.openHop, (response) => response.text()), "Success");
2094
+ assertEquals(hops.events, [
2095
+ `open ${url}`,
2096
+ `fetch #1 ${url}`,
2097
+ `fetch #2 ${url}`,
2098
+ "consumed #2",
2099
+ `close ${url}`
2100
+ ]);
2101
+ hops.assertInvariants();
2102
+ });
2103
+ await t.step("POST", async () => {
2104
+ const url = "https://example.com/lifecycle/flaky-inbox";
2105
+ const hops = recordHops(() => {
2106
+ throw new TypeError("connection reset");
2107
+ });
2108
+ await assertRejects(() => doubleKnockScoped(new Request(url, {
2109
+ method: "POST",
2110
+ body: "activity"
2111
+ }), lifecycleIdentity, {}, hops.openHop, (response) => response.text()), FetchError);
2112
+ assertEquals(hops.events, [
2113
+ `open ${url}`,
2114
+ `fetch #1 ${url}`,
2115
+ `close ${url}`
2116
+ ]);
2117
+ hops.assertInvariants();
2118
+ });
2119
+ });
2120
+ async function captureLogs(fn) {
2121
+ const records = [];
2122
+ await configure({
2123
+ sinks: { buffer: (record) => records.push(record) },
2124
+ loggers: [{
2125
+ category: "fedify",
2126
+ sinks: ["buffer"],
2127
+ lowestLevel: "debug"
2128
+ }, {
2129
+ category: ["logtape", "meta"],
2130
+ sinks: []
2131
+ }],
2132
+ reset: true
2133
+ });
2134
+ try {
2135
+ await fn();
2136
+ await new Promise((resolve) => setTimeout(resolve, 0));
2137
+ } finally {
2138
+ await reset();
2139
+ }
2140
+ return records;
2141
+ }
2142
+ test("doubleKnockScoped() logs a redirect body failing to cancel and follows the redirect", async () => {
2143
+ const url = "https://example.com/lifecycle/cancel-failure";
2144
+ const next = "https://example.com/lifecycle/cancel-failure-final";
2145
+ const hops = recordHops((_, index) => index === 1 ? {
2146
+ status: 302,
2147
+ headers: { Location: next },
2148
+ body: "Found",
2149
+ failCancel: true
2150
+ } : {
2151
+ status: 200,
2152
+ body: "Done"
2153
+ });
2154
+ let result;
2155
+ const records = await captureLogs(async () => {
2156
+ result = await doubleKnockScoped(new Request(url), lifecycleIdentity, {}, hops.openHop, (response) => response.text());
2157
+ });
2158
+ assertEquals(result, "Done");
2159
+ assertEquals(hops.events, [
2160
+ `open ${url}`,
2161
+ `fetch #1 ${url}`,
2162
+ "cancel #1",
2163
+ `close ${url}`,
2164
+ `open ${next}`,
2165
+ `fetch #2 ${next}`,
2166
+ "consumed #2",
2167
+ `close ${next}`
2168
+ ]);
2169
+ const failures = records.filter((r) => r.rawMessage === "Failed to cancel the response body from {url}: {error}");
2170
+ assertEquals(failures.map((r) => [r.level, r.properties.url]), [["debug", url]]);
2171
+ assertEquals(failures[0].properties.error.message, "cancel #1 failed");
2172
+ hops.assertInvariants();
2173
+ });
2174
+ test("doubleKnockScoped() is not blocked by a body cancellation that never settles", async () => {
2175
+ const url = "https://example.com/lifecycle/hanging-cancel";
2176
+ const next = "https://example.com/lifecycle/hanging-cancel-final";
2177
+ const hops = recordHops((_, index) => index === 1 ? {
2178
+ status: 401,
2179
+ body: "Unauthorized",
2180
+ hangCancel: true
2181
+ } : index === 2 ? {
2182
+ status: 302,
2183
+ headers: { Location: next },
2184
+ body: "Found",
2185
+ hangCancel: true
2186
+ } : {
2187
+ status: 200,
2188
+ body: "Done",
2189
+ hangCancel: true
2190
+ });
2191
+ assertEquals(await doubleKnockScoped(new Request(url, {
2192
+ method: "POST",
2193
+ body: "activity"
2194
+ }), lifecycleIdentity, {}, hops.openHop, (response) => Promise.resolve(response.status)), 200);
2195
+ assertEquals(hops.events, [
2196
+ `open ${url}`,
2197
+ `fetch #1 ${url}`,
2198
+ "cancel #1",
2199
+ `fetch #2 ${url}`,
2200
+ "cancel #2",
2201
+ `close ${url}`,
2202
+ `open ${next}`,
2203
+ `fetch #3 ${next}`,
2204
+ "cancel #3 by close",
2205
+ `close ${next}`
2206
+ ]);
2207
+ hops.assertInvariants();
2208
+ });
2209
+ test("doubleKnockScoped() completes with responses cloned by fetch-mock", async () => {
2210
+ esm_default.spyGlobal();
2211
+ try {
2212
+ let attempts = 0;
2213
+ esm_default.post("https://example.com/tee/redirect", () => {
2214
+ attempts++;
2215
+ return attempts === 1 ? new Response("Unauthorized", { status: 401 }) : new Response("Found", {
2216
+ status: 302,
2217
+ headers: { Location: "https://example.com/tee/final" }
2218
+ });
2219
+ });
2220
+ esm_default.post("https://example.com/tee/final", () => new Response("Accepted", { status: 202 }));
2221
+ const request = () => new Request("https://example.com/tee/redirect", {
2222
+ method: "POST",
2223
+ body: "activity"
2224
+ });
2225
+ assertEquals(await doubleKnockScoped(request(), lifecycleIdentity, {}, openDirectFetch, (response) => Promise.resolve(response.status)), 202);
2226
+ assertEquals(attempts, 2);
2227
+ attempts = 0;
2228
+ const response = await doubleKnock(request(), lifecycleIdentity);
2229
+ assertEquals(response.status, 202);
2230
+ assertEquals(await response.text(), "Accepted");
2231
+ assertEquals(attempts, 2);
2232
+ } finally {
2233
+ esm_default.hardReset();
2234
+ }
2235
+ });
2236
+ test("doubleKnockScoped() closes the session when consuming fails", async (t) => {
2237
+ const url = "https://example.com/lifecycle/consume";
2238
+ await t.step("exception", async () => {
2239
+ const hops = recordHops(() => ({ body: "x".repeat(1024) }));
2240
+ const error = /* @__PURE__ */ new Error("consume failed");
2241
+ await assertRejects(() => doubleKnockScoped(new Request(url), lifecycleIdentity, {}, hops.openHop, async (response) => {
2242
+ const reader = response.body.getReader();
2243
+ await reader.read();
2244
+ reader.releaseLock();
2245
+ throw error;
2246
+ }), Error, "consume failed");
2247
+ assertEquals(hops.events, [
2248
+ `open ${url}`,
2249
+ `fetch #1 ${url}`,
2250
+ "cancel #1 by close",
2251
+ `close ${url}`
2252
+ ]);
2253
+ hops.assertInvariants();
2254
+ });
2255
+ await t.step("abort", async () => {
2256
+ const hops = recordHops(() => ({ body: "Success" }));
2257
+ const controller = new AbortController();
2258
+ const reason = /* @__PURE__ */ new Error("aborted while consuming");
2259
+ assert(await assertRejects(() => doubleKnockScoped(new Request(url), lifecycleIdentity, { signal: controller.signal }, hops.openHop, () => {
2260
+ controller.abort(reason);
2261
+ controller.signal.throwIfAborted();
2262
+ return Promise.resolve();
2263
+ })) === reason);
2264
+ assertEquals(hops.events, [
2265
+ `open ${url}`,
2266
+ `fetch #1 ${url}`,
2267
+ "cancel #1 by close",
2268
+ `close ${url}`
2269
+ ]);
2270
+ hops.assertInvariants();
2271
+ });
2272
+ });
2273
+ test("doubleKnock() returns the final response without cancelling its body", async () => {
2274
+ const url = "https://example.com/lifecycle/public";
2275
+ const next = "https://example.com/lifecycle/public-final";
2276
+ const events = [];
2277
+ const responses = [];
2278
+ const originalFetch = globalThis.fetch;
2279
+ globalThis.fetch = ((input) => {
2280
+ const requestUrl = input instanceof Request ? input.url : String(input);
2281
+ const index = responses.length + 1;
2282
+ events.push(`fetch #${index} ${requestUrl}`);
2283
+ const recorded = createRecordedResponse(events, index, requestUrl === url ? {
2284
+ status: 302,
2285
+ headers: { Location: next },
2286
+ body: "Found"
2287
+ } : {
2288
+ status: 200,
2289
+ body: "Done"
2290
+ });
2291
+ responses.push(recorded);
2292
+ return Promise.resolve(recorded.response);
2293
+ });
2294
+ try {
2295
+ const response = await doubleKnock(new Request(url), lifecycleIdentity);
2296
+ assertEquals(events, [
2297
+ `fetch #1 ${url}`,
2298
+ "cancel #1",
2299
+ `fetch #2 ${next}`
2300
+ ]);
2301
+ assertFalse(responses[1].settled());
2302
+ assertEquals(await response.text(), "Done");
2303
+ assertEquals(events.at(-1), "consumed #2");
2304
+ } finally {
2305
+ globalThis.fetch = originalFetch;
2306
+ }
2307
+ });
2308
+ test("doubleKnock() is not blocked by a body cancellation that never settles", async () => {
2309
+ const url = "https://example.com/lifecycle/public-hanging";
2310
+ const next = "https://example.com/lifecycle/public-hanging-final";
2311
+ const events = [];
2312
+ const originalFetch = globalThis.fetch;
2313
+ let index = 0;
2314
+ globalThis.fetch = ((input) => {
2315
+ const requestUrl = input instanceof Request ? input.url : String(input);
2316
+ index++;
2317
+ events.push(`fetch #${index} ${requestUrl}`);
2318
+ return Promise.resolve(createRecordedResponse(events, index, index === 1 ? {
2319
+ status: 401,
2320
+ body: "Unauthorized",
2321
+ hangCancel: true
2322
+ } : index === 2 ? {
2323
+ status: 302,
2324
+ headers: { Location: next },
2325
+ body: "Found",
2326
+ hangCancel: true
2327
+ } : {
2328
+ status: 200,
2329
+ body: "Done"
2330
+ }).response);
2331
+ });
2332
+ try {
2333
+ const response = await doubleKnock(new Request(url, {
2334
+ method: "POST",
2335
+ body: "activity"
2336
+ }), lifecycleIdentity);
2337
+ assertEquals(events, [
2338
+ `fetch #1 ${url}`,
2339
+ "cancel #1",
2340
+ `fetch #2 ${url}`,
2341
+ "cancel #2",
2342
+ `fetch #3 ${next}`
2343
+ ]);
2344
+ assertEquals(await response.text(), "Done");
2345
+ } finally {
2346
+ globalThis.fetch = originalFetch;
2347
+ }
2348
+ });
1881
2349
  test("timingSafeEqual()", async (t) => {
1882
2350
  await t.step("should return true for equal empty arrays", () => {
1883
2351
  assert(timingSafeEqual(new Uint8Array([]), new Uint8Array([])));
@@ -2737,5 +3205,88 @@ test("verifyRequestDetailed() reports a timed-out key fetch", async (t) => {
2737
3205
  }
2738
3206
  });
2739
3207
  });
3208
+ function createRecordedResponse(events, index, init, cancelSuffix = () => "") {
3209
+ const bytes = new TextEncoder().encode(init.body ?? "");
3210
+ const chunkSize = init.chunkSize ?? 256;
3211
+ let offset = 0;
3212
+ let settled = false;
3213
+ const body = new ReadableStream({
3214
+ pull(controller) {
3215
+ if (offset >= bytes.length) {
3216
+ settled = true;
3217
+ events.push(`consumed #${index}`);
3218
+ controller.close();
3219
+ return;
3220
+ }
3221
+ controller.enqueue(bytes.slice(offset, offset + chunkSize));
3222
+ offset += chunkSize;
3223
+ },
3224
+ cancel() {
3225
+ settled = true;
3226
+ events.push(`cancel #${index}${cancelSuffix()}`);
3227
+ if (init.failCancel) throw new Error(`cancel #${index} failed`);
3228
+ if (init.hangCancel) return new Promise(() => {});
3229
+ }
3230
+ }, { highWaterMark: 0 });
3231
+ return {
3232
+ response: new Response(body, {
3233
+ status: init.status ?? 200,
3234
+ headers: init.headers
3235
+ }),
3236
+ settled: () => settled
3237
+ };
3238
+ }
3239
+ function recordHops(respond) {
3240
+ const events = [];
3241
+ const requests = [];
3242
+ const unsettledAtClose = [];
3243
+ let opens = 0;
3244
+ let closes = 0;
3245
+ let fetches = 0;
3246
+ return {
3247
+ events,
3248
+ requests,
3249
+ openHop(url) {
3250
+ opens++;
3251
+ events.push(`open ${url}`);
3252
+ const tracked = [];
3253
+ let closed = false;
3254
+ let closing = false;
3255
+ return Promise.resolve({
3256
+ url: new URL(url),
3257
+ async fetch(input, init) {
3258
+ if (closed) throw new TypeError("The session is closed.");
3259
+ const request = new Request(input instanceof Request ? input.clone() : input, init);
3260
+ const index = ++fetches;
3261
+ requests.push(request);
3262
+ events.push(`fetch #${index} ${request.url}`);
3263
+ const recorded = createRecordedResponse(events, index, await respond(request, index), () => closing ? " by close" : "");
3264
+ tracked.push({
3265
+ ...recorded,
3266
+ index
3267
+ });
3268
+ return recorded.response;
3269
+ },
3270
+ close() {
3271
+ if (closed) return Promise.resolve();
3272
+ closed = true;
3273
+ closes++;
3274
+ closing = true;
3275
+ for (const { response, settled, index } of tracked) {
3276
+ if (settled()) continue;
3277
+ if (response.body?.locked) unsettledAtClose.push(index);
3278
+ else response.body?.cancel().catch(() => {});
3279
+ }
3280
+ events.push(`close ${url}`);
3281
+ return Promise.resolve();
3282
+ }
3283
+ });
3284
+ },
3285
+ assertInvariants() {
3286
+ assertEquals(opens, closes);
3287
+ assertEquals(unsettledAtClose, []);
3288
+ }
3289
+ };
3290
+ }
2740
3291
  //#endregion
2741
3292
  export {};
@@ -8,7 +8,7 @@ import "../std__assert-DvMDRPes.mjs";
8
8
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
9
9
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { C as generateCryptoKeyPair, S as fetchKeyDetailed, T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, w as importJwk, x as fetchKey, y as exportJwk } from "../ld-PJLGA2MJ.mjs";
11
+ import { C as generateCryptoKeyPair, S as fetchKeyDetailed, T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, w as importJwk, x as fetchKey, y as exportJwk } from "../ld-Cy5GqbvS.mjs";
12
12
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
13
  import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
14
14
  import { FetchError, UrlError, exportDidKey, getDocumentLoader } from "@fedify/vocab-runtime";
@@ -8,7 +8,7 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
9
9
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { C as generateCryptoKeyPair, a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-PJLGA2MJ.mjs";
11
+ import { C as generateCryptoKeyPair, a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-Cy5GqbvS.mjs";
12
12
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
13
  import { CryptographicKey } from "@fedify/vocab";
14
14
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { c as verifyPortableObjectProof } from "../proof-DNu-qP0i.mjs";
9
- import { p as verifyRequestDetailed } from "../http-D7L2pqLT.mjs";
10
- import { o as createFederation } from "../middleware-ByanhTvb.mjs";
11
- import { t as doesActorOwnKey } from "../owner-B5c276hH.mjs";
8
+ import { c as verifyPortableObjectProof } from "../proof-UN4CW55z.mjs";
9
+ import { m as verifyRequestDetailed } from "../http-DuGmr8J8.mjs";
10
+ import { o as createFederation } from "../middleware-D2fk45uN.mjs";
11
+ import { t as doesActorOwnKey } from "../owner-CbQZqFim.mjs";
12
12
  import { Create, Person } from "@fedify/vocab";
13
13
  import { canonicalizePortableUri, decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
14
14
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { c as verifyPortableObjectProof } from "../proof-DNu-qP0i.mjs";
8
- import { p as verifyRequestDetailed } from "../http-D7L2pqLT.mjs";
9
- import { t as doesActorOwnKey } from "../owner-B5c276hH.mjs";
7
+ import { c as verifyPortableObjectProof } from "../proof-UN4CW55z.mjs";
8
+ import { m as verifyRequestDetailed } from "../http-DuGmr8J8.mjs";
9
+ import { t as doesActorOwnKey } from "../owner-CbQZqFim.mjs";
10
10
  import { Create } from "@fedify/vocab";
11
11
  import { canonicalizePortableUri, decodeMultibase, fromCompatibleEf61Id, importDidKey } from "@fedify/vocab-runtime";
12
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
package/dist/sig/mod.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_http = require("../http-DLf8QYD6.cjs");
4
- const require_portable_collection = require("../portable-collection-CR5uwjws.cjs");
3
+ const require_http = require("../http-DHVH0DqC.cjs");
4
+ const require_portable_collection = require("../portable-collection-C_Kmvl3q.cjs");
5
5
  exports.attachSignature = require_http.attachSignature;
6
6
  exports.createProof = require_http.createProof;
7
7
  exports.createSignature = require_http.createSignature;
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-DYxuyd-s.cjs";
2
+ import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-VEL1QqHF.cjs";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
4
- import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-CavhAgLw.cjs";
4
+ import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-BTxJG7ZH.cjs";
5
5
  export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-C1nv7_jD.js";
2
+ import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-CyCcut3h.js";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
4
- import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-CtpF2BU5.js";
4
+ import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-CpyjFA9s.js";
5
5
  export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };