@fedify/fedify 1.10.9 → 1.10.11

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 (121) hide show
  1. package/dist/{actor-DSmY7of0.cjs → actor--xTQfY8h.cjs} +187 -187
  2. package/dist/{actor-CMBXPdjk.js → actor-B7XRaa54.js} +187 -187
  3. package/dist/{actor-z4bjwAPy.mjs → actor-CTpwJ1pI.mjs} +1 -1
  4. package/dist/{authdocloader-C7iVUcxr.mjs → authdocloader-DJ-h-WMy.mjs} +3 -3
  5. package/dist/{authdocloader-YXazGK4I.cjs → authdocloader-DMkkNwRc.cjs} +3 -3
  6. package/dist/{authdocloader-B4QKchy5.js → authdocloader-_h7VKnUP.js} +3 -3
  7. package/dist/{builder-C3PFAtTV.mjs → builder-Dx_LGmTI.mjs} +4 -4
  8. package/dist/{client-C-xdpu6M.mjs → client-DDy3-85E.mjs} +1 -1
  9. package/dist/compat/mod.cjs +1 -1
  10. package/dist/compat/mod.d.cts +1 -1
  11. package/dist/compat/mod.d.ts +1 -1
  12. package/dist/compat/transformers.test.mjs +3 -3
  13. package/dist/{context-BzSr5FCW.d.cts → context-CC4UrGc5.d.cts} +48 -6
  14. package/dist/{context-CyacVopT.d.ts → context-xfiK4xM5.d.ts} +48 -6
  15. package/dist/{docloader-DXUkyjIx.js → docloader-Ca6-eCr_.js} +121 -13
  16. package/dist/{docloader-9cG6ESUw.cjs → docloader-CvMstYam.cjs} +121 -13
  17. package/dist/{esm-Bfj-SwEx.mjs → esm-CzaH6D4W.mjs} +1 -1
  18. package/dist/federation/builder.test.mjs +3 -3
  19. package/dist/federation/collection.test.mjs +1 -1
  20. package/dist/federation/handler.test.mjs +1362 -46
  21. package/dist/federation/idempotency.test.mjs +5 -5
  22. package/dist/federation/inbox.test.mjs +3 -3
  23. package/dist/federation/keycache.test.mjs +3 -3
  24. package/dist/federation/kv.test.mjs +1 -1
  25. package/dist/federation/middleware.test.mjs +1586 -82
  26. package/dist/federation/mod.cjs +2 -2
  27. package/dist/federation/mod.d.cts +1 -1
  28. package/dist/federation/mod.d.ts +1 -1
  29. package/dist/federation/mod.js +1 -1
  30. package/dist/federation/mq.test.mjs +3 -3
  31. package/dist/federation/retry.test.mjs +2 -2
  32. package/dist/federation/router.test.mjs +2 -2
  33. package/dist/federation/send.test.mjs +8 -8
  34. package/dist/federation/temporal.test.d.mts +2 -0
  35. package/dist/federation/temporal.test.mjs +71 -0
  36. package/dist/{http-LjaXmp2m.cjs → http-B3o3SOXX.cjs} +3 -3
  37. package/dist/{http-CuloN7xQ.js → http-Bku28NB8.js} +3 -3
  38. package/dist/{http-D5CDiVKf.mjs → http-CiqAQGRx.mjs} +2 -2
  39. package/dist/{inbox-D0Mzd940.mjs → inbox-D3RCgSiJ.mjs} +7 -4
  40. package/dist/{key-B22mXs2u.cjs → key-BbdUjmdf.cjs} +2 -2
  41. package/dist/{key-B5QN42gR.mjs → key-C15RK-kf.mjs} +1 -1
  42. package/dist/{key-D1PkkNK-.js → key-CJU1QxP2.js} +2 -2
  43. package/dist/{key-CXkrXfz6.cjs → key-ClgfrNJf.cjs} +1 -1
  44. package/dist/{key-Dnc1ekhA.mjs → key-LJoRzwG2.mjs} +2 -2
  45. package/dist/{keycache-DwDRFAp7.mjs → keycache-BCuiTm4y.mjs} +1 -1
  46. package/dist/{keys-C4Ms2Cy-.mjs → keys-wZip1i2J.mjs} +1 -1
  47. package/dist/ld-BO_vEkla.mjs +548 -0
  48. package/dist/{lookup-D0d32cZH.cjs → lookup-Cs7LHObN.cjs} +1 -1
  49. package/dist/{lookup-B8rOR_1a.js → lookup-DRzvxZ-l.js} +1 -1
  50. package/dist/{lookup-Br7I7sqm.mjs → lookup-FvsTNqW8.mjs} +1 -1
  51. package/dist/{middleware-BlsPkr2X.mjs → middleware-Cdb7LDeG.mjs} +1 -1
  52. package/dist/{middleware-BbgpZrsX.mjs → middleware-CzjJsU2k.mjs} +320 -87
  53. package/dist/{middleware-0yq2uipZ.cjs → middleware-Dn5HfxXi.cjs} +411 -85
  54. package/dist/{middleware-CYNQWJ-D.js → middleware-DoM0y4tG.js} +408 -83
  55. package/dist/{middleware-BRXIidLb.cjs → middleware-SfuiAsBu.cjs} +1 -1
  56. package/dist/mod.cjs +10 -10
  57. package/dist/mod.d.cts +1 -1
  58. package/dist/mod.d.ts +1 -1
  59. package/dist/mod.js +9 -9
  60. package/dist/nodeinfo/client.test.mjs +3 -3
  61. package/dist/nodeinfo/handler.test.mjs +2 -2
  62. package/dist/nodeinfo/mod.cjs +1 -1
  63. package/dist/nodeinfo/mod.js +1 -1
  64. package/dist/nodeinfo/semver.test.mjs +1 -1
  65. package/dist/nodeinfo/types.test.mjs +1 -1
  66. package/dist/otel/exporter.test.mjs +1 -1
  67. package/dist/otel/mod.cjs +1 -1
  68. package/dist/{owner-D32qC-wF.mjs → owner-BRgVUFTA.mjs} +3 -3
  69. package/dist/{proof-u5ivh_eA.js → proof-BL5RXXp2.js} +300 -6
  70. package/dist/{proof-DE2Z0_uv.cjs → proof-BPEkbKl1.cjs} +347 -5
  71. package/dist/{proof-B67QOiuS.mjs → proof-De_2gCxi.mjs} +2 -2
  72. package/dist/runtime/authdocloader.test.mjs +6 -6
  73. package/dist/runtime/docloader.test.mjs +4 -4
  74. package/dist/runtime/key.test.mjs +3 -3
  75. package/dist/runtime/langstr.test.mjs +2 -2
  76. package/dist/runtime/link.test.mjs +2 -2
  77. package/dist/runtime/mod.cjs +3 -3
  78. package/dist/runtime/mod.js +3 -3
  79. package/dist/runtime/multibase/multibase.test.mjs +2 -2
  80. package/dist/runtime/url.test.mjs +53 -2
  81. package/dist/{send-7RGxOhrY.mjs → send-C7irF8CJ.mjs} +2 -2
  82. package/dist/sig/http.test.mjs +6 -6
  83. package/dist/sig/key.test.mjs +4 -4
  84. package/dist/sig/ld.test.mjs +561 -5
  85. package/dist/sig/mod.cjs +3 -3
  86. package/dist/sig/mod.js +3 -3
  87. package/dist/sig/owner.test.mjs +6 -6
  88. package/dist/sig/proof.test.mjs +4 -4
  89. package/dist/temporal-CtvhWksK.mjs +95 -0
  90. package/dist/testing/docloader.test.mjs +1 -1
  91. package/dist/testing/mod.d.mts +48 -6
  92. package/dist/testing/mod.mjs +1 -1
  93. package/dist/{testing-zWgaXBJW.mjs → testing-DskvUSfh.mjs} +2 -2
  94. package/dist/{transformers-BdbEtUZU.cjs → transformers-BbJsnOaL.cjs} +1 -1
  95. package/dist/{types-6_pWuZfK.js → types-B-GUdtNR.js} +1 -1
  96. package/dist/{types-ec4G8nGs.cjs → types-BWNGBD9D.cjs} +1 -1
  97. package/dist/vocab/actor.test.mjs +4 -4
  98. package/dist/vocab/cjs.test.mjs +1 -1
  99. package/dist/vocab/lookup.test.mjs +5 -5
  100. package/dist/vocab/mod.cjs +3 -3
  101. package/dist/vocab/mod.js +3 -3
  102. package/dist/vocab/type.test.mjs +2 -2
  103. package/dist/vocab/vocab.test.mjs +3 -3
  104. package/dist/{vocab-C60RNInZ.mjs → vocab-C0yDmtpE.mjs} +306 -198
  105. package/dist/webfinger/handler.test.mjs +3 -3
  106. package/dist/webfinger/lookup.test.mjs +3 -3
  107. package/dist/webfinger/mod.cjs +1 -1
  108. package/dist/webfinger/mod.js +1 -1
  109. package/dist/x/cfworkers.cjs +1 -1
  110. package/dist/x/cfworkers.test.mjs +1 -1
  111. package/dist/x/hono.cjs +1 -1
  112. package/dist/x/hono.d.cts +1 -1
  113. package/dist/x/hono.d.ts +1 -1
  114. package/dist/x/sveltekit.cjs +1 -1
  115. package/dist/x/sveltekit.d.cts +1 -1
  116. package/dist/x/sveltekit.d.ts +1 -1
  117. package/package.json +1 -1
  118. package/dist/ld-BJ8BZLC8.mjs +0 -254
  119. /package/dist/{denokv-NJPMXyK0.mjs → denokv-B0ZRIDsH.mjs} +0 -0
  120. /package/dist/{otel-0v4Zy01l.mjs → otel-D00WjYJ1.mjs} +0 -0
  121. /package/dist/{retry-Ddbq3AcK.mjs → retry-B_E3V_Dx.mjs} +0 -0
@@ -1,8 +1,8 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
- const require_docloader = require("./docloader-9cG6ESUw.cjs");
4
- const require_actor = require("./actor-DSmY7of0.cjs");
5
- const require_key = require("./key-B22mXs2u.cjs");
3
+ const require_docloader = require("./docloader-CvMstYam.cjs");
4
+ const require_actor = require("./actor--xTQfY8h.cjs");
5
+ const require_key = require("./key-BbdUjmdf.cjs");
6
6
  let _logtape_logtape = require("@logtape/logtape");
7
7
  let _opentelemetry_api = require("@opentelemetry/api");
8
8
  let jsonld = require("jsonld");
@@ -17,6 +17,288 @@ const logger$1 = (0, _logtape_logtape.getLogger)([
17
17
  "sig",
18
18
  "ld"
19
19
  ]);
20
+ const localContext = [
21
+ "https://w3id.org/identity/v1",
22
+ "https://www.w3.org/ns/activitystreams",
23
+ "https://w3id.org/security/v1",
24
+ "https://w3id.org/security/data-integrity/v1"
25
+ ];
26
+ const localContextUrls = new Set(localContext);
27
+ const builtInContextLoader = require_docloader.getDocumentLoader();
28
+ const disallowedJsonLdKeywords = new Set([
29
+ "@graph",
30
+ "@included",
31
+ "@reverse"
32
+ ]);
33
+ /** @internal */
34
+ var UnsafeJsonLdError = class extends TypeError {
35
+ constructor(keyword) {
36
+ super(`Unsupported JSON-LD keyword: ${keyword}.`);
37
+ this.keyword = keyword;
38
+ this.name = "UnsafeJsonLdError";
39
+ }
40
+ };
41
+ /** @internal */
42
+ var InvalidContextReferenceError = class extends TypeError {
43
+ constructor(reference) {
44
+ super(`Invalid JSON-LD context reference: ${reference}.`);
45
+ this.reference = reference;
46
+ this.name = "InvalidContextReferenceError";
47
+ }
48
+ };
49
+ function createLoadingRemoteContextFailedError(reference, cause) {
50
+ const message = cause instanceof Error ? cause.message : String(cause);
51
+ const error = /* @__PURE__ */ new Error(`Dereferencing a URL did not result in a valid JSON-LD context: ${reference}. ${message}`);
52
+ error.name = "jsonld.InvalidUrl";
53
+ error.details = {
54
+ code: "loading remote context failed",
55
+ url: reference
56
+ };
57
+ error.cause = cause;
58
+ return error;
59
+ }
60
+ /** @internal */
61
+ function isClearlyMalformedContextReference(reference) {
62
+ for (const char of reference) {
63
+ const code = char.charCodeAt(0);
64
+ if (code <= 32 || code === 127) return true;
65
+ }
66
+ if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(reference) && !URL.canParse(reference)) return true;
67
+ for (let i = 0; i < reference.length; i++) {
68
+ if (reference[i] !== "%") continue;
69
+ if (i + 2 >= reference.length || !/[0-9A-Fa-f]/.test(reference[i + 1]) || !/[0-9A-Fa-f]/.test(reference[i + 2])) return true;
70
+ i += 2;
71
+ }
72
+ if (reference.startsWith("./") || reference.startsWith("../") || reference.startsWith("/") || reference.startsWith("//")) {
73
+ for (const char of reference) if ("[]<>\"\\^`{|}".includes(char)) return true;
74
+ }
75
+ return false;
76
+ }
77
+ function cloneRemoteDocument(remoteDocument) {
78
+ return structuredClone(remoteDocument);
79
+ }
80
+ function createMemoizedDocumentLoader(documentLoader) {
81
+ const cache = /* @__PURE__ */ new Map();
82
+ return async (url, options) => {
83
+ const cacheKey = URL.canParse(url) ? new URL(url).href : url;
84
+ let remoteDocument = cache.get(cacheKey);
85
+ if (remoteDocument == null) {
86
+ remoteDocument = Promise.resolve(documentLoader(url, options)).then(cloneRemoteDocument);
87
+ remoteDocument.catch(() => {
88
+ if (cache.get(cacheKey) === remoteDocument) cache.delete(cacheKey);
89
+ });
90
+ cache.set(cacheKey, remoteDocument);
91
+ }
92
+ return cloneRemoteDocument(await remoteDocument);
93
+ };
94
+ }
95
+ /** @internal */
96
+ function wrapContextLoaderForJsonLd(contextLoader) {
97
+ const loader = contextLoader ?? builtInContextLoader;
98
+ return async (url, options) => {
99
+ try {
100
+ return await loader(url, options);
101
+ } catch (error) {
102
+ if (!isInvalidUrlTypeError(error)) throw error;
103
+ if (isClearlyMalformedContextReference(url)) throw new InvalidContextReferenceError(url);
104
+ throw createLoadingRemoteContextFailedError(url, error);
105
+ }
106
+ };
107
+ }
108
+ /** @internal */
109
+ function getNormalizationContextLoader(contextLoader) {
110
+ const loader = wrapContextLoaderForJsonLd(contextLoader);
111
+ return createMemoizedDocumentLoader(async (url, options) => {
112
+ if (URL.canParse(url)) {
113
+ const normalizedUrl = new URL(url).href;
114
+ if (localContextUrls.has(normalizedUrl)) return await builtInContextLoader(normalizedUrl, options);
115
+ }
116
+ return await loader(url, options);
117
+ });
118
+ }
119
+ /** @internal */
120
+ async function compactJsonLd(jsonLd, contextLoader) {
121
+ const hasLds = typeof jsonLd === "object" && jsonLd != null && "signature" in jsonLd;
122
+ const signature = hasLds ? jsonLd.signature : void 0;
123
+ const normalizationContextLoader = getNormalizationContextLoader(contextLoader);
124
+ const document = hasLds ? detachSignature(jsonLd) : jsonLd;
125
+ await assertNoGraphBeforeCompaction(document, normalizationContextLoader);
126
+ const compacted = await jsonld.default.compact(document, localContext, { documentLoader: normalizationContextLoader });
127
+ if (hasLds && typeof compacted === "object" && compacted != null) compacted.signature = signature;
128
+ assertSafeJsonLd(compacted);
129
+ return compacted;
130
+ }
131
+ function createInvalidRemoteContextError(reference) {
132
+ const error = /* @__PURE__ */ new Error(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${reference}".`);
133
+ error.name = "jsonld.InvalidUrl";
134
+ error.details = {
135
+ code: "invalid remote context",
136
+ url: reference
137
+ };
138
+ return error;
139
+ }
140
+ function getRemoteContext(remoteDocument, reference) {
141
+ const { contextUrl, documentUrl } = remoteDocument;
142
+ let { document } = remoteDocument;
143
+ if (typeof document === "string") document = JSON.parse(document);
144
+ if (typeof document !== "object" || document == null || Array.isArray(document)) throw createInvalidRemoteContextError(reference);
145
+ let context = "@context" in document ? document["@context"] : {};
146
+ if (contextUrl != null) context = Array.isArray(context) ? [...context, contextUrl] : [context, contextUrl];
147
+ return {
148
+ context,
149
+ baseUrl: documentUrl ?? reference
150
+ };
151
+ }
152
+ function createGraphAliasContextState() {
153
+ return {
154
+ graphTerms: /* @__PURE__ */ new Set(),
155
+ jsonTerms: /* @__PURE__ */ new Set(),
156
+ propertyContexts: /* @__PURE__ */ new Map(),
157
+ termTargets: /* @__PURE__ */ new Map()
158
+ };
159
+ }
160
+ function cloneGraphAliasContextState(state) {
161
+ return {
162
+ graphTerms: new Set(state.graphTerms),
163
+ jsonTerms: new Set(state.jsonTerms),
164
+ propertyContexts: new Map(state.propertyContexts),
165
+ termTargets: new Map(state.termTargets)
166
+ };
167
+ }
168
+ function resolveContextTarget(target, state) {
169
+ if (target === "@graph") return target;
170
+ const mapped = state.termTargets.get(target);
171
+ if (mapped == null) return target;
172
+ return mapped;
173
+ }
174
+ function getDirectContextTarget(definition) {
175
+ if (definition === null) return null;
176
+ if (typeof definition === "string") return definition;
177
+ if (typeof definition === "object" && definition != null && "@id" in definition) {
178
+ const id = definition["@id"];
179
+ if (id === null) return null;
180
+ if (typeof id === "string") return id;
181
+ }
182
+ }
183
+ function isJsonTypedDefinition(definition) {
184
+ return typeof definition === "object" && definition != null && "@type" in definition && definition["@type"] === "@json";
185
+ }
186
+ function resolveLocalContextTarget(target, state, localTargets, seen = /* @__PURE__ */ new Set()) {
187
+ if (target === "@graph") return target;
188
+ if (seen.has(target)) return target;
189
+ seen.add(target);
190
+ if (localTargets.has(target)) {
191
+ const localTarget = localTargets.get(target);
192
+ return localTarget == null ? target : resolveLocalContextTarget(localTarget, state, localTargets, seen);
193
+ }
194
+ return resolveContextTarget(target, state);
195
+ }
196
+ function refreshGraphAliases(state) {
197
+ state.graphTerms.clear();
198
+ for (const [term, target] of state.termTargets) if (target === "@graph") state.graphTerms.add(term);
199
+ }
200
+ function normalizeContextReference(reference, baseUrl) {
201
+ if (baseUrl != null) return new URL(reference, baseUrl).href;
202
+ return URL.canParse(reference) ? new URL(reference).href : reference;
203
+ }
204
+ /** @internal */
205
+ function isInvalidUrlTypeError(error) {
206
+ const code = error.code;
207
+ return error instanceof TypeError && (code === "ERR_INVALID_URL" || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
208
+ }
209
+ async function applyGraphAliasContext(state, context, documentLoader, remoteContextCache, baseUrl = null, processingContexts = /* @__PURE__ */ new Set()) {
210
+ if (context === null) return createGraphAliasContextState();
211
+ let nextState = cloneGraphAliasContextState(state);
212
+ if (Array.isArray(context)) {
213
+ for (const item of context) nextState = await applyGraphAliasContext(nextState, item, documentLoader, remoteContextCache, baseUrl, processingContexts);
214
+ return nextState;
215
+ }
216
+ if (typeof context === "string") {
217
+ const reference = normalizeContextReference(context, baseUrl);
218
+ const cacheKey = `${baseUrl ?? ""}\n${reference}`;
219
+ if (processingContexts.has(cacheKey)) return nextState;
220
+ processingContexts.add(cacheKey);
221
+ try {
222
+ let remoteContext = remoteContextCache.get(cacheKey);
223
+ if (remoteContext == null) {
224
+ remoteContext = (async () => {
225
+ try {
226
+ return getRemoteContext(await documentLoader(reference), reference);
227
+ } catch (error) {
228
+ if (reference === context && isInvalidUrlTypeError(error) && isClearlyMalformedContextReference(context)) throw new InvalidContextReferenceError(context);
229
+ throw error;
230
+ }
231
+ })();
232
+ remoteContextCache.set(cacheKey, remoteContext);
233
+ }
234
+ const loadedRemoteContext = await remoteContext;
235
+ return await applyGraphAliasContext(nextState, loadedRemoteContext.context, documentLoader, remoteContextCache, loadedRemoteContext.baseUrl, processingContexts);
236
+ } finally {
237
+ processingContexts.delete(cacheKey);
238
+ }
239
+ }
240
+ if (typeof context === "object" && context != null) {
241
+ if ("@import" in context && typeof context["@import"] === "string") nextState = await applyGraphAliasContext(nextState, context["@import"], documentLoader, remoteContextCache, baseUrl, processingContexts);
242
+ const localTargets = /* @__PURE__ */ new Map();
243
+ for (const [term, definition] of globalThis.Object.entries(context)) {
244
+ if (term.startsWith("@")) continue;
245
+ const target = getDirectContextTarget(definition);
246
+ if (target == null) localTargets.set(term, null);
247
+ else if (typeof target === "string") localTargets.set(term, target);
248
+ else localTargets.delete(term);
249
+ }
250
+ for (const [term, definition] of globalThis.Object.entries(context)) {
251
+ if (term.startsWith("@")) continue;
252
+ if (localTargets.has(term)) {
253
+ const directTarget = localTargets.get(term);
254
+ if (directTarget == null) nextState.termTargets.set(term, null);
255
+ else nextState.termTargets.set(term, resolveLocalContextTarget(directTarget, nextState, localTargets));
256
+ } else nextState.termTargets.delete(term);
257
+ if (typeof definition === "object" && definition != null && "@context" in definition) nextState.propertyContexts.set(term, {
258
+ context: definition["@context"],
259
+ baseUrl
260
+ });
261
+ else nextState.propertyContexts.delete(term);
262
+ if (isJsonTypedDefinition(definition)) nextState.jsonTerms.add(term);
263
+ else nextState.jsonTerms.delete(term);
264
+ }
265
+ refreshGraphAliases(nextState);
266
+ }
267
+ return nextState;
268
+ }
269
+ async function assertNoGraphBeforeCompaction(jsonLd, documentLoader, inheritedState = createGraphAliasContextState(), propertyContext, remoteContextCache = /* @__PURE__ */ new Map()) {
270
+ if (Array.isArray(jsonLd)) {
271
+ for (const item of jsonLd) await assertNoGraphBeforeCompaction(item, documentLoader, inheritedState, propertyContext, remoteContextCache);
272
+ return;
273
+ }
274
+ if (typeof jsonLd !== "object" || jsonLd == null) return;
275
+ const jsonLiteralWrapper = isJsonLiteralWrapper(jsonLd);
276
+ let state = inheritedState;
277
+ if (propertyContext !== void 0) state = await applyGraphAliasContext(state, propertyContext.context, documentLoader, remoteContextCache, propertyContext.baseUrl);
278
+ if ("@context" in jsonLd) state = await applyGraphAliasContext(state, jsonLd["@context"], documentLoader, remoteContextCache);
279
+ for (const [key, value] of globalThis.Object.entries(jsonLd)) {
280
+ if (key === "@context") continue;
281
+ if (jsonLiteralWrapper && key === "@value") continue;
282
+ if (key === "@graph" || state.graphTerms.has(key)) throw new UnsafeJsonLdError("@graph");
283
+ if (state.jsonTerms.has(key)) continue;
284
+ await assertNoGraphBeforeCompaction(value, documentLoader, state, state.propertyContexts.get(key), remoteContextCache);
285
+ }
286
+ }
287
+ function isJsonLiteralWrapper(value) {
288
+ return "@value" in value && (value["@type"] === "@json" || value.type === "@json");
289
+ }
290
+ /** @internal */
291
+ function assertSafeJsonLd(jsonLd) {
292
+ if (Array.isArray(jsonLd)) for (const item of jsonLd) assertSafeJsonLd(item);
293
+ else if (typeof jsonLd === "object" && jsonLd != null) {
294
+ const jsonLiteralWrapper = isJsonLiteralWrapper(jsonLd);
295
+ for (const [key, value] of globalThis.Object.entries(jsonLd)) {
296
+ if (disallowedJsonLdKeywords.has(key)) throw new UnsafeJsonLdError(key);
297
+ if (jsonLiteralWrapper && key === "@value") continue;
298
+ assertSafeJsonLd(value);
299
+ }
300
+ }
301
+ }
20
302
  /**
21
303
  * Attaches a LD signature to the given JSON-LD document.
22
304
  * @param jsonLd The JSON-LD document to attach the signature to. It is not
@@ -210,9 +492,21 @@ async function verifySignature(jsonLd, options = {}) {
210
492
  * @returns `true` if the document is authentic; `false` otherwise.
211
493
  */
212
494
  async function verifyJsonLd(jsonLd, options = {}) {
495
+ return await verifyJsonLdInternal(jsonLd, options, true);
496
+ }
497
+ /** @internal */
498
+ async function verifyCompactJsonLd(jsonLd, options = {}) {
499
+ return await verifyJsonLdInternal(jsonLd, options, false);
500
+ }
501
+ async function verifyJsonLdInternal(jsonLd, options, compact) {
213
502
  return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("ld_signatures.verify", async (span) => {
214
503
  try {
215
- const object = await require_actor.Object.fromJsonLd(jsonLd, options);
504
+ const verificationOptions = hasSignature(jsonLd) ? {
505
+ ...options,
506
+ contextLoader: getNormalizationContextLoader(options.contextLoader)
507
+ } : options;
508
+ const compacted = compact ? hasSignature(jsonLd) ? await compactJsonLd(jsonLd, options.contextLoader) : jsonLd : jsonLd;
509
+ const object = await require_actor.Object.fromJsonLd(compacted, verificationOptions);
216
510
  if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
217
511
  span.setAttribute("activitypub.object.type", require_actor.getTypeId(object).href);
218
512
  if (typeof jsonLd === "object" && jsonLd != null && "signature" in jsonLd && typeof jsonLd.signature === "object" && jsonLd.signature != null) {
@@ -222,7 +516,7 @@ async function verifyJsonLd(jsonLd, options = {}) {
222
516
  }
223
517
  const attributions = new Set(object.attributionIds.map((uri) => uri.href));
224
518
  if (object instanceof require_actor.Activity) for (const uri of object.actorIds) attributions.add(uri.href);
225
- const key = await verifySignature(jsonLd, options);
519
+ const key = await verifySignature(compacted, verificationOptions);
226
520
  if (key == null) return false;
227
521
  if (key.ownerId == null) {
228
522
  logger$1.debug("Key {keyId} has no owner.", { keyId: key.id?.href });
@@ -604,12 +898,30 @@ async function verifyObject(cls, jsonLd, options = {}) {
604
898
  return object;
605
899
  }
606
900
  //#endregion
901
+ Object.defineProperty(exports, "InvalidContextReferenceError", {
902
+ enumerable: true,
903
+ get: function() {
904
+ return InvalidContextReferenceError;
905
+ }
906
+ });
907
+ Object.defineProperty(exports, "assertSafeJsonLd", {
908
+ enumerable: true,
909
+ get: function() {
910
+ return assertSafeJsonLd;
911
+ }
912
+ });
607
913
  Object.defineProperty(exports, "attachSignature", {
608
914
  enumerable: true,
609
915
  get: function() {
610
916
  return attachSignature;
611
917
  }
612
918
  });
919
+ Object.defineProperty(exports, "compactJsonLd", {
920
+ enumerable: true,
921
+ get: function() {
922
+ return compactJsonLd;
923
+ }
924
+ });
613
925
  Object.defineProperty(exports, "createProof", {
614
926
  enumerable: true,
615
927
  get: function() {
@@ -640,12 +952,30 @@ Object.defineProperty(exports, "getKeyOwner", {
640
952
  return getKeyOwner;
641
953
  }
642
954
  });
955
+ Object.defineProperty(exports, "getNormalizationContextLoader", {
956
+ enumerable: true,
957
+ get: function() {
958
+ return getNormalizationContextLoader;
959
+ }
960
+ });
643
961
  Object.defineProperty(exports, "hasSignature", {
644
962
  enumerable: true,
645
963
  get: function() {
646
964
  return hasSignature;
647
965
  }
648
966
  });
967
+ Object.defineProperty(exports, "isClearlyMalformedContextReference", {
968
+ enumerable: true,
969
+ get: function() {
970
+ return isClearlyMalformedContextReference;
971
+ }
972
+ });
973
+ Object.defineProperty(exports, "isInvalidUrlTypeError", {
974
+ enumerable: true,
975
+ get: function() {
976
+ return isInvalidUrlTypeError;
977
+ }
978
+ });
649
979
  Object.defineProperty(exports, "signJsonLd", {
650
980
  enumerable: true,
651
981
  get: function() {
@@ -658,6 +988,12 @@ Object.defineProperty(exports, "signObject", {
658
988
  return signObject;
659
989
  }
660
990
  });
991
+ Object.defineProperty(exports, "verifyCompactJsonLd", {
992
+ enumerable: true,
993
+ get: function() {
994
+ return verifyCompactJsonLd;
995
+ }
996
+ });
661
997
  Object.defineProperty(exports, "verifyJsonLd", {
662
998
  enumerable: true,
663
999
  get: function() {
@@ -682,3 +1018,9 @@ Object.defineProperty(exports, "verifySignature", {
682
1018
  return verifySignature;
683
1019
  }
684
1020
  });
1021
+ Object.defineProperty(exports, "wrapContextLoaderForJsonLd", {
1022
+ enumerable: true,
1023
+ get: function() {
1024
+ return wrapContextLoaderForJsonLd;
1025
+ }
1026
+ });
@@ -1,8 +1,8 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { U as getTypeId, c as DataIntegrityProof, g as Multikey, ot as name, st as version, t as Activity } from "./vocab-C60RNInZ.mjs";
5
- import { a as validateCryptoKey, n as fetchKey } from "./key-Dnc1ekhA.mjs";
4
+ import { U as getTypeId, c as DataIntegrityProof, g as Multikey, ot as name, st as version, t as Activity } from "./vocab-C0yDmtpE.mjs";
5
+ import { a as validateCryptoKey, n as fetchKey } from "./key-LJoRzwG2.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { encodeHex } from "byte-encodings/hex";
@@ -1,15 +1,15 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { $ as UrlError } from "../vocab-C60RNInZ.mjs";
5
- import { a as mockDocumentLoader, t as test } from "../testing-zWgaXBJW.mjs";
4
+ import { $ as UrlError } from "../vocab-C0yDmtpE.mjs";
5
+ import { a as mockDocumentLoader, t as test } from "../testing-DskvUSfh.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
7
7
  import "../std__assert-2v7gYiZp.mjs";
8
8
  import { t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
9
- import { l as verifyRequest } from "../http-D5CDiVKf.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../authdocloader-C7iVUcxr.mjs";
11
- import { t as esm_default } from "../esm-Bfj-SwEx.mjs";
12
- import { i as rsaPrivateKey2 } from "../keys-C4Ms2Cy-.mjs";
9
+ import { l as verifyRequest } from "../http-CiqAQGRx.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../authdocloader-DJ-h-WMy.mjs";
11
+ import { t as esm_default } from "../esm-CzaH6D4W.mjs";
12
+ import { i as rsaPrivateKey2 } from "../keys-wZip1i2J.mjs";
13
13
  //#region src/runtime/authdocloader.test.ts
14
14
  test("getAuthenticatedDocumentLoader()", async (t) => {
15
15
  esm_default.spyGlobal();
@@ -1,16 +1,16 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { $ as UrlError, G as FetchError, J as getDocumentLoader, X as getUserAgent, Z as kvCache, at as preloadedContexts, st as version } from "../vocab-C60RNInZ.mjs";
5
- import { a as mockDocumentLoader, t as test } from "../testing-zWgaXBJW.mjs";
4
+ import { $ as UrlError, G as FetchError, J as getDocumentLoader, X as getUserAgent, Z as kvCache, at as preloadedContexts, st as version } from "../vocab-C0yDmtpE.mjs";
5
+ import { a as mockDocumentLoader, t as test } from "../testing-DskvUSfh.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
7
7
  import "../std__assert-2v7gYiZp.mjs";
8
8
  import { t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
9
9
  import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
10
10
  import { t as assert } from "../assert-DikXweDx.mjs";
11
11
  import { t as MemoryKvStore } from "../kv-OuT2IU64.mjs";
12
- import { t as esm_default } from "../esm-Bfj-SwEx.mjs";
13
- import { t as createTestTracerProvider } from "../otel-0v4Zy01l.mjs";
12
+ import { t as esm_default } from "../esm-CzaH6D4W.mjs";
13
+ import { t as createTestTracerProvider } from "../otel-D00WjYJ1.mjs";
14
14
  import process from "node:process";
15
15
  //#region src/runtime/docloader.test.ts
16
16
  test("new FetchError()", () => {
@@ -1,11 +1,11 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { F as importPkcs1, I as importSpki, M as exportSpki, N as importMultibaseKey, P as importPem, j as exportMultibaseKey } from "../vocab-C60RNInZ.mjs";
5
- import { t as test } from "../testing-zWgaXBJW.mjs";
4
+ import { F as importPkcs1, I as importSpki, M as exportSpki, N as importMultibaseKey, P as importPem, j as exportMultibaseKey } from "../vocab-C0yDmtpE.mjs";
5
+ import { t as test } from "../testing-DskvUSfh.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
7
7
  import "../std__assert-2v7gYiZp.mjs";
8
- import { i as importJwk, t as exportJwk } from "../key-Dnc1ekhA.mjs";
8
+ import { i as importJwk, t as exportJwk } from "../key-LJoRzwG2.mjs";
9
9
  //#region src/runtime/key.test.ts
10
10
  const rsaSpki = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxsRuvCkgJtflBTl4OVsm\nnt/J1mQfZasfJtN33dcZ3d1lJroxmgmMu69zjGEAwkNbMQaWNLqC4eogkJaeJ4RR\n5MHYXkL9nNilVoTkjX5BVit3puzs7XJ7WQnKQgQMI+ezn24GHsZ/v1JIo77lerX5\nk4HNwTNVt+yaZVQWaOMR3+6FwziQR6kd0VuG9/a9dgAnz2cEoORRC1i4W7IZaB1s\nZnh1WbHbevlGd72HSXll5rocPIHn8gq6xpBgpHwRphlRsgn4KHaJ6brXDIJjrnQh\nIe/YUBOGj/ImSEXhRwlFerKsoAVnZ0Hwbfa46qk44TAt8CyoPMWmpK6pt0ng4pQ2\nuwIDAQAB\n-----END PUBLIC KEY-----\n";
11
11
  const rsaPkcs1 = "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAxsRuvCkgJtflBTl4OVsmnt/J1mQfZasfJtN33dcZ3d1lJroxmgmM\nu69zjGEAwkNbMQaWNLqC4eogkJaeJ4RR5MHYXkL9nNilVoTkjX5BVit3puzs7XJ7\nWQnKQgQMI+ezn24GHsZ/v1JIo77lerX5k4HNwTNVt+yaZVQWaOMR3+6FwziQR6kd\n0VuG9/a9dgAnz2cEoORRC1i4W7IZaB1sZnh1WbHbevlGd72HSXll5rocPIHn8gq6\nxpBgpHwRphlRsgn4KHaJ6brXDIJjrnQhIe/YUBOGj/ImSEXhRwlFerKsoAVnZ0Hw\nbfa46qk44TAt8CyoPMWmpK6pt0ng4pQ2uwIDAQAB\n-----END RSA PUBLIC KEY-----\n";
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { A as LanguageString } from "../vocab-C60RNInZ.mjs";
5
- import { t as test } from "../testing-zWgaXBJW.mjs";
4
+ import { A as LanguageString } from "../vocab-C0yDmtpE.mjs";
5
+ import { t as test } from "../testing-DskvUSfh.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
7
7
  import "../std__assert-2v7gYiZp.mjs";
8
8
  import { parseLanguageTag } from "@phensley/language-tag";
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { it as HttpHeaderLink } from "../vocab-C60RNInZ.mjs";
5
- import { t as test } from "../testing-zWgaXBJW.mjs";
4
+ import { it as HttpHeaderLink } from "../vocab-C0yDmtpE.mjs";
5
+ import { t as test } from "../testing-DskvUSfh.mjs";
6
6
  import { deepStrictEqual, throws } from "node:assert";
7
7
  //#region src/runtime/link.test.ts
8
8
  test("String Good 1", () => {
@@ -1,9 +1,9 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_docloader = require("../docloader-9cG6ESUw.cjs");
5
- const require_actor = require("../actor-DSmY7of0.cjs");
6
- const require_authdocloader = require("../authdocloader-YXazGK4I.cjs");
4
+ const require_docloader = require("../docloader-CvMstYam.cjs");
5
+ const require_actor = require("../actor--xTQfY8h.cjs");
6
+ const require_authdocloader = require("../authdocloader-DMkkNwRc.cjs");
7
7
  exports.FetchError = require_docloader.FetchError;
8
8
  exports.LanguageString = require_actor.LanguageString;
9
9
  exports.exportMultibaseKey = require_actor.exportMultibaseKey;
@@ -1,6 +1,6 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
- import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "../docloader-DXUkyjIx.js";
4
- import { Ct as importPkcs1, St as importPem, bt as exportSpki, vt as LanguageString, wt as importSpki, xt as importMultibaseKey, yt as exportMultibaseKey } from "../actor-CMBXPdjk.js";
5
- import { t as getAuthenticatedDocumentLoader } from "../authdocloader-B4QKchy5.js";
3
+ import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "../docloader-Ca6-eCr_.js";
4
+ import { Ct as importPkcs1, St as importPem, bt as exportSpki, vt as LanguageString, wt as importSpki, xt as importMultibaseKey, yt as exportMultibaseKey } from "../actor-B7XRaa54.js";
5
+ import { t as getAuthenticatedDocumentLoader } from "../authdocloader-_h7VKnUP.js";
6
6
  export { FetchError, LanguageString, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { B as names, H as encodeText, L as decode, R as encode, V as decodeText, z as codes } from "../../vocab-C60RNInZ.mjs";
5
- import { t as test } from "../../testing-zWgaXBJW.mjs";
4
+ import { B as names, H as encodeText, L as decode, R as encode, V as decodeText, z as codes } from "../../vocab-C0yDmtpE.mjs";
5
+ import { t as test } from "../../testing-DskvUSfh.mjs";
6
6
  import { t as assertEquals } from "../../assert_equals-Ew3jOFa3.mjs";
7
7
  import "../../std__assert-2v7gYiZp.mjs";
8
8
  //#region src/runtime/multibase/multibase.test.ts
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { $ as UrlError, et as expandIPv6Address, nt as isValidPublicIPv6Address, rt as validatePublicUrl, tt as isValidPublicIPv4Address } from "../vocab-C60RNInZ.mjs";
5
- import { t as test } from "../testing-zWgaXBJW.mjs";
4
+ import { $ as UrlError, et as expandIPv6Address, nt as isValidPublicIPv6Address, rt as validatePublicUrl, tt as isValidPublicIPv4Address } from "../vocab-C0yDmtpE.mjs";
5
+ import { t as test } from "../testing-DskvUSfh.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
7
7
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
8
8
  import { t as assert } from "../assert-DikXweDx.mjs";
@@ -14,7 +14,24 @@ test("validatePublicUrl()", async () => {
14
14
  await assertRejects(() => validatePublicUrl("https://127.0.0.1"), UrlError);
15
15
  await assertRejects(() => validatePublicUrl("https://[::1]"), UrlError);
16
16
  await assertRejects(() => validatePublicUrl("http://[::ffff:7f00:1]/"), UrlError);
17
+ await assertRejects(() => validatePublicUrl("https://[64:ff9b::7f00:1]/"), UrlError);
18
+ await assertRejects(() => validatePublicUrl("https://[64:ff9b::a00:1]/"), UrlError);
19
+ await assertRejects(() => validatePublicUrl("https://[64:ff9b:1::a00:1]/"), UrlError);
20
+ await assertRejects(() => validatePublicUrl("https://[64:ff9b:1::808:808]/"), UrlError);
21
+ await assertRejects(() => validatePublicUrl("https://[2001::]/"), UrlError);
22
+ await assertRejects(() => validatePublicUrl("https://[2002:a00:1::]/"), UrlError);
23
+ for (const url of [
24
+ "https://100.64.0.1",
25
+ "https://198.18.0.1",
26
+ "https://224.0.0.1",
27
+ "https://240.0.0.1",
28
+ "https://192.0.2.1",
29
+ "https://192.88.99.1",
30
+ "https://198.51.100.1",
31
+ "https://203.0.113.1"
32
+ ]) await assertRejects(() => validatePublicUrl(url), UrlError);
17
33
  await validatePublicUrl("https://[2001:db8::1]");
34
+ await validatePublicUrl("https://[64:ff9b::8.8.8.8]");
18
35
  });
19
36
  test("isValidPublicIPv4Address()", () => {
20
37
  assert(isValidPublicIPv4Address("8.8.8.8"));
@@ -23,6 +40,24 @@ test("isValidPublicIPv4Address()", () => {
23
40
  assertFalse(isValidPublicIPv4Address("10.0.0.1"));
24
41
  assertFalse(isValidPublicIPv4Address("127.16.0.1"));
25
42
  assertFalse(isValidPublicIPv4Address("169.254.0.1"));
43
+ assertFalse(isValidPublicIPv4Address("100.64.0.1"));
44
+ assertFalse(isValidPublicIPv4Address("100.127.255.255"));
45
+ assertFalse(isValidPublicIPv4Address("192.0.0.1"));
46
+ assertFalse(isValidPublicIPv4Address("192.0.2.1"));
47
+ assertFalse(isValidPublicIPv4Address("192.88.99.0"));
48
+ assertFalse(isValidPublicIPv4Address("192.88.99.1"));
49
+ assertFalse(isValidPublicIPv4Address("192.88.99.2"));
50
+ assertFalse(isValidPublicIPv4Address("192.88.99.255"));
51
+ assertFalse(isValidPublicIPv4Address("198.18.0.1"));
52
+ assertFalse(isValidPublicIPv4Address("198.19.255.255"));
53
+ assertFalse(isValidPublicIPv4Address("198.51.100.1"));
54
+ assertFalse(isValidPublicIPv4Address("203.0.113.1"));
55
+ assertFalse(isValidPublicIPv4Address("224.0.0.1"));
56
+ assertFalse(isValidPublicIPv4Address("239.255.255.255"));
57
+ assertFalse(isValidPublicIPv4Address("240.0.0.1"));
58
+ assertFalse(isValidPublicIPv4Address("255.255.255.255"));
59
+ assertFalse(isValidPublicIPv4Address("1.2.3"));
60
+ assertFalse(isValidPublicIPv4Address("999.1.1.1"));
26
61
  });
27
62
  test("isValidPublicIPv6Address()", () => {
28
63
  assert(isValidPublicIPv6Address("2001:db8::1"));
@@ -32,12 +67,28 @@ test("isValidPublicIPv6Address()", () => {
32
67
  assertFalse(isValidPublicIPv6Address("ff00::1"));
33
68
  assertFalse(isValidPublicIPv6Address("::"));
34
69
  assertFalse(isValidPublicIPv6Address("::ffff:7f00:1"));
70
+ assertFalse(isValidPublicIPv6Address("64:ff9b::7f00:1"));
71
+ assertFalse(isValidPublicIPv6Address("64:ff9b::127.0.0.1"));
72
+ assertFalse(isValidPublicIPv6Address("64:ff9b::a00:1"));
73
+ assertFalse(isValidPublicIPv6Address("64:ff9b::10.0.0.1"));
74
+ assertFalse(isValidPublicIPv6Address("64:ff9b:1::"));
75
+ assertFalse(isValidPublicIPv6Address("64:ff9b:1::a00:1"));
76
+ assertFalse(isValidPublicIPv6Address("64:ff9b:1::10.0.0.1"));
77
+ assertFalse(isValidPublicIPv6Address("2001::"));
78
+ assertFalse(isValidPublicIPv6Address("2001:0:4136:e378:8000:63bf:3fff:fdd2"));
79
+ assertFalse(isValidPublicIPv6Address("2002:a00:1::"));
80
+ assertFalse(isValidPublicIPv6Address("2002:7f00:1::"));
81
+ assertFalse(isValidPublicIPv6Address("2002:c0a8:1::"));
82
+ assertFalse(isValidPublicIPv6Address("2002:a9fe:1::"));
83
+ assert(isValidPublicIPv6Address("64:ff9b::808:808"));
84
+ assert(isValidPublicIPv6Address("64:ff9b::8.8.8.8"));
35
85
  });
36
86
  test("expandIPv6Address()", () => {
37
87
  assertEquals(expandIPv6Address("::"), "0000:0000:0000:0000:0000:0000:0000:0000");
38
88
  assertEquals(expandIPv6Address("::1"), "0000:0000:0000:0000:0000:0000:0000:0001");
39
89
  assertEquals(expandIPv6Address("2001:db8::"), "2001:0db8:0000:0000:0000:0000:0000:0000");
40
90
  assertEquals(expandIPv6Address("2001:db8::1"), "2001:0db8:0000:0000:0000:0000:0000:0001");
91
+ assertEquals(expandIPv6Address("64:ff9b::8.8.8.8"), "0064:ff9b:0000:0000:0000:0000:0808:0808");
41
92
  });
42
93
  //#endregion
43
94
  export {};
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { ot as name, st as version } from "./vocab-C60RNInZ.mjs";
5
- import { n as doubleKnock } from "./http-D5CDiVKf.mjs";
4
+ import { ot as name, st as version } from "./vocab-C0yDmtpE.mjs";
5
+ import { n as doubleKnock } from "./http-CiqAQGRx.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  //#region src/federation/send.ts