@fedify/fedify 2.5.0-dev.2494 → 2.5.0-dev.2500
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/dist/{builder-Y3pokaG2.mjs → builder-SNy83ctF.mjs} +2 -2
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-BM7AINht.mjs → compound-proof-CuPaRl9U.mjs} +2 -2
- package/dist/{context-COHd1Rsh.mjs → context-A-Nde3u-.mjs} +1 -1
- package/dist/{context-DSuL3YWx.d.cts → context-De6_qvb7.d.cts} +12 -11
- package/dist/{context-DQJE9YfH.d.ts → context-TVf3fdlB.d.ts} +12 -11
- package/dist/{deno-D7blYLbb.mjs → deno-CsxrXtWa.mjs} +1 -1
- package/dist/{docloader-DbBbDaY-.mjs → docloader--D95F073.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +4 -4
- package/dist/federation/handler.test.mjs +10 -6
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox-actorless.test.mjs +55 -20
- package/dist/federation/inbox-authentication.test.mjs +112 -8
- package/dist/federation/inbox-report.test.mjs +13 -9
- package/dist/federation/inbox-view.test.mjs +1 -1
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +8 -8
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +1 -1
- package/dist/federation/outgoing-proof.test.mjs +4 -4
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-delivery.test.mjs +2 -2
- package/dist/federation/portable-gateway-keys.test.mjs +6 -6
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.mjs +2 -2
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +2 -2
- package/dist/federation/tasks/tasks.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-CFaTsSMN.cjs → federation-B-rXYPHr.cjs} +61 -49
- package/dist/{http-CxKd10Lq.mjs → http-CVDBHMLY.mjs} +4 -4
- package/dist/{http-2SwIR4b-.cjs → http-DXinHD8N.cjs} +1 -1
- package/dist/{http-CrYxBKqG.js → http-pp-ezSve.js} +1 -1
- package/dist/{inbox-CM0UktG8.mjs → inbox-DiZdzcME.mjs} +3 -3
- package/dist/{inbox-authentication-DflPYlLL.mjs → inbox-authentication-CgonVRkg.mjs} +41 -14
- package/dist/{inbox-view-BJ5DBPFo.mjs → inbox-view-BV7f1seI.mjs} +1 -1
- package/dist/{kv-cache-CIdGATck.mjs → kv-cache-BxZh__fO.mjs} +1 -1
- package/dist/{kv-cache-DbgFe35y.js → kv-cache-C30xcebA.js} +1 -1
- package/dist/{kv-cache-Cd8xKv-x.cjs → kv-cache-DYgeImco.cjs} +1 -1
- package/dist/{ld-DUeBHFWH.mjs → ld-DjN0ClIo.mjs} +2 -2
- package/dist/{metrics-B7TvoAP7.mjs → metrics-CLY7puRu.mjs} +1 -1
- package/dist/{middleware-CId6efsJ.js → middleware-BkZ-V26C.js} +53 -41
- package/dist/{middleware-BE4JXx-U.mjs → middleware-CDgUvT3j.mjs} +1 -1
- package/dist/{middleware-BEaUojg7.mjs → middleware-CM2qToci.mjs} +26 -41
- package/dist/{mod-6TQ4UQZb.d.cts → mod-oYNzF2VJ.d.cts} +1 -1
- package/dist/{mod-CIeBgsOC.d.ts → mod-xr6CN9Vz.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +2 -2
- package/dist/mod.d.ts +2 -2
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-CwijV0c5.mjs → owner-CwIAw3J7.mjs} +3 -3
- package/dist/{portable-collection-2jn_4V7Y.js → portable-collection-CG03LGR1.js} +1 -1
- package/dist/{portable-collection-BeS88JJp.cjs → portable-collection-D8I6E3WW.cjs} +1 -1
- package/dist/{portable-collection-B023xqhZ.mjs → portable-collection-DL7UprdF.mjs} +2 -2
- package/dist/{portable-key-BpBucRfb.mjs → portable-key-CH5N_5yl.mjs} +1 -1
- package/dist/{proof-DQh2z9fx.mjs → proof-WYcq-_qG.mjs} +3 -3
- package/dist/{send-DN5HNBv-.mjs → send-DvoreDHu.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +1 -1
- package/dist/sig/mitra-receive-interop.test.mjs +4 -4
- package/dist/sig/mitra-send-interop.test.mjs +3 -3
- 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/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-interop.test.mjs +3 -3
- package/dist/sig/portable-key.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/sig/tootik-request-interop.test.mjs +4 -4
- package/dist/sig/tootik-send-interop.test.mjs +3 -3
- package/dist/sig/verification.test.mjs +3 -3
- package/dist/{temporal-yl7Z7A6y.mjs → temporal-B4Y_8d0L.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +12 -11
- package/dist/testing/mod.mjs +2 -2
- package/dist/{testing-Dbr21vZk.mjs → testing-_9kJHvqh.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 +6 -6
- package/skills/fedify/SKILL.md +6 -1
|
@@ -2,7 +2,7 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { i as getPortableDid, l as isPortableId, n as getCanonicalPortableId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
+
import { n as version, t as name } from "./deno-CsxrXtWa.mjs";
|
|
6
6
|
import { t as ActivityListenerSet } from "./activity-listener-CELFAodc.mjs";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
@@ -91,7 +91,7 @@ var FederationBuilderImpl = class {
|
|
|
91
91
|
* specified.
|
|
92
92
|
*/
|
|
93
93
|
async build(options) {
|
|
94
|
-
const { FederationImpl } = await import("./middleware-
|
|
94
|
+
const { FederationImpl } = await import("./middleware-CDgUvT3j.mjs");
|
|
95
95
|
const f = new FederationImpl(options);
|
|
96
96
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
97
97
|
f.router = this.router.clone();
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { in as ActivityTransformer, n as Context } from "../context-
|
|
2
|
+
import { in as ActivityTransformer, n as Context } from "../context-De6_qvb7.cjs";
|
|
3
3
|
import { Activity } from "@fedify/vocab";
|
|
4
4
|
|
|
5
5
|
//#region src/compat/transformers.d.ts
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { in as ActivityTransformer, n as Context } from "../context-
|
|
2
|
+
import { in as ActivityTransformer, n as Context } from "../context-TVf3fdlB.js";
|
|
3
3
|
import { Activity } from "@fedify/vocab";
|
|
4
4
|
|
|
5
5
|
//#region src/compat/transformers.d.ts
|
|
@@ -5,7 +5,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
7
7
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
8
|
-
import { O as actorDehydrator, k as autoIdAssigner, n as FederationImpl } from "../middleware-
|
|
8
|
+
import { O as actorDehydrator, k as autoIdAssigner, n as FederationImpl } from "../middleware-CM2qToci.mjs";
|
|
9
9
|
import { Follow, Person } from "@fedify/vocab";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -3,9 +3,9 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { a as getRawCanonicalPortableId, l as isPortableId, n as getCanonicalPortableId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { a as verificationObservation, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
6
|
-
import { c as getNormalizationContextLoader } from "./ld-
|
|
6
|
+
import { c as getNormalizationContextLoader } from "./ld-DjN0ClIo.mjs";
|
|
7
7
|
import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
|
|
8
|
-
import { c as verifyMapLocalProof, f as verifyPortableObjectProofPolicy, m as verifyPreparedPortableObjectProofPolicy, n as classifyFep2277CoreType, o as preparePortableObjectProofPolicy } from "./proof-
|
|
8
|
+
import { c as verifyMapLocalProof, f as verifyPortableObjectProofPolicy, m as verifyPreparedPortableObjectProofPolicy, n as classifyFep2277CoreType, o as preparePortableObjectProofPolicy } from "./proof-WYcq-_qG.mjs";
|
|
9
9
|
import { parseIri, preloadedContexts } from "@fedify/vocab-runtime";
|
|
10
10
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
11
11
|
//#region src/sig/compound-proof.ts
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as mockDocumentLoader } from "./dist-DJQM4u7i.mjs";
|
|
5
5
|
import { t as isInAudience } from "./audience-CHQ-FlLD.mjs";
|
|
6
|
-
import { i as getEmptyAuthenticationEvidence } from "./inbox-authentication-
|
|
6
|
+
import { i as getEmptyAuthenticationEvidence } from "./inbox-authentication-CgonVRkg.mjs";
|
|
7
7
|
import { RouterError } from "@fedify/uri-template";
|
|
8
8
|
import { lookupObject, traverseCollection } from "@fedify/vocab";
|
|
9
9
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
@@ -77,7 +77,7 @@ type InboxAuthentication = {
|
|
|
77
77
|
* [FEP-fe34]: https://w3id.org/fep/fe34
|
|
78
78
|
* @since 2.5.0
|
|
79
79
|
*/
|
|
80
|
-
readonly type: "
|
|
80
|
+
readonly type: "activity-origin-mismatch";
|
|
81
81
|
readonly activityId: URL;
|
|
82
82
|
readonly actorIds: readonly URL[];
|
|
83
83
|
} | {
|
|
@@ -86,7 +86,7 @@ type InboxAuthentication = {
|
|
|
86
86
|
* for it, although its listener allows activities without an actor.
|
|
87
87
|
* @since 2.5.0
|
|
88
88
|
*/
|
|
89
|
-
readonly type: "
|
|
89
|
+
readonly type: "no-authenticated-principal";
|
|
90
90
|
};
|
|
91
91
|
} | {
|
|
92
92
|
readonly status: "skipped";
|
|
@@ -1155,27 +1155,27 @@ interface InboxPrincipal {
|
|
|
1155
1155
|
*
|
|
1156
1156
|
* - `"actor"`: an actor whose ownership of the verifying key Fedify
|
|
1157
1157
|
* confirmed with the actor's own document.
|
|
1158
|
-
* - `"
|
|
1158
|
+
* - `"portable-authority"`: a DID whose verification method made a valid
|
|
1159
1159
|
* Object Integrity Proof. It authenticates the [FEP-ef61] portable
|
|
1160
1160
|
* actors of that DID, and nothing else.
|
|
1161
1161
|
*
|
|
1162
1162
|
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
1163
1163
|
*/
|
|
1164
|
-
readonly kind: "actor" | "
|
|
1165
|
-
/** The actor ID, or the DID if {@link kind} is `"
|
|
1164
|
+
readonly kind: "actor" | "portable-authority";
|
|
1165
|
+
/** The actor ID, or the DID if {@link kind} is `"portable-authority"`. */
|
|
1166
1166
|
readonly id: URL;
|
|
1167
1167
|
/**
|
|
1168
1168
|
* How the principal was authenticated:
|
|
1169
1169
|
*
|
|
1170
|
-
* - `"
|
|
1171
|
-
* - `"
|
|
1170
|
+
* - `"http-signatures"`: it signed the HTTP request.
|
|
1171
|
+
* - `"linked-data-signatures"`: it made the Linked Data Signature of the
|
|
1172
1172
|
* activity.
|
|
1173
|
-
* - `"
|
|
1173
|
+
* - `"object-integrity-proofs"`: it made an Object Integrity Proof of the
|
|
1174
1174
|
* activity.
|
|
1175
1175
|
* - `"origin"`: the activity was fetched again from the actor's own web
|
|
1176
1176
|
* origin, which happens only for `Context.routeActivity()`.
|
|
1177
1177
|
*/
|
|
1178
|
-
readonly mechanism: "
|
|
1178
|
+
readonly mechanism: "http-signatures" | "linked-data-signatures" | "object-integrity-proofs" | "origin";
|
|
1179
1179
|
/** The key or verification method that authenticated the principal. */
|
|
1180
1180
|
readonly keyId: URL | null;
|
|
1181
1181
|
}
|
|
@@ -1285,12 +1285,13 @@ interface IsActorAuthenticatedOptions {
|
|
|
1285
1285
|
declare function isActorAuthenticated(evidence: InboxAuthenticationEvidence, actorId: URL, options?: IsActorAuthenticatedOptions): boolean;
|
|
1286
1286
|
/**
|
|
1287
1287
|
* A {@link InboxPrincipal} as stored in a queued message.
|
|
1288
|
+
* The wire spellings remain independent of the public API spellings.
|
|
1288
1289
|
* @internal
|
|
1289
1290
|
*/
|
|
1290
1291
|
interface SerializedInboxPrincipal {
|
|
1291
|
-
readonly kind:
|
|
1292
|
+
readonly kind: "actor" | "portableAuthority";
|
|
1292
1293
|
readonly id: string;
|
|
1293
|
-
readonly mechanism:
|
|
1294
|
+
readonly mechanism: "httpSignatures" | "linkedDataSignatures" | "objectIntegrityProofs" | "origin";
|
|
1294
1295
|
readonly keyId: string | null;
|
|
1295
1296
|
}
|
|
1296
1297
|
/**
|
|
@@ -79,7 +79,7 @@ type InboxAuthentication = {
|
|
|
79
79
|
* [FEP-fe34]: https://w3id.org/fep/fe34
|
|
80
80
|
* @since 2.5.0
|
|
81
81
|
*/
|
|
82
|
-
readonly type: "
|
|
82
|
+
readonly type: "activity-origin-mismatch";
|
|
83
83
|
readonly activityId: URL;
|
|
84
84
|
readonly actorIds: readonly URL[];
|
|
85
85
|
} | {
|
|
@@ -88,7 +88,7 @@ type InboxAuthentication = {
|
|
|
88
88
|
* for it, although its listener allows activities without an actor.
|
|
89
89
|
* @since 2.5.0
|
|
90
90
|
*/
|
|
91
|
-
readonly type: "
|
|
91
|
+
readonly type: "no-authenticated-principal";
|
|
92
92
|
};
|
|
93
93
|
} | {
|
|
94
94
|
readonly status: "skipped";
|
|
@@ -1157,27 +1157,27 @@ interface InboxPrincipal {
|
|
|
1157
1157
|
*
|
|
1158
1158
|
* - `"actor"`: an actor whose ownership of the verifying key Fedify
|
|
1159
1159
|
* confirmed with the actor's own document.
|
|
1160
|
-
* - `"
|
|
1160
|
+
* - `"portable-authority"`: a DID whose verification method made a valid
|
|
1161
1161
|
* Object Integrity Proof. It authenticates the [FEP-ef61] portable
|
|
1162
1162
|
* actors of that DID, and nothing else.
|
|
1163
1163
|
*
|
|
1164
1164
|
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
1165
1165
|
*/
|
|
1166
|
-
readonly kind: "actor" | "
|
|
1167
|
-
/** The actor ID, or the DID if {@link kind} is `"
|
|
1166
|
+
readonly kind: "actor" | "portable-authority";
|
|
1167
|
+
/** The actor ID, or the DID if {@link kind} is `"portable-authority"`. */
|
|
1168
1168
|
readonly id: URL;
|
|
1169
1169
|
/**
|
|
1170
1170
|
* How the principal was authenticated:
|
|
1171
1171
|
*
|
|
1172
|
-
* - `"
|
|
1173
|
-
* - `"
|
|
1172
|
+
* - `"http-signatures"`: it signed the HTTP request.
|
|
1173
|
+
* - `"linked-data-signatures"`: it made the Linked Data Signature of the
|
|
1174
1174
|
* activity.
|
|
1175
|
-
* - `"
|
|
1175
|
+
* - `"object-integrity-proofs"`: it made an Object Integrity Proof of the
|
|
1176
1176
|
* activity.
|
|
1177
1177
|
* - `"origin"`: the activity was fetched again from the actor's own web
|
|
1178
1178
|
* origin, which happens only for `Context.routeActivity()`.
|
|
1179
1179
|
*/
|
|
1180
|
-
readonly mechanism: "
|
|
1180
|
+
readonly mechanism: "http-signatures" | "linked-data-signatures" | "object-integrity-proofs" | "origin";
|
|
1181
1181
|
/** The key or verification method that authenticated the principal. */
|
|
1182
1182
|
readonly keyId: URL | null;
|
|
1183
1183
|
}
|
|
@@ -1287,12 +1287,13 @@ interface IsActorAuthenticatedOptions {
|
|
|
1287
1287
|
declare function isActorAuthenticated(evidence: InboxAuthenticationEvidence, actorId: URL, options?: IsActorAuthenticatedOptions): boolean;
|
|
1288
1288
|
/**
|
|
1289
1289
|
* A {@link InboxPrincipal} as stored in a queued message.
|
|
1290
|
+
* The wire spellings remain independent of the public API spellings.
|
|
1290
1291
|
* @internal
|
|
1291
1292
|
*/
|
|
1292
1293
|
interface SerializedInboxPrincipal {
|
|
1293
|
-
readonly kind:
|
|
1294
|
+
readonly kind: "actor" | "portableAuthority";
|
|
1294
1295
|
readonly id: string;
|
|
1295
|
-
readonly mechanism:
|
|
1296
|
+
readonly mechanism: "httpSignatures" | "linkedDataSignatures" | "objectIntegrityProofs" | "origin";
|
|
1296
1297
|
readonly keyId: string | null;
|
|
1297
1298
|
}
|
|
1298
1299
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { D as validateCryptoKey } from "./ld-
|
|
5
|
-
import { r as doubleKnockScoped } from "./http-
|
|
4
|
+
import { D as validateCryptoKey } from "./ld-DjN0ClIo.mjs";
|
|
5
|
+
import { r as doubleKnockScoped } from "./http-CVDBHMLY.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, resolveDocumentLoaderTimeout, withDocumentLoaderTimeout } from "@fedify/vocab-runtime";
|
|
8
8
|
import { curry } from "es-toolkit";
|
|
@@ -7,7 +7,7 @@ import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
|
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
10
|
-
import { r as createFederationBuilder } from "../builder-
|
|
10
|
+
import { r as createFederationBuilder } from "../builder-SNy83ctF.mjs";
|
|
11
11
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
12
12
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
13
13
|
import { test } from "@fedify/fixture";
|
|
@@ -6,11 +6,11 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
8
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
-
import { x as exportJwk } from "../ld-
|
|
9
|
+
import { x as exportJwk } from "../ld-DjN0ClIo.mjs";
|
|
10
10
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
11
|
-
import { h as verifyProof, s as signObject } from "../proof-
|
|
11
|
+
import { h as verifyProof, s as signObject } from "../proof-WYcq-_qG.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { n as FederationImpl } from "../middleware-
|
|
13
|
+
import { n as FederationImpl } from "../middleware-CM2qToci.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
|
|
15
15
|
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
16
16
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { r as createRequestContext, t as createInboxContext } from "../context-
|
|
4
|
+
import { r as createRequestContext, t as createInboxContext } from "../context-A-Nde3u-.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
-
import { a as compactJsonLd, h as verifyCompactJsonLd, m as signJsonLd } from "../ld-
|
|
9
|
-
import { u as signRequest } from "../http-
|
|
8
|
+
import { a as compactJsonLd, h as verifyCompactJsonLd, m as signJsonLd } from "../ld-DjN0ClIo.mjs";
|
|
9
|
+
import { u as signRequest } from "../http-CVDBHMLY.mjs";
|
|
10
10
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { f as handleInbox, o as createFederation } from "../middleware-
|
|
11
|
+
import { f as handleInbox, o as createFederation } from "../middleware-CM2qToci.mjs";
|
|
12
12
|
import { t as ActivityListenerSet } from "../activity-listener-CELFAodc.mjs";
|
|
13
13
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
14
14
|
import { Create, CryptographicKey, Multikey, Person, Update } from "@fedify/vocab";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-
|
|
4
|
+
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-A-Nde3u-.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
@@ -11,11 +11,11 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
12
12
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
13
13
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
14
|
-
import { T as generateCryptoKeyPair, a as compactJsonLd, m as signJsonLd } from "../ld-
|
|
15
|
-
import { s as signObject } from "../proof-
|
|
16
|
-
import { u as signRequest } from "../http-
|
|
14
|
+
import { T as generateCryptoKeyPair, a as compactJsonLd, m as signJsonLd } from "../ld-DjN0ClIo.mjs";
|
|
15
|
+
import { s as signObject } from "../proof-WYcq-_qG.mjs";
|
|
16
|
+
import { u as signRequest } from "../http-CVDBHMLY.mjs";
|
|
17
17
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
18
|
-
import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-
|
|
18
|
+
import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-CM2qToci.mjs";
|
|
19
19
|
import { t as ActivityListenerSet } from "../activity-listener-CELFAodc.mjs";
|
|
20
20
|
import { t as FedifySpanExporter } from "../exporter-DVG68ozH.mjs";
|
|
21
21
|
import { configure, getLogger, reset, withContext } from "@logtape/logtape";
|
|
@@ -4940,6 +4940,7 @@ test("handleInbox() nonce consumption on valid signed request", async () => {
|
|
|
4940
4940
|
});
|
|
4941
4941
|
test("handleInbox() nonce replay prevention", async () => {
|
|
4942
4942
|
const [meterProvider, recorder] = createTestMeterProvider();
|
|
4943
|
+
const [tracerProvider, spanExporter] = createTestTracerProvider();
|
|
4943
4944
|
const activity = new Create({
|
|
4944
4945
|
id: new URL("https://example.com/activities/nonce-3"),
|
|
4945
4946
|
actor: new URL("https://example.com/person2"),
|
|
@@ -4962,7 +4963,8 @@ test("handleInbox() nonce replay prevention", async () => {
|
|
|
4962
4963
|
const context = createRequestContext({
|
|
4963
4964
|
federation: createFederation({
|
|
4964
4965
|
kv: new MemoryKvStore(),
|
|
4965
|
-
meterProvider
|
|
4966
|
+
meterProvider,
|
|
4967
|
+
tracerProvider
|
|
4966
4968
|
}),
|
|
4967
4969
|
request: signedRequest,
|
|
4968
4970
|
url: new URL(signedRequest.url),
|
|
@@ -4998,6 +5000,7 @@ test("handleInbox() nonce replay prevention", async () => {
|
|
|
4998
5000
|
signatureTimeWindow: { minutes: 5 },
|
|
4999
5001
|
skipSignatureVerification: false,
|
|
5000
5002
|
meterProvider,
|
|
5003
|
+
tracerProvider,
|
|
5001
5004
|
inboxChallengePolicy: {
|
|
5002
5005
|
enabled: true,
|
|
5003
5006
|
requestNonce: true,
|
|
@@ -5011,6 +5014,7 @@ test("handleInbox() nonce replay prevention", async () => {
|
|
|
5011
5014
|
reason: { type: "invalidNonce" }
|
|
5012
5015
|
});
|
|
5013
5016
|
assertEquals(report.attempts.at(-1)?.status, "verified");
|
|
5017
|
+
assertEquals(spanExporter.getSpans("activitypub.inbox")[0].attributes["activitypub.verification.failure_reason"], "invalidNonce");
|
|
5014
5018
|
const acceptSig = response.headers.get("Accept-Signature");
|
|
5015
5019
|
assert(acceptSig != null, "Must emit fresh Accept-Signature challenge");
|
|
5016
5020
|
const parsed = parseAcceptSignature(acceptSig);
|
|
@@ -10,8 +10,8 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-
|
|
14
|
-
import { r as createFederationBuilder } from "../builder-
|
|
13
|
+
import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-CM2qToci.mjs";
|
|
14
|
+
import { r as createFederationBuilder } from "../builder-SNy83ctF.mjs";
|
|
15
15
|
import { n as RouterError } from "../router-u5O5KCQr.mjs";
|
|
16
16
|
import { Note } from "@fedify/vocab";
|
|
17
17
|
import { computeDigestMultibase, encodeMultibase, exportDidKey } from "@fedify/vocab-runtime";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
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
|
-
import { s as signObject } from "../proof-
|
|
7
|
+
import { s as signObject } from "../proof-WYcq-_qG.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-CM2qToci.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
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { a as isActorAuthenticated } from "../inbox-authentication-
|
|
4
|
+
import { a as isActorAuthenticated } from "../inbox-authentication-CgonVRkg.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
9
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
10
|
-
import { m as signJsonLd } from "../ld-
|
|
11
|
-
import { s as signObject } from "../proof-
|
|
12
|
-
import { u as signRequest } from "../http-
|
|
13
|
-
import { a as rsaPrivateKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
-
import { o as createFederation } from "../middleware-
|
|
15
|
-
import { c as expandDocument } from "../inbox-view-
|
|
16
|
-
import {
|
|
10
|
+
import { m as signJsonLd } from "../ld-DjN0ClIo.mjs";
|
|
11
|
+
import { s as signObject } from "../proof-WYcq-_qG.mjs";
|
|
12
|
+
import { u as signRequest } from "../http-CVDBHMLY.mjs";
|
|
13
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
14
|
+
import { o as createFederation } from "../middleware-CM2qToci.mjs";
|
|
15
|
+
import { c as expandDocument } from "../inbox-view-BV7f1seI.mjs";
|
|
16
|
+
import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
|
|
17
|
+
import { Create, CryptographicKey, FeatureRequest, Person } from "@fedify/vocab";
|
|
17
18
|
import { FetchError, encodeMultibase, preloadedContexts } from "@fedify/vocab-runtime";
|
|
18
|
-
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
|
+
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
20
|
import serialize from "json-canon";
|
|
20
21
|
//#region src/federation/inbox-actorless.test.ts
|
|
21
22
|
const SIGNER = new URL("https://example.com/person2");
|
|
@@ -54,6 +55,8 @@ var CapturingQueue = class {
|
|
|
54
55
|
};
|
|
55
56
|
function setup(options = {}) {
|
|
56
57
|
const received = [];
|
|
58
|
+
const reports = [];
|
|
59
|
+
const [tracerProvider, spanExporter] = createTestTracerProvider();
|
|
57
60
|
let mutableLoads = 0;
|
|
58
61
|
const loader = async (url, loaderOptions) => {
|
|
59
62
|
options.contextLoads?.push(url);
|
|
@@ -90,7 +93,8 @@ function setup(options = {}) {
|
|
|
90
93
|
return await mockDocumentLoader(url, loaderOptions);
|
|
91
94
|
};
|
|
92
95
|
const federation = createFederation({
|
|
93
|
-
kv: new MemoryKvStore(),
|
|
96
|
+
kv: options.kv ?? new MemoryKvStore(),
|
|
97
|
+
tracerProvider,
|
|
94
98
|
documentLoaderFactory: () => loader,
|
|
95
99
|
contextLoaderFactory: () => loader,
|
|
96
100
|
authenticatedDocumentLoaderFactory: () => loader,
|
|
@@ -114,10 +118,14 @@ function setup(options = {}) {
|
|
|
114
118
|
authentication: ctx.authentication,
|
|
115
119
|
rawActivity: ctx.activity
|
|
116
120
|
});
|
|
117
|
-
}, { allowActorless: options.allowActorless ?? true }).on(Create, () => {})
|
|
121
|
+
}, { allowActorless: options.allowActorless ?? true }).on(Create, () => {}).onRequestFinished((_ctx, report) => {
|
|
122
|
+
reports.push(report);
|
|
123
|
+
});
|
|
118
124
|
return {
|
|
119
125
|
federation,
|
|
120
|
-
received
|
|
126
|
+
received,
|
|
127
|
+
reports,
|
|
128
|
+
spanExporter
|
|
121
129
|
};
|
|
122
130
|
}
|
|
123
131
|
function post(body) {
|
|
@@ -201,7 +209,7 @@ test("Actorless FeatureRequest authenticated by HTTP Signatures", async () => {
|
|
|
201
209
|
]), [[
|
|
202
210
|
"actor",
|
|
203
211
|
SIGNER.href,
|
|
204
|
-
"
|
|
212
|
+
"http-signatures"
|
|
205
213
|
]]);
|
|
206
214
|
assert(isActorAuthenticated(authentication, SIGNER));
|
|
207
215
|
assertFalse(isActorAuthenticated(authentication, SIGNER, { scope: "document" }));
|
|
@@ -212,7 +220,7 @@ test("Actorless FeatureRequest authenticated by Linked Data Signatures", async (
|
|
|
212
220
|
const document = await withLds(featureRequestDocument());
|
|
213
221
|
assertEquals((await federation.fetch(post(document), { contextData: void 0 })).status, 202);
|
|
214
222
|
assertEquals(received.length, 1);
|
|
215
|
-
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "
|
|
223
|
+
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "linked-data-signatures"]]);
|
|
216
224
|
assertEquals(received[0].rawActivity, document);
|
|
217
225
|
});
|
|
218
226
|
test("Actorless FeatureRequest authenticated by Object Integrity Proofs", async () => {
|
|
@@ -228,7 +236,7 @@ test("Actorless FeatureRequest authenticated by Object Integrity Proofs", async
|
|
|
228
236
|
]), [[
|
|
229
237
|
"actor",
|
|
230
238
|
SIGNER.href,
|
|
231
|
-
"
|
|
239
|
+
"object-integrity-proofs",
|
|
232
240
|
ED25519_KEY.href
|
|
233
241
|
]]);
|
|
234
242
|
});
|
|
@@ -245,9 +253,36 @@ test("Actorless activities need an authenticated principal", async () => {
|
|
|
245
253
|
assertEquals(received, []);
|
|
246
254
|
});
|
|
247
255
|
test("Actorless activities need the same origin as their signer", async () => {
|
|
248
|
-
const { federation, received } = setup();
|
|
256
|
+
const { federation, received, reports, spanExporter } = setup();
|
|
249
257
|
assertEquals((await federation.fetch(await postSigned(featureRequestDocument({ id: "https://other.example/requests/1" })), { contextData: void 0 })).status, 401);
|
|
250
258
|
assertEquals(received, []);
|
|
259
|
+
assertEquals(reports[0].authentication, {
|
|
260
|
+
status: "rejected",
|
|
261
|
+
reason: {
|
|
262
|
+
type: "activity-origin-mismatch",
|
|
263
|
+
activityId: new URL("https://other.example/requests/1"),
|
|
264
|
+
actorIds: [SIGNER]
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
assertEquals(spanExporter.getSpans("activitypub.inbox")[0].attributes["activitypub.verification.failure_reason"], "activity-origin-mismatch");
|
|
268
|
+
});
|
|
269
|
+
test("Actorless activities reject a verified key with no authenticated principal", async () => {
|
|
270
|
+
const kv = new MemoryKvStore();
|
|
271
|
+
await new KvKeyCache(kv, ["_fedify", "publicKey"], { contextLoader: mockDocumentLoader }).set(RSA_KEY, new CryptographicKey({
|
|
272
|
+
id: RSA_KEY,
|
|
273
|
+
publicKey: rsaPublicKey3.publicKey
|
|
274
|
+
}));
|
|
275
|
+
const { federation, received, reports, spanExporter } = setup({ kv });
|
|
276
|
+
const response = await federation.fetch(await postSigned(featureRequestDocument()), { contextData: void 0 });
|
|
277
|
+
assertEquals(response.status, 401);
|
|
278
|
+
assertEquals(await response.text(), "No principal is authenticated for the activity.");
|
|
279
|
+
assertEquals(received, []);
|
|
280
|
+
assertEquals(reports[0].authentication, {
|
|
281
|
+
status: "rejected",
|
|
282
|
+
reason: { type: "no-authenticated-principal" }
|
|
283
|
+
});
|
|
284
|
+
assertEquals(reports[0].attempts.at(-1)?.status, "verified");
|
|
285
|
+
assertEquals(spanExporter.getSpans("activitypub.inbox")[0].attributes["activitypub.verification.failure_reason"], "no-authenticated-principal");
|
|
251
286
|
});
|
|
252
287
|
for (const [label, actor] of [
|
|
253
288
|
["an anonymous actor", {
|
|
@@ -372,7 +407,7 @@ test("Activities with an actor expose their evidence", async () => {
|
|
|
372
407
|
p.keyId?.href
|
|
373
408
|
]), [[
|
|
374
409
|
SIGNER.href,
|
|
375
|
-
"
|
|
410
|
+
"http-signatures",
|
|
376
411
|
RSA_KEY.href
|
|
377
412
|
]]);
|
|
378
413
|
});
|
|
@@ -382,7 +417,7 @@ test("An author's proof is preferred to a relay's Linked Data Signature", async
|
|
|
382
417
|
const document = await signJsonLd(await withRawProof(featureRequestDocument()), rsaPrivateKey2, relayKey, { contextLoader: mockDocumentLoader });
|
|
383
418
|
assertEquals((await federation.fetch(post(document), { contextData: void 0 })).status, 202);
|
|
384
419
|
assertEquals(received.length, 1);
|
|
385
|
-
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "
|
|
420
|
+
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "object-integrity-proofs"]]);
|
|
386
421
|
});
|
|
387
422
|
test("A proof that cannot be verified for now is not superseded", async () => {
|
|
388
423
|
const { federation, received } = setup({ unavailable: ["https://example.com/person2", "https://example.com/person2#key4"] });
|
|
@@ -404,7 +439,7 @@ test("Context.routeActivity() exposes the evidence of verified proofs", async ()
|
|
|
404
439
|
});
|
|
405
440
|
assert(await federation.createContext(new URL("https://example.com/"), void 0).routeActivity("alice", activity));
|
|
406
441
|
assertEquals(received.length, 1);
|
|
407
|
-
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "
|
|
442
|
+
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "object-integrity-proofs"]]);
|
|
408
443
|
assertEquals(received[0].authentication.originAuthenticated, []);
|
|
409
444
|
});
|
|
410
445
|
test("An author's aliased proof is preferred to a relay's signature", async () => {
|
|
@@ -412,7 +447,7 @@ test("An author's aliased proof is preferred to a relay's signature", async () =
|
|
|
412
447
|
const document = await signJsonLd(await withRawProof(featureRequestDocument(), "integrity"), rsaPrivateKey2, RELAY_KEY, { contextLoader: mockDocumentLoader });
|
|
413
448
|
assertEquals((await federation.fetch(post(document), { contextData: void 0 })).status, 202);
|
|
414
449
|
assertEquals(received.length, 1);
|
|
415
|
-
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "
|
|
450
|
+
assertEquals(received[0].authentication.documentSigners.map((p) => [p.id.href, p.mechanism]), [[SIGNER.href, "object-integrity-proofs"]]);
|
|
416
451
|
});
|
|
417
452
|
for (const queued of [false, true]) test(`Context.routeActivity() keeps the fetched interpretation (queued: ${queued})`, async () => {
|
|
418
453
|
const queue = queued ? new CapturingQueue() : void 0;
|