@fedify/fedify 2.3.0-pr.809.39 → 2.3.1
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.
- package/README.md +3 -0
- package/dist/{builder-NR4lKzpE.mjs → builder-hivpmhlD.mjs} +2 -2
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{deno-CPGNlj8l.mjs → deno-C8RG0HM3.mjs} +1 -1
- package/dist/{docloader-B8nIVAgc.mjs → docloader-YZA0m_3O.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +3 -3
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-D-LWifAg.cjs → http-BajqV0pH.cjs} +17 -7
- package/dist/{http-CBxlpQqr.js → http-DPOMa1DD.js} +17 -7
- package/dist/{http-DXPJbpv9.mjs → http-PCt0862M.mjs} +3 -3
- package/dist/{key-7cVn1GJd.mjs → key-BKYwmbur.mjs} +18 -8
- package/dist/{kv-cache-COHwLJGY.cjs → kv-cache-CVG3m2_-.cjs} +1 -1
- package/dist/{kv-cache-C_e_R-q_.mjs → kv-cache-Ceg0c1wh.mjs} +1 -1
- package/dist/{kv-cache-XXGgcgMy.js → kv-cache-IjRceERu.js} +1 -1
- package/dist/{ld-DIyfeBeK.mjs → ld-Dcw2skfn.mjs} +3 -3
- package/dist/{metrics-BCsIkCwT.mjs → metrics-Pue1x4ta.mjs} +1 -1
- package/dist/{middleware-YGG3vZdB.cjs → middleware-BiXEAbn2.cjs} +24 -7
- package/dist/{middleware-C4d4kOWj.js → middleware-By8lqc18.js} +24 -7
- package/dist/{middleware-SXiJl5UP.mjs → middleware-CyxqoeW9.mjs} +1 -1
- package/dist/{middleware-Bq7GPP5C.mjs → middleware-WU_5fbGS.mjs} +33 -16
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-Bz_Bbg0O.mjs → owner-pVJ0Twi7.mjs} +2 -2
- package/dist/{proof-D1AyK_PB.js → proof-DA8Kbchf.js} +1 -1
- package/dist/{proof-CPHVDi7l.cjs → proof-HzavUYxN.cjs} +1 -1
- package/dist/{proof-B4oneGAW.mjs → proof-pXYODmNV.mjs} +3 -3
- package/dist/{send-BGNF5MG3.mjs → send-BfAp60BJ.mjs} +3 -3
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +51 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +1 -1
- package/dist/{temporal-DVimxGza.mjs → temporal-HZHBbbk4.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
- package/skills/fedify/SKILL.md +0 -462
package/README.md
CHANGED
|
@@ -106,6 +106,7 @@ Here is the list of packages:
|
|
|
106
106
|
| [@fedify/create](/packages/create/) | | [npm][npm:@fedify/create] | Create a new Fedify project |
|
|
107
107
|
| [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
|
|
108
108
|
| [@fedify/astro](/packages/astro/) | [JSR][jsr:@fedify/astro] | [npm][npm:@fedify/astro] | Astro integration |
|
|
109
|
+
| [@fedify/backfill](/packages/backfill/) | [JSR][jsr:@fedify/backfill] | [npm][npm:@fedify/backfill] | ActivityPub backfill support |
|
|
109
110
|
| [@fedify/cfworkers](/packages/cfworkers/) | [JSR][jsr:@fedify/cfworkers] | [npm][npm:@fedify/cfworkers] | Cloudflare Workers integration |
|
|
110
111
|
| [@fedify/debugger](/packages/debugger/) | [JSR][jsr:@fedify/debugger] | [npm][npm:@fedify/debugger] | Embedded ActivityPub debug dashboard |
|
|
111
112
|
| [@fedify/denokv](/packages/denokv/) | [JSR][jsr:@fedify/denokv] | | Deno KV integration |
|
|
@@ -142,6 +143,8 @@ Here is the list of packages:
|
|
|
142
143
|
[npm:@fedify/amqp]: https://www.npmjs.com/package/@fedify/amqp
|
|
143
144
|
[jsr:@fedify/astro]: https://jsr.io/@fedify/astro
|
|
144
145
|
[npm:@fedify/astro]: https://www.npmjs.com/package/@fedify/astro
|
|
146
|
+
[jsr:@fedify/backfill]: https://jsr.io/@fedify/backfill
|
|
147
|
+
[npm:@fedify/backfill]: https://www.npmjs.com/package/@fedify/backfill
|
|
145
148
|
[jsr:@fedify/cfworkers]: https://jsr.io/@fedify/cfworkers
|
|
146
149
|
[npm:@fedify/cfworkers]: https://www.npmjs.com/package/@fedify/cfworkers
|
|
147
150
|
[jsr:@fedify/debugger]: https://jsr.io/@fedify/debugger
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
|
|
5
5
|
import { t as ActivityListenerSet } from "./activity-listener-tztVvlNb.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
@@ -80,7 +80,7 @@ var FederationBuilderImpl = class {
|
|
|
80
80
|
* specified.
|
|
81
81
|
*/
|
|
82
82
|
async build(options) {
|
|
83
|
-
const { FederationImpl } = await import("./middleware-
|
|
83
|
+
const { FederationImpl } = await import("./middleware-CyxqoeW9.mjs");
|
|
84
84
|
const f = new FederationImpl(options);
|
|
85
85
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
86
86
|
f.router = this.router.clone();
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
|
5
5
|
import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
|
|
6
6
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
-
import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-
|
|
8
|
+
import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-WU_5fbGS.mjs";
|
|
9
9
|
import { Follow, Person } from "@fedify/vocab";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { o as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-BKYwmbur.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-PCt0862M.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
8
8
|
import { curry } from "es-toolkit";
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
|
5
5
|
import { r as assertExists } from "../std__assert-BBjXFNOb.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
-
import { r as createFederationBuilder } from "../builder-
|
|
8
|
+
import { r as createFederationBuilder } from "../builder-hivpmhlD.mjs";
|
|
9
9
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
10
10
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
11
11
|
import { test } from "@fedify/fixture";
|
|
@@ -8,11 +8,11 @@ import { n as assertGreaterOrEqual, t as assertRejects } from "../assert_rejects
|
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
|
|
9
9
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
10
10
|
import { r as parseAcceptSignature } from "../accept-CPkZzmGN.mjs";
|
|
11
|
-
import { s as signRequest } from "../http-
|
|
11
|
+
import { s as signRequest } from "../http-PCt0862M.mjs";
|
|
12
12
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
|
|
13
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
13
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-Dcw2skfn.mjs";
|
|
14
14
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
15
|
-
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-
|
|
15
|
+
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-WU_5fbGS.mjs";
|
|
16
16
|
import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
|
|
17
17
|
import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
5
|
import "../std__assert-BBjXFNOb.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
7
|
-
import { r as signObject } from "../proof-
|
|
7
|
+
import { r as signObject } from "../proof-pXYODmNV.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-WU_5fbGS.mjs";
|
|
10
10
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
5
|
import "../std__assert-BBjXFNOb.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
|
|
7
|
-
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-
|
|
7
|
+
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-Pue1x4ta.mjs";
|
|
8
8
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
10
10
|
import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
|
|
@@ -10,15 +10,15 @@ import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
|
|
|
10
10
|
import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
|
|
11
11
|
import { t as assertStrictEquals } from "../assert_strict_equals-XEgZAlrj.mjs";
|
|
12
12
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
13
|
-
import { g as recordInboxActivity } from "../metrics-
|
|
14
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
13
|
+
import { g as recordInboxActivity } from "../metrics-Pue1x4ta.mjs";
|
|
14
|
+
import { l as verifyRequest, s as signRequest } from "../http-PCt0862M.mjs";
|
|
15
15
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
16
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
17
|
-
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-
|
|
18
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
19
|
-
import { i as verifyObject, r as signObject } from "../proof-
|
|
16
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-YZA0m_3O.mjs";
|
|
17
|
+
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-Dcw2skfn.mjs";
|
|
18
|
+
import { t as doesActorOwnKey } from "../owner-pVJ0Twi7.mjs";
|
|
19
|
+
import { i as verifyObject, r as signObject } from "../proof-pXYODmNV.mjs";
|
|
20
20
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
21
|
-
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
21
|
+
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-WU_5fbGS.mjs";
|
|
22
22
|
import { t as CircuitBreaker } from "../circuit-breaker-CSWsyoef.mjs";
|
|
23
23
|
import { configure, reset } from "@logtape/logtape";
|
|
24
24
|
import { RouterError } from "@fedify/uri-template";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("../chunk-DDcVe30Y.cjs");
|
|
5
|
-
const require_middleware = require("../middleware-
|
|
5
|
+
const require_middleware = require("../middleware-BiXEAbn2.cjs");
|
|
6
6
|
let _logtape_logtape = require("@logtape/logtape");
|
|
7
7
|
let _fedify_uri_template = require("@fedify/uri-template");
|
|
8
8
|
let es_toolkit = require("es-toolkit");
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "../middleware-
|
|
3
|
+
import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "../middleware-By8lqc18.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
|
|
6
6
|
import { isEqual } from "es-toolkit";
|
|
@@ -8,10 +8,10 @@ import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from
|
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
|
|
10
10
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
11
|
+
import { l as verifyRequest } from "../http-PCt0862M.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-pVJ0Twi7.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-BfAp60BJ.mjs";
|
|
15
15
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
16
16
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
17
17
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-BBjXFNOb.mjs";
|
|
5
5
|
import { r as assertFalse } from "../assert_rejects-DN60FHPX.mjs";
|
|
6
6
|
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-HZHBbbk4.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/temporal.test.ts
|
|
10
10
|
test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
|
6
6
|
import "../std__assert-BBjXFNOb.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-WU_5fbGS.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/webfinger.test.ts
|
|
@@ -11,7 +11,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
|
|
|
11
11
|
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
12
12
|
//#region deno.json
|
|
13
13
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.3.
|
|
14
|
+
var version = "2.3.1";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/accept.ts
|
|
17
17
|
/**
|
|
@@ -1201,21 +1201,31 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
|
|
|
1201
1201
|
const keys = cls === _fedify_vocab.CryptographicKey ? object.getPublicKeys({
|
|
1202
1202
|
documentLoader,
|
|
1203
1203
|
contextLoader,
|
|
1204
|
+
suppressError: true,
|
|
1204
1205
|
tracerProvider
|
|
1205
1206
|
}) : object.getAssertionMethods({
|
|
1206
1207
|
documentLoader,
|
|
1207
1208
|
contextLoader,
|
|
1209
|
+
suppressError: true,
|
|
1208
1210
|
tracerProvider
|
|
1209
1211
|
});
|
|
1210
1212
|
let length = 0;
|
|
1211
1213
|
let lastKey = null;
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1214
|
+
try {
|
|
1215
|
+
for await (const k of keys) {
|
|
1216
|
+
length++;
|
|
1217
|
+
lastKey = k;
|
|
1218
|
+
if (k.id?.href === keyId) {
|
|
1219
|
+
key = k;
|
|
1220
|
+
break;
|
|
1221
|
+
}
|
|
1218
1222
|
}
|
|
1223
|
+
} catch (e) {
|
|
1224
|
+
if (!(e instanceof TypeError)) throw e;
|
|
1225
|
+
logger.debug("Failed to verify; a malformed key was encountered while iterating the keys of {keyId}; treating it as a missing key: {error}", {
|
|
1226
|
+
keyId,
|
|
1227
|
+
error: e
|
|
1228
|
+
});
|
|
1219
1229
|
}
|
|
1220
1230
|
const keyIdUrl = new URL(keyId);
|
|
1221
1231
|
if (key == null && keyIdUrl.hash === "" && length === 1) key = lastKey;
|
|
@@ -10,7 +10,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
|
|
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
11
11
|
//#region deno.json
|
|
12
12
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "2.3.
|
|
13
|
+
var version = "2.3.1";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/sig/accept.ts
|
|
16
16
|
/**
|
|
@@ -1200,21 +1200,31 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
|
|
|
1200
1200
|
const keys = cls === CryptographicKey ? object.getPublicKeys({
|
|
1201
1201
|
documentLoader,
|
|
1202
1202
|
contextLoader,
|
|
1203
|
+
suppressError: true,
|
|
1203
1204
|
tracerProvider
|
|
1204
1205
|
}) : object.getAssertionMethods({
|
|
1205
1206
|
documentLoader,
|
|
1206
1207
|
contextLoader,
|
|
1208
|
+
suppressError: true,
|
|
1207
1209
|
tracerProvider
|
|
1208
1210
|
});
|
|
1209
1211
|
let length = 0;
|
|
1210
1212
|
let lastKey = null;
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1213
|
+
try {
|
|
1214
|
+
for await (const k of keys) {
|
|
1215
|
+
length++;
|
|
1216
|
+
lastKey = k;
|
|
1217
|
+
if (k.id?.href === keyId) {
|
|
1218
|
+
key = k;
|
|
1219
|
+
break;
|
|
1220
|
+
}
|
|
1217
1221
|
}
|
|
1222
|
+
} catch (e) {
|
|
1223
|
+
if (!(e instanceof TypeError)) throw e;
|
|
1224
|
+
logger.debug("Failed to verify; a malformed key was encountered while iterating the keys of {keyId}; treating it as a missing key: {error}", {
|
|
1225
|
+
keyId,
|
|
1226
|
+
error: e
|
|
1227
|
+
});
|
|
1218
1228
|
}
|
|
1219
1229
|
const keyIdUrl = new URL(keyId);
|
|
1220
1230
|
if (key == null && keyIdUrl.hash === "" && length === 1) key = lastKey;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-Pue1x4ta.mjs";
|
|
6
6
|
import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
7
|
-
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-
|
|
7
|
+
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-BKYwmbur.mjs";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { CryptographicKey } from "@fedify/vocab";
|
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
|
|
5
|
+
import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-Pue1x4ta.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -248,21 +248,31 @@ async function resolveFetchedKey(document, cacheKey, keyId, cls, { documentLoade
|
|
|
248
248
|
const keys = cls === CryptographicKey ? object.getPublicKeys({
|
|
249
249
|
documentLoader,
|
|
250
250
|
contextLoader,
|
|
251
|
+
suppressError: true,
|
|
251
252
|
tracerProvider
|
|
252
253
|
}) : object.getAssertionMethods({
|
|
253
254
|
documentLoader,
|
|
254
255
|
contextLoader,
|
|
256
|
+
suppressError: true,
|
|
255
257
|
tracerProvider
|
|
256
258
|
});
|
|
257
259
|
let length = 0;
|
|
258
260
|
let lastKey = null;
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
try {
|
|
262
|
+
for await (const k of keys) {
|
|
263
|
+
length++;
|
|
264
|
+
lastKey = k;
|
|
265
|
+
if (k.id?.href === keyId) {
|
|
266
|
+
key = k;
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
265
269
|
}
|
|
270
|
+
} catch (e) {
|
|
271
|
+
if (!(e instanceof TypeError)) throw e;
|
|
272
|
+
logger.debug("Failed to verify; a malformed key was encountered while iterating the keys of {keyId}; treating it as a missing key: {error}", {
|
|
273
|
+
keyId,
|
|
274
|
+
error: e
|
|
275
|
+
});
|
|
266
276
|
}
|
|
267
277
|
const keyIdUrl = new URL(keyId);
|
|
268
278
|
if (key == null && keyIdUrl.hash === "" && length === 1) key = lastKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-BajqV0pH.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { p as recordDocumentCache } from "./metrics-
|
|
4
|
+
import { p as recordDocumentCache } from "./metrics-Pue1x4ta.mjs";
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
6
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/utils/kv-cache.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { C as recordDocumentCache, d as validateCryptoKey, t as doubleKnock } from "./http-
|
|
3
|
+
import { C as recordDocumentCache, d as validateCryptoKey, t as doubleKnock } from "./http-DPOMa1DD.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { curry } from "es-toolkit";
|
|
6
6
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
6
|
-
import { n as fetchKey, o as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
|
|
5
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-Pue1x4ta.mjs";
|
|
6
|
+
import { n as fetchKey, o as validateCryptoKey } from "./key-BKYwmbur.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
|
|
5
5
|
import { metrics } from "@opentelemetry/api";
|
|
6
6
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/federation/metrics.ts
|
|
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
5
|
-
const require_http = require("./http-
|
|
6
|
-
const require_proof = require("./proof-
|
|
5
|
+
const require_http = require("./http-BajqV0pH.cjs");
|
|
6
|
+
const require_proof = require("./proof-HzavUYxN.cjs");
|
|
7
7
|
const require_types = require("./types-KC4QAoxe.cjs");
|
|
8
|
-
const require_kv_cache = require("./kv-cache-
|
|
8
|
+
const require_kv_cache = require("./kv-cache-CVG3m2_-.cjs");
|
|
9
9
|
let _logtape_logtape = require("@logtape/logtape");
|
|
10
10
|
let _fedify_uri_template = require("@fedify/uri-template");
|
|
11
11
|
let _fedify_vocab = require("@fedify/vocab");
|
|
@@ -3860,6 +3860,15 @@ function isPermanentRemoteContextError(error) {
|
|
|
3860
3860
|
function isPermanentInboxParseError(error) {
|
|
3861
3861
|
return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof require_proof.InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:)/.test(error.message) || require_proof.isInvalidUrlTypeError(error));
|
|
3862
3862
|
}
|
|
3863
|
+
function hasLinkedDataSignatureJsonLdProcessingError(error) {
|
|
3864
|
+
if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
|
|
3865
|
+
const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
|
|
3866
|
+
if (error.name === "jsonld.InvalidUrl" && error.details?.code === "loading remote context failed" && cause instanceof Error) return cause.message.startsWith("Maximum deep iterations exceeded") || cause.name.startsWith("jsonld.");
|
|
3867
|
+
return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
|
|
3868
|
+
}
|
|
3869
|
+
function isLinkedDataSignatureJsonLdProcessingError(error) {
|
|
3870
|
+
return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
|
|
3871
|
+
}
|
|
3863
3872
|
/**
|
|
3864
3873
|
* Create a new {@link Federation} instance.
|
|
3865
3874
|
* @param options Parameters for initializing the instance.
|
|
@@ -4894,10 +4903,18 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
4894
4903
|
privateKey: pair.privateKey
|
|
4895
4904
|
}))
|
|
4896
4905
|
});
|
|
4897
|
-
else
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4906
|
+
else try {
|
|
4907
|
+
jsonLd = await require_proof.signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
|
|
4908
|
+
contextLoader,
|
|
4909
|
+
tracerProvider: this.tracerProvider
|
|
4910
|
+
});
|
|
4911
|
+
} catch (error) {
|
|
4912
|
+
if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
|
|
4913
|
+
logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
|
|
4914
|
+
activityId,
|
|
4915
|
+
error
|
|
4916
|
+
});
|
|
4917
|
+
}
|
|
4901
4918
|
if (!hasProof) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
|
|
4902
4919
|
activityId,
|
|
4903
4920
|
keys: keys.map((pair) => ({
|
|
@@ -2,10 +2,10 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { t as __exportAll } from "./chunk-CRNNMoPX.js";
|
|
4
4
|
import { r as getDefaultActivityTransformers } from "./transformers-BGMIq1cs.js";
|
|
5
|
-
import { A as formatAcceptSignature, D as recordOutboxEnqueue, E as recordOutboxActivity, F as version, O as recordWebFingerHandle, P as name, S as recordCollectionTotalItems, T as recordInboxActivity, a as verifyRequestDetailed, b as recordCollectionPageItems, d as validateCryptoKey, f as getDurationMs, g as isAbortError, h as instrumentDocumentLoader, i as verifyRequest, k as registerQueueDepthGauge, m as getRemoteHost, n as parseRfc9421SignatureInput, o as exportJwk, p as getFederationMetrics, t as doubleKnock, u as importJwk, v as recordCircuitBreakerStateChange, w as recordFanoutRecipients, x as recordCollectionRequest, y as recordCollectionDispatchDuration } from "./http-
|
|
6
|
-
import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-
|
|
5
|
+
import { A as formatAcceptSignature, D as recordOutboxEnqueue, E as recordOutboxActivity, F as version, O as recordWebFingerHandle, P as name, S as recordCollectionTotalItems, T as recordInboxActivity, a as verifyRequestDetailed, b as recordCollectionPageItems, d as validateCryptoKey, f as getDurationMs, g as isAbortError, h as instrumentDocumentLoader, i as verifyRequest, k as registerQueueDepthGauge, m as getRemoteHost, n as parseRfc9421SignatureInput, o as exportJwk, p as getFederationMetrics, t as doubleKnock, u as importJwk, v as recordCircuitBreakerStateChange, w as recordFanoutRecipients, x as recordCollectionRequest, y as recordCollectionDispatchDuration } from "./http-DPOMa1DD.js";
|
|
6
|
+
import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-DA8Kbchf.js";
|
|
7
7
|
import { n as getNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
|
|
8
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
8
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-IjRceERu.js";
|
|
9
9
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
10
10
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
@@ -3859,6 +3859,15 @@ function isPermanentRemoteContextError(error) {
|
|
|
3859
3859
|
function isPermanentInboxParseError(error) {
|
|
3860
3860
|
return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:)/.test(error.message) || isInvalidUrlTypeError(error));
|
|
3861
3861
|
}
|
|
3862
|
+
function hasLinkedDataSignatureJsonLdProcessingError(error) {
|
|
3863
|
+
if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
|
|
3864
|
+
const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
|
|
3865
|
+
if (error.name === "jsonld.InvalidUrl" && error.details?.code === "loading remote context failed" && cause instanceof Error) return cause.message.startsWith("Maximum deep iterations exceeded") || cause.name.startsWith("jsonld.");
|
|
3866
|
+
return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
|
|
3867
|
+
}
|
|
3868
|
+
function isLinkedDataSignatureJsonLdProcessingError(error) {
|
|
3869
|
+
return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
|
|
3870
|
+
}
|
|
3862
3871
|
/**
|
|
3863
3872
|
* Create a new {@link Federation} instance.
|
|
3864
3873
|
* @param options Parameters for initializing the instance.
|
|
@@ -4893,10 +4902,18 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
4893
4902
|
privateKey: pair.privateKey
|
|
4894
4903
|
}))
|
|
4895
4904
|
});
|
|
4896
|
-
else
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4905
|
+
else try {
|
|
4906
|
+
jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
|
|
4907
|
+
contextLoader,
|
|
4908
|
+
tracerProvider: this.tracerProvider
|
|
4909
|
+
});
|
|
4910
|
+
} catch (error) {
|
|
4911
|
+
if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
|
|
4912
|
+
logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
|
|
4913
|
+
activityId,
|
|
4914
|
+
error
|
|
4915
|
+
});
|
|
4916
|
+
}
|
|
4900
4917
|
if (!hasProof) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
|
|
4901
4918
|
activityId,
|
|
4902
4919
|
keys: keys.map((pair) => ({
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-
|
|
4
|
+
import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
|
|
5
|
+
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-Pue1x4ta.mjs";
|
|
6
6
|
import { t as formatAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
7
|
-
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-
|
|
8
|
-
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-
|
|
9
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
10
|
-
import { n as kvCache } from "./kv-cache-
|
|
11
|
-
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-
|
|
12
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
7
|
+
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-BKYwmbur.mjs";
|
|
8
|
+
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-PCt0862M.mjs";
|
|
9
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-YZA0m_3O.mjs";
|
|
10
|
+
import { n as kvCache } from "./kv-cache-Ceg0c1wh.mjs";
|
|
11
|
+
import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-Dcw2skfn.mjs";
|
|
12
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-pVJ0Twi7.mjs";
|
|
13
13
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-L_DbOaFe.mjs";
|
|
14
|
-
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-
|
|
14
|
+
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-pXYODmNV.mjs";
|
|
15
15
|
import { t as getNodeInfo } from "./client-ByXmQhYD.mjs";
|
|
16
16
|
import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
|
|
17
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
18
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
17
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BfAp60BJ.mjs";
|
|
18
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-hivpmhlD.mjs";
|
|
19
19
|
import { t as CircuitBreaker } from "./circuit-breaker-CSWsyoef.mjs";
|
|
20
20
|
import { t as buildCollectionSynchronizationHeader } from "./collection-Cc3DVAhE.mjs";
|
|
21
21
|
import { t as KvKeyCache } from "./keycache-BeU0LCII.mjs";
|
|
22
22
|
import { t as acceptsJsonLd } from "./negotiation-DDstyBvc.mjs";
|
|
23
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
23
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-HZHBbbk4.mjs";
|
|
24
24
|
import { t as createExponentialBackoffPolicy } from "./retry-CXg_MBI-.mjs";
|
|
25
25
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
26
26
|
import { RouterError } from "@fedify/uri-template";
|
|
@@ -2392,6 +2392,15 @@ function isPermanentRemoteContextError(error) {
|
|
|
2392
2392
|
function isPermanentInboxParseError(error) {
|
|
2393
2393
|
return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:|Invalid @id:)/.test(error.message) || isInvalidUrlTypeError(error));
|
|
2394
2394
|
}
|
|
2395
|
+
function hasLinkedDataSignatureJsonLdProcessingError(error) {
|
|
2396
|
+
if (error.message.startsWith("Maximum deep iterations exceeded")) return true;
|
|
2397
|
+
const cause = error.cause instanceof Error ? error.cause : error.details?.cause;
|
|
2398
|
+
if (error.name === "jsonld.InvalidUrl" && error.details?.code === "loading remote context failed" && cause instanceof Error) return cause.message.startsWith("Maximum deep iterations exceeded") || cause.name.startsWith("jsonld.");
|
|
2399
|
+
return error.name !== "jsonld.InvalidUrl" && error.name.startsWith("jsonld.");
|
|
2400
|
+
}
|
|
2401
|
+
function isLinkedDataSignatureJsonLdProcessingError(error) {
|
|
2402
|
+
return error instanceof Error && hasLinkedDataSignatureJsonLdProcessingError(error);
|
|
2403
|
+
}
|
|
2395
2404
|
/**
|
|
2396
2405
|
* Create a new {@link Federation} instance.
|
|
2397
2406
|
* @param options Parameters for initializing the instance.
|
|
@@ -3426,10 +3435,18 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3426
3435
|
privateKey: pair.privateKey
|
|
3427
3436
|
}))
|
|
3428
3437
|
});
|
|
3429
|
-
else
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3438
|
+
else try {
|
|
3439
|
+
jsonLd = await signJsonLd(jsonLd, rsaKey.privateKey, rsaKey.keyId, {
|
|
3440
|
+
contextLoader,
|
|
3441
|
+
tracerProvider: this.tracerProvider
|
|
3442
|
+
});
|
|
3443
|
+
} catch (error) {
|
|
3444
|
+
if (!isLinkedDataSignatureJsonLdProcessingError(error)) throw error;
|
|
3445
|
+
logger.warn("Failed to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature.", {
|
|
3446
|
+
activityId,
|
|
3447
|
+
error
|
|
3448
|
+
});
|
|
3449
|
+
}
|
|
3433
3450
|
if (!hasProof) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
|
|
3434
3451
|
activityId,
|
|
3435
3452
|
keys: keys.map((pair) => ({
|