@fedify/fedify 2.4.0-dev.2035 → 2.4.0-dev.2047
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-CxB0RNUS.mjs → builder-Cue1kVHU.mjs} +12 -11
- 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-DAEfpSL-.mjs → compound-proof-YT4tajyj.mjs} +1 -1
- package/dist/{context-uyRUWoZQ.d.ts → context-BJPHhBmD.d.ts} +100 -2
- package/dist/{context-BeDnDuF3.d.cts → context-Bh_mJfbD.d.cts} +100 -2
- package/dist/{context-CbS35fLr.mjs → context-DG5QeQ8W.mjs} +3 -1
- package/dist/{deno-ByRFTNQR.mjs → deno-Dcj6O4LJ.mjs} +1 -1
- package/dist/{docloader-CQ8Edzd4.mjs → docloader-BRlNjHlQ.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 +6 -6
- package/dist/federation/idempotency.test.mjs +2 -2
- 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 +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +5 -5
- package/dist/federation/portable.test.d.mts +2 -0
- package/dist/federation/portable.test.mjs +430 -0
- 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 +115 -2
- package/dist/{federation-Bxy5QoWo.cjs → federation-Bdu06LEl.cjs} +324 -26
- package/dist/{http-BMAvWfcv.js → http-BmdqHyms.js} +1 -1
- package/dist/{http--RCp5CRI.cjs → http-CGjvl34X.cjs} +1 -1
- package/dist/{http-BZl8ShOJ.mjs → http-CK6kjLnO.mjs} +3 -3
- package/dist/{key-BeFBBxpa.mjs → key-CzCAq6D9.mjs} +2 -2
- package/dist/{kv-cache-yChGryXN.cjs → kv-cache-CvEicbrf.cjs} +1 -1
- package/dist/{kv-cache-D_2ZatKb.mjs → kv-cache-YATuzCy-.mjs} +1 -1
- package/dist/{kv-cache-CnAYugy5.js → kv-cache-fi_-XZco.js} +1 -1
- package/dist/{ld-BepC--ab.mjs → ld-CNWm8mJc.mjs} +3 -3
- package/dist/{metrics-eZ0bEvxw.mjs → metrics-CDoBPWjf.mjs} +1 -1
- package/dist/{middleware-DDFdZjkU.mjs → middleware-CF6uz8wa.mjs} +1 -1
- package/dist/{middleware-8c3mI8D0.mjs → middleware-CtFNjIUD.mjs} +326 -28
- package/dist/{middleware-CeK467Oy.js → middleware-Drzx-OID.js} +325 -27
- package/dist/{mod-D882_Xsg.d.ts → mod-BofpDIcU.d.ts} +1 -1
- package/dist/{mod-x9W0d0Pk.d.cts → mod-DU8aVzQJ.d.cts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-DZOj3ivi.mjs → owner-B3PgGiJ1.mjs} +2 -2
- package/dist/{owner-DS-Bz_zW.js → owner-CMnmv7S9.js} +16 -3
- package/dist/{owner-DwF4aZoy.cjs → owner-Hurn_ocn.cjs} +16 -3
- package/dist/{proof-DyPuryze.mjs → proof-fKycdssC.mjs} +18 -5
- package/dist/{send-jgopmjWM.mjs → send-BqBILxYE.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 +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 +208 -1
- package/dist/{temporal-DjFCwpqJ.mjs → temporal-SUiLJ0Co.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +99 -1
- package/dist/testing/mod.mjs +2 -2
- package/dist/{testing-hbky2gMN.mjs → testing-By1YYsIK.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "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-Dcj6O4LJ.mjs";
|
|
5
5
|
import { t as ActivityListenerSet } from "./activity-listener-C-BSbKI7.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
@@ -85,7 +85,7 @@ var FederationBuilderImpl = class {
|
|
|
85
85
|
* specified.
|
|
86
86
|
*/
|
|
87
87
|
async build(options) {
|
|
88
|
-
const { FederationImpl } = await import("./middleware-
|
|
88
|
+
const { FederationImpl } = await import("./middleware-CF6uz8wa.mjs");
|
|
89
89
|
const f = new FederationImpl(options);
|
|
90
90
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
91
91
|
f.router = this.router.clone();
|
|
@@ -156,38 +156,39 @@ var FederationBuilderImpl = class {
|
|
|
156
156
|
"federation",
|
|
157
157
|
"actor"
|
|
158
158
|
]);
|
|
159
|
+
const portable = actor.id?.protocol === "ap:" || actor.id?.protocol === "ap+ef61:";
|
|
159
160
|
if (actor.id == null) logger.warn("Actor dispatcher returned an actor without an id property. Set the property with Context.getActorUri(identifier).");
|
|
160
|
-
else if (actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
|
|
161
|
+
else if (!portable && actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
|
|
161
162
|
if (actor instanceof Tombstone) return actor;
|
|
162
163
|
if (this.followingCallbacks != null && this.followingCallbacks.dispatcher != null) {
|
|
163
164
|
if (actor.followingId == null) logger.warn("You configured a following collection dispatcher, but the actor does not have a following property. Set the property with Context.getFollowingUri(identifier).");
|
|
164
|
-
else if (actor.followingId.href != context.getFollowingUri(identifier).href) logger.warn("You configured a following collection dispatcher, but the actor's following property does not match the following collection URI. Set the property with Context.getFollowingUri(identifier).");
|
|
165
|
+
else if (!portable && actor.followingId.href != context.getFollowingUri(identifier).href) logger.warn("You configured a following collection dispatcher, but the actor's following property does not match the following collection URI. Set the property with Context.getFollowingUri(identifier).");
|
|
165
166
|
}
|
|
166
167
|
if (this.followersCallbacks != null && this.followersCallbacks.dispatcher != null) {
|
|
167
168
|
if (actor.followersId == null) logger.warn("You configured a followers collection dispatcher, but the actor does not have a followers property. Set the property with Context.getFollowersUri(identifier).");
|
|
168
|
-
else if (actor.followersId.href != context.getFollowersUri(identifier).href) logger.warn("You configured a followers collection dispatcher, but the actor's followers property does not match the followers collection URI. Set the property with Context.getFollowersUri(identifier).");
|
|
169
|
+
else if (!portable && actor.followersId.href != context.getFollowersUri(identifier).href) logger.warn("You configured a followers collection dispatcher, but the actor's followers property does not match the followers collection URI. Set the property with Context.getFollowersUri(identifier).");
|
|
169
170
|
}
|
|
170
171
|
if (this.outboxCallbacks != null && this.outboxCallbacks.dispatcher != null) {
|
|
171
172
|
if (actor?.outboxId == null) logger.warn("You configured an outbox collection dispatcher, but the actor does not have an outbox property. Set the property with Context.getOutboxUri(identifier).");
|
|
172
|
-
else if (actor.outboxId.href != context.getOutboxUri(identifier).href) logger.warn("You configured an outbox collection dispatcher, but the actor's outbox property does not match the outbox collection URI. Set the property with Context.getOutboxUri(identifier).");
|
|
173
|
+
else if (!portable && actor.outboxId.href != context.getOutboxUri(identifier).href) logger.warn("You configured an outbox collection dispatcher, but the actor's outbox property does not match the outbox collection URI. Set the property with Context.getOutboxUri(identifier).");
|
|
173
174
|
}
|
|
174
175
|
if (this.likedCallbacks != null && this.likedCallbacks.dispatcher != null) {
|
|
175
176
|
if (actor?.likedId == null) logger.warn("You configured a liked collection dispatcher, but the actor does not have a liked property. Set the property with Context.getLikedUri(identifier).");
|
|
176
|
-
else if (actor.likedId.href != context.getLikedUri(identifier).href) logger.warn("You configured a liked collection dispatcher, but the actor's liked property does not match the liked collection URI. Set the property with Context.getLikedUri(identifier).");
|
|
177
|
+
else if (!portable && actor.likedId.href != context.getLikedUri(identifier).href) logger.warn("You configured a liked collection dispatcher, but the actor's liked property does not match the liked collection URI. Set the property with Context.getLikedUri(identifier).");
|
|
177
178
|
}
|
|
178
179
|
if (this.featuredCallbacks != null && this.featuredCallbacks.dispatcher != null) {
|
|
179
180
|
if (actor?.featuredId == null) logger.warn("You configured a featured collection dispatcher, but the actor does not have a featured property. Set the property with Context.getFeaturedUri(identifier).");
|
|
180
|
-
else if (actor.featuredId.href != context.getFeaturedUri(identifier).href) logger.warn("You configured a featured collection dispatcher, but the actor's featured property does not match the featured collection URI. Set the property with Context.getFeaturedUri(identifier).");
|
|
181
|
+
else if (!portable && actor.featuredId.href != context.getFeaturedUri(identifier).href) logger.warn("You configured a featured collection dispatcher, but the actor's featured property does not match the featured collection URI. Set the property with Context.getFeaturedUri(identifier).");
|
|
181
182
|
}
|
|
182
183
|
if (this.featuredTagsCallbacks != null && this.featuredTagsCallbacks.dispatcher != null) {
|
|
183
184
|
if (actor?.featuredTagsId == null) logger.warn("You configured a featured tags collection dispatcher, but the actor does not have a featuredTags property. Set the property with Context.getFeaturedTagsUri(identifier).");
|
|
184
|
-
else if (actor.featuredTagsId.href != context.getFeaturedTagsUri(identifier).href) logger.warn("You configured a featured tags collection dispatcher, but the actor's featuredTags property does not match the featured tags collection URI. Set the property with Context.getFeaturedTagsUri(identifier).");
|
|
185
|
+
else if (!portable && actor.featuredTagsId.href != context.getFeaturedTagsUri(identifier).href) logger.warn("You configured a featured tags collection dispatcher, but the actor's featuredTags property does not match the featured tags collection URI. Set the property with Context.getFeaturedTagsUri(identifier).");
|
|
185
186
|
}
|
|
186
187
|
if (this.router.has("inbox")) {
|
|
187
188
|
if (actor.inboxId == null) logger.warn("You configured inbox listeners, but the actor does not have an inbox property. Set the property with Context.getInboxUri(identifier).");
|
|
188
|
-
else if (actor.inboxId.href != context.getInboxUri(identifier).href) logger.warn("You configured inbox listeners, but the actor's inbox property does not match the inbox URI. Set the property with Context.getInboxUri(identifier).");
|
|
189
|
+
else if (!portable && actor.inboxId.href != context.getInboxUri(identifier).href) logger.warn("You configured inbox listeners, but the actor's inbox property does not match the inbox URI. Set the property with Context.getInboxUri(identifier).");
|
|
189
190
|
if (actor.endpoints == null || actor.endpoints.sharedInbox == null) logger.warn("You configured inbox listeners, but the actor does not have a endpoints.sharedInbox property. Set the property with Context.getInboxUri().");
|
|
190
|
-
else if (actor.endpoints.sharedInbox.href != context.getInboxUri().href) logger.warn("You configured inbox listeners, but the actor's endpoints.sharedInbox property does not match the shared inbox URI. Set the property with Context.getInboxUri().");
|
|
191
|
+
else if (!portable && actor.endpoints.sharedInbox.href != context.getInboxUri().href) logger.warn("You configured inbox listeners, but the actor's endpoints.sharedInbox property does not match the shared inbox URI. Set the property with Context.getInboxUri().");
|
|
191
192
|
}
|
|
192
193
|
if (callbacks.keyPairsDispatcher != null) {
|
|
193
194
|
if (actor.publicKeyId == null) logger.warn("You configured a key pairs dispatcher, but the actor does not have a publicKey property. Set the property with Context.getActorKeyPairs(identifier).");
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import {
|
|
2
|
+
import { Kt as ActivityTransformer, n as Context } from "../context-Bh_mJfbD.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 {
|
|
2
|
+
import { Kt as ActivityTransformer, n as Context } from "../context-BJPHhBmD.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 { b as
|
|
8
|
+
import { b as actorDehydrator, n as FederationImpl, x as autoIdAssigner } from "../middleware-CtFNjIUD.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,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "./proof-
|
|
4
|
+
import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "./proof-fKycdssC.mjs";
|
|
5
5
|
//#region src/sig/compound-proof.ts
|
|
6
6
|
const textEncoder = new TextEncoder();
|
|
7
7
|
const PORTABLE_OBJECT_ID_PATTERN = /^ap(?:\+ef61)?:\/\//i;
|
|
@@ -2734,6 +2734,35 @@ interface Context<TContextData> {
|
|
|
2734
2734
|
*/
|
|
2735
2735
|
getObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): URL;
|
|
2736
2736
|
/**
|
|
2737
|
+
* Builds the [FEP-ef61] portable ID of an object with the given class and
|
|
2738
|
+
* values under the given DID authority.
|
|
2739
|
+
*
|
|
2740
|
+
* The path is the same as the one {@link Context.getObjectUri} builds from
|
|
2741
|
+
* the object dispatcher's path, but the result is an `ap+ef61:` URI whose
|
|
2742
|
+
* authority is the DID, e.g., `ap+ef61://did:key:z6Mk.../notes/123`.
|
|
2743
|
+
* Such an object can be served through the FEP-ef61 gateway endpoint,
|
|
2744
|
+
* `/.well-known/apgateway/did:key:z6Mk.../notes/123`, by the same object
|
|
2745
|
+
* dispatcher.
|
|
2746
|
+
*
|
|
2747
|
+
* The returned `URL` keeps the DID authority percent-encoded, because
|
|
2748
|
+
* the `URL` class cannot represent the canonical form. Use `formatIri()`
|
|
2749
|
+
* from `@fedify/vocab-runtime` to get the canonical string, e.g.,
|
|
2750
|
+
* `ap+ef61://did:key:z6Mk.../notes/123`.
|
|
2751
|
+
*
|
|
2752
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2753
|
+
*
|
|
2754
|
+
* @param cls The class of the object.
|
|
2755
|
+
* @param values The values to pass to the object dispatcher.
|
|
2756
|
+
* @param authority The DID that controls the object, e.g.,
|
|
2757
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
2758
|
+
* a path, query, or fragment.
|
|
2759
|
+
* @returns The object's portable ID.
|
|
2760
|
+
* @throws {RouterError} If no object dispatcher is available for the class.
|
|
2761
|
+
* @throws {TypeError} If values are invalid or the authority is not a DID.
|
|
2762
|
+
* @since 2.4.0
|
|
2763
|
+
*/
|
|
2764
|
+
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
|
|
2765
|
+
/**
|
|
2737
2766
|
* Builds the URI of an actor's outbox with the given identifier.
|
|
2738
2767
|
* @param identifier The actor's identifier.
|
|
2739
2768
|
* @returns The actor's outbox URI.
|
|
@@ -2879,7 +2908,13 @@ interface Context<TContextData> {
|
|
|
2879
2908
|
* ```
|
|
2880
2909
|
*
|
|
2881
2910
|
* It's almost the same as the {@link lookupObject} function, but it uses
|
|
2882
|
-
* the context's document loader and context loader by default.
|
|
2911
|
+
* the context's document loader and context loader by default. It also
|
|
2912
|
+
* uses `verifyPortableObjectProof()` as the `verifyPortableObject`
|
|
2913
|
+
* option by default (since 2.4.0), so [FEP-ef61] portable objects,
|
|
2914
|
+
* including portable actors found through WebFinger, are looked up through
|
|
2915
|
+
* their gateways and returned only if they have valid proofs.
|
|
2916
|
+
*
|
|
2917
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2883
2918
|
*
|
|
2884
2919
|
* @param identifier The URI or fediverse handle to look up.
|
|
2885
2920
|
* @param options Lookup options.
|
|
@@ -3054,6 +3089,29 @@ interface Context<TContextData> {
|
|
|
3054
3089
|
getCollectionUri<TParam extends Record<string, string>>(name: string | symbol, values: TParam): URL;
|
|
3055
3090
|
}
|
|
3056
3091
|
/**
|
|
3092
|
+
* Information about an [FEP-ef61] portable object requested through
|
|
3093
|
+
* the gateway endpoint. See {@link RequestContext.portableRequest}.
|
|
3094
|
+
*
|
|
3095
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3096
|
+
* @since 2.4.0
|
|
3097
|
+
*/
|
|
3098
|
+
interface PortableRequest {
|
|
3099
|
+
/**
|
|
3100
|
+
* The DID authority of the requested portable object, e.g.,
|
|
3101
|
+
* `did:key:z6Mk...`. It comes from the request path, so it is not
|
|
3102
|
+
* evidence that this server hosts objects for the DID.
|
|
3103
|
+
*/
|
|
3104
|
+
readonly authority: string;
|
|
3105
|
+
/**
|
|
3106
|
+
* The ID of the requested portable object, e.g.,
|
|
3107
|
+
* `ap+ef61://did:key:z6Mk.../notes/123`, without a query. Like other
|
|
3108
|
+
* portable IDs, the `URL` keeps the DID authority percent-encoded; use
|
|
3109
|
+
* `formatIri()` from `@fedify/vocab-runtime` to get the canonical string.
|
|
3110
|
+
* Each access returns a new `URL` instance.
|
|
3111
|
+
*/
|
|
3112
|
+
readonly id: URL;
|
|
3113
|
+
}
|
|
3114
|
+
/**
|
|
3057
3115
|
* Options for {@link RequestContext.getActor}.
|
|
3058
3116
|
* @since 2.2.0
|
|
3059
3117
|
*/
|
|
@@ -3079,6 +3137,46 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3079
3137
|
*/
|
|
3080
3138
|
readonly url: URL;
|
|
3081
3139
|
/**
|
|
3140
|
+
* Information about the [FEP-ef61] portable object requested through
|
|
3141
|
+
* the gateway endpoint, e.g.,
|
|
3142
|
+
* `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`. It is
|
|
3143
|
+
* `undefined` for ordinary requests.
|
|
3144
|
+
*
|
|
3145
|
+
* The authority comes from the request path, so it is not evidence that
|
|
3146
|
+
* this server hosts objects for the DID. An object dispatcher has to check
|
|
3147
|
+
* that by itself.
|
|
3148
|
+
*
|
|
3149
|
+
* It describes the incoming request, so it stays the same in contexts
|
|
3150
|
+
* derived from this one, e.g., by {@link RequestContext.getObject}.
|
|
3151
|
+
*
|
|
3152
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3153
|
+
* @since 2.4.0
|
|
3154
|
+
*/
|
|
3155
|
+
readonly portableRequest?: PortableRequest;
|
|
3156
|
+
/**
|
|
3157
|
+
* Builds the [FEP-ef61] portable ID of an object with the given class and
|
|
3158
|
+
* values. It works the same as {@link Context.getPortableObjectUri}, except
|
|
3159
|
+
* that the authority can be omitted while handling a portable gateway
|
|
3160
|
+
* request. In that case, the DID in {@link RequestContext.portableRequest}
|
|
3161
|
+
* is used.
|
|
3162
|
+
*
|
|
3163
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3164
|
+
*
|
|
3165
|
+
* @param cls The class of the object.
|
|
3166
|
+
* @param values The values to pass to the object dispatcher.
|
|
3167
|
+
* @param authority The DID that controls the object, e.g.,
|
|
3168
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
3169
|
+
* a path, query, or fragment. Defaults to the DID of
|
|
3170
|
+
* the requested portable object.
|
|
3171
|
+
* @returns The object's portable ID.
|
|
3172
|
+
* @throws {RouterError} If no object dispatcher is available for the class.
|
|
3173
|
+
* @throws {TypeError} If values are invalid, the authority is not a DID, or
|
|
3174
|
+
* the authority is omitted outside a portable gateway
|
|
3175
|
+
* request.
|
|
3176
|
+
* @since 2.4.0
|
|
3177
|
+
*/
|
|
3178
|
+
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
|
|
3179
|
+
/**
|
|
3082
3180
|
* Creates a new context with the same properties as this one,
|
|
3083
3181
|
* but with the given data.
|
|
3084
3182
|
* @param data The new data to associate with the context.
|
|
@@ -3553,4 +3651,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
3553
3651
|
readonly multikey: Multikey;
|
|
3554
3652
|
}
|
|
3555
3653
|
//#endregion
|
|
3556
|
-
export {
|
|
3654
|
+
export { MessageQueue as $, ObjectCallbackSetters as A, NodeInfoDispatcher as At, TaskDefinitionOptions as B, WebFingerLinksDispatcher as Bt, FederationOptions as C, CollectionDispatcher as Ct, InboxChallengePolicy as D, InboxErrorHandler as Dt, IdempotencyStrategy as E, CustomCollectionDispatcher as Et, FederationQueueOptions as F, OutboxListenerErrorHandler as Ft, RetryContext as G, digest as Gt, TaskHandler as H, SenderKeyPair as Ht, createFederation as I, OutboxPermanentFailureHandler as It, RespondWithObjectOptions as J, RetryPolicy as K, ActivityTransformer as Kt, Message as L, SharedInboxKeyDispatcher as Lt, Rfc6570Expression as M, ObjectDispatcher as Mt, FederationKvPrefixes as N, OutboxErrorHandler as Nt, InboxListenerSetters as O, InboxListener as Ot, FederationOrigin as P, OutboxListener as Pt, InProcessMessageQueueOptions as Q, createFederationBuilder as R, UnverifiedActivityHandler as Rt, FederationFetchOptions as S, CollectionCursor as St, IdempotencyKeyCallback as T, CustomCollectionCursor as Tt, TaskRegistry as U, PageItems as Ut, TaskEnqueueOptions as V, SendActivityError as Vt, CreateExponentialBackoffPolicyOptions as W, buildCollectionSynchronizationHeader as Wt, respondWithObjectIfAcceptable as X, respondWithObject as Y, InProcessMessageQueue as Z, CustomCollectionCallbackSetters as _, ActorDispatcher as _t, GetSignedKeyOptions as a, CircuitBreakerActivityDrop as at, FederationBenchmarkOptions as b, AuthorizePredicate as bt, ParseUriResult as c, CircuitBreakerFailurePolicy as ct, RouteActivityOptions as d, CircuitBreakerState as dt, MessageQueueDepth as et, SendActivityOptions as f, CircuitBreakerStateChange as ft, ConstructorWithTypeId as g, ActorAliasMapper as gt, CollectionCallbackSetters as h, parseCircuitBreakerKvState as ht, GetActorOptions as i, CircuitBreaker as it, OutboxListenerSetters as j, ObjectAuthorizePredicate as jt, MediaUploaderSetters as k, MediaUploaderCallback as kt, PortableRequest as l, CircuitBreakerKvState as lt, ActorCallbackSetters as m, normalizeCircuitBreakerOptions as mt, Context as n, MessageQueueListenOptions as nt, InboxContext as o, CircuitBreakerBeforeSendDecision as ot, SendActivityOptionsForCollection as p, NormalizedCircuitBreakerOptions as pt, createExponentialBackoffPolicy as q, ForwardActivityOptions as r, ParallelMessageQueue as rt, OutboxContext as s, CircuitBreakerCreateOptions as st, ActorKeyPair as t, MessageQueueEnqueueOptions as tt, RequestContext as u, CircuitBreakerOptions as ut, Federatable as v, ActorHandleMapper as vt, FederationStartQueueOptions as w, CustomCollectionCounter as wt, FederationBuilder as x, CollectionCounter as xt, Federation as y, ActorKeyPairsDispatcher as yt, TaskDefinition as z, UnverifiedActivityReason as zt };
|
|
@@ -2732,6 +2732,35 @@ interface Context<TContextData> {
|
|
|
2732
2732
|
*/
|
|
2733
2733
|
getObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): URL;
|
|
2734
2734
|
/**
|
|
2735
|
+
* Builds the [FEP-ef61] portable ID of an object with the given class and
|
|
2736
|
+
* values under the given DID authority.
|
|
2737
|
+
*
|
|
2738
|
+
* The path is the same as the one {@link Context.getObjectUri} builds from
|
|
2739
|
+
* the object dispatcher's path, but the result is an `ap+ef61:` URI whose
|
|
2740
|
+
* authority is the DID, e.g., `ap+ef61://did:key:z6Mk.../notes/123`.
|
|
2741
|
+
* Such an object can be served through the FEP-ef61 gateway endpoint,
|
|
2742
|
+
* `/.well-known/apgateway/did:key:z6Mk.../notes/123`, by the same object
|
|
2743
|
+
* dispatcher.
|
|
2744
|
+
*
|
|
2745
|
+
* The returned `URL` keeps the DID authority percent-encoded, because
|
|
2746
|
+
* the `URL` class cannot represent the canonical form. Use `formatIri()`
|
|
2747
|
+
* from `@fedify/vocab-runtime` to get the canonical string, e.g.,
|
|
2748
|
+
* `ap+ef61://did:key:z6Mk.../notes/123`.
|
|
2749
|
+
*
|
|
2750
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2751
|
+
*
|
|
2752
|
+
* @param cls The class of the object.
|
|
2753
|
+
* @param values The values to pass to the object dispatcher.
|
|
2754
|
+
* @param authority The DID that controls the object, e.g.,
|
|
2755
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
2756
|
+
* a path, query, or fragment.
|
|
2757
|
+
* @returns The object's portable ID.
|
|
2758
|
+
* @throws {RouterError} If no object dispatcher is available for the class.
|
|
2759
|
+
* @throws {TypeError} If values are invalid or the authority is not a DID.
|
|
2760
|
+
* @since 2.4.0
|
|
2761
|
+
*/
|
|
2762
|
+
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
|
|
2763
|
+
/**
|
|
2735
2764
|
* Builds the URI of an actor's outbox with the given identifier.
|
|
2736
2765
|
* @param identifier The actor's identifier.
|
|
2737
2766
|
* @returns The actor's outbox URI.
|
|
@@ -2877,7 +2906,13 @@ interface Context<TContextData> {
|
|
|
2877
2906
|
* ```
|
|
2878
2907
|
*
|
|
2879
2908
|
* It's almost the same as the {@link lookupObject} function, but it uses
|
|
2880
|
-
* the context's document loader and context loader by default.
|
|
2909
|
+
* the context's document loader and context loader by default. It also
|
|
2910
|
+
* uses `verifyPortableObjectProof()` as the `verifyPortableObject`
|
|
2911
|
+
* option by default (since 2.4.0), so [FEP-ef61] portable objects,
|
|
2912
|
+
* including portable actors found through WebFinger, are looked up through
|
|
2913
|
+
* their gateways and returned only if they have valid proofs.
|
|
2914
|
+
*
|
|
2915
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2881
2916
|
*
|
|
2882
2917
|
* @param identifier The URI or fediverse handle to look up.
|
|
2883
2918
|
* @param options Lookup options.
|
|
@@ -3052,6 +3087,29 @@ interface Context<TContextData> {
|
|
|
3052
3087
|
getCollectionUri<TParam extends Record<string, string>>(name: string | symbol, values: TParam): URL;
|
|
3053
3088
|
}
|
|
3054
3089
|
/**
|
|
3090
|
+
* Information about an [FEP-ef61] portable object requested through
|
|
3091
|
+
* the gateway endpoint. See {@link RequestContext.portableRequest}.
|
|
3092
|
+
*
|
|
3093
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3094
|
+
* @since 2.4.0
|
|
3095
|
+
*/
|
|
3096
|
+
interface PortableRequest {
|
|
3097
|
+
/**
|
|
3098
|
+
* The DID authority of the requested portable object, e.g.,
|
|
3099
|
+
* `did:key:z6Mk...`. It comes from the request path, so it is not
|
|
3100
|
+
* evidence that this server hosts objects for the DID.
|
|
3101
|
+
*/
|
|
3102
|
+
readonly authority: string;
|
|
3103
|
+
/**
|
|
3104
|
+
* The ID of the requested portable object, e.g.,
|
|
3105
|
+
* `ap+ef61://did:key:z6Mk.../notes/123`, without a query. Like other
|
|
3106
|
+
* portable IDs, the `URL` keeps the DID authority percent-encoded; use
|
|
3107
|
+
* `formatIri()` from `@fedify/vocab-runtime` to get the canonical string.
|
|
3108
|
+
* Each access returns a new `URL` instance.
|
|
3109
|
+
*/
|
|
3110
|
+
readonly id: URL;
|
|
3111
|
+
}
|
|
3112
|
+
/**
|
|
3055
3113
|
* Options for {@link RequestContext.getActor}.
|
|
3056
3114
|
* @since 2.2.0
|
|
3057
3115
|
*/
|
|
@@ -3077,6 +3135,46 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3077
3135
|
*/
|
|
3078
3136
|
readonly url: URL;
|
|
3079
3137
|
/**
|
|
3138
|
+
* Information about the [FEP-ef61] portable object requested through
|
|
3139
|
+
* the gateway endpoint, e.g.,
|
|
3140
|
+
* `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`. It is
|
|
3141
|
+
* `undefined` for ordinary requests.
|
|
3142
|
+
*
|
|
3143
|
+
* The authority comes from the request path, so it is not evidence that
|
|
3144
|
+
* this server hosts objects for the DID. An object dispatcher has to check
|
|
3145
|
+
* that by itself.
|
|
3146
|
+
*
|
|
3147
|
+
* It describes the incoming request, so it stays the same in contexts
|
|
3148
|
+
* derived from this one, e.g., by {@link RequestContext.getObject}.
|
|
3149
|
+
*
|
|
3150
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3151
|
+
* @since 2.4.0
|
|
3152
|
+
*/
|
|
3153
|
+
readonly portableRequest?: PortableRequest;
|
|
3154
|
+
/**
|
|
3155
|
+
* Builds the [FEP-ef61] portable ID of an object with the given class and
|
|
3156
|
+
* values. It works the same as {@link Context.getPortableObjectUri}, except
|
|
3157
|
+
* that the authority can be omitted while handling a portable gateway
|
|
3158
|
+
* request. In that case, the DID in {@link RequestContext.portableRequest}
|
|
3159
|
+
* is used.
|
|
3160
|
+
*
|
|
3161
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3162
|
+
*
|
|
3163
|
+
* @param cls The class of the object.
|
|
3164
|
+
* @param values The values to pass to the object dispatcher.
|
|
3165
|
+
* @param authority The DID that controls the object, e.g.,
|
|
3166
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
3167
|
+
* a path, query, or fragment. Defaults to the DID of
|
|
3168
|
+
* the requested portable object.
|
|
3169
|
+
* @returns The object's portable ID.
|
|
3170
|
+
* @throws {RouterError} If no object dispatcher is available for the class.
|
|
3171
|
+
* @throws {TypeError} If values are invalid, the authority is not a DID, or
|
|
3172
|
+
* the authority is omitted outside a portable gateway
|
|
3173
|
+
* request.
|
|
3174
|
+
* @since 2.4.0
|
|
3175
|
+
*/
|
|
3176
|
+
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
|
|
3177
|
+
/**
|
|
3080
3178
|
* Creates a new context with the same properties as this one,
|
|
3081
3179
|
* but with the given data.
|
|
3082
3180
|
* @param data The new data to associate with the context.
|
|
@@ -3551,4 +3649,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
3551
3649
|
readonly multikey: Multikey;
|
|
3552
3650
|
}
|
|
3553
3651
|
//#endregion
|
|
3554
|
-
export {
|
|
3652
|
+
export { MessageQueue as $, ObjectCallbackSetters as A, NodeInfoDispatcher as At, TaskDefinitionOptions as B, WebFingerLinksDispatcher as Bt, FederationOptions as C, CollectionDispatcher as Ct, InboxChallengePolicy as D, InboxErrorHandler as Dt, IdempotencyStrategy as E, CustomCollectionDispatcher as Et, FederationQueueOptions as F, OutboxListenerErrorHandler as Ft, RetryContext as G, digest as Gt, TaskHandler as H, SenderKeyPair as Ht, createFederation as I, OutboxPermanentFailureHandler as It, RespondWithObjectOptions as J, RetryPolicy as K, ActivityTransformer as Kt, Message as L, SharedInboxKeyDispatcher as Lt, Rfc6570Expression as M, ObjectDispatcher as Mt, FederationKvPrefixes as N, OutboxErrorHandler as Nt, InboxListenerSetters as O, InboxListener as Ot, FederationOrigin as P, OutboxListener as Pt, InProcessMessageQueueOptions as Q, createFederationBuilder as R, UnverifiedActivityHandler as Rt, FederationFetchOptions as S, CollectionCursor as St, IdempotencyKeyCallback as T, CustomCollectionCursor as Tt, TaskRegistry as U, PageItems as Ut, TaskEnqueueOptions as V, SendActivityError as Vt, CreateExponentialBackoffPolicyOptions as W, buildCollectionSynchronizationHeader as Wt, respondWithObjectIfAcceptable as X, respondWithObject as Y, InProcessMessageQueue as Z, CustomCollectionCallbackSetters as _, ActorDispatcher as _t, GetSignedKeyOptions as a, CircuitBreakerActivityDrop as at, FederationBenchmarkOptions as b, AuthorizePredicate as bt, ParseUriResult as c, CircuitBreakerFailurePolicy as ct, RouteActivityOptions as d, CircuitBreakerState as dt, MessageQueueDepth as et, SendActivityOptions as f, CircuitBreakerStateChange as ft, ConstructorWithTypeId as g, ActorAliasMapper as gt, CollectionCallbackSetters as h, parseCircuitBreakerKvState as ht, GetActorOptions as i, CircuitBreaker as it, OutboxListenerSetters as j, ObjectAuthorizePredicate as jt, MediaUploaderSetters as k, MediaUploaderCallback as kt, PortableRequest as l, CircuitBreakerKvState as lt, ActorCallbackSetters as m, normalizeCircuitBreakerOptions as mt, Context as n, MessageQueueListenOptions as nt, InboxContext as o, CircuitBreakerBeforeSendDecision as ot, SendActivityOptionsForCollection as p, NormalizedCircuitBreakerOptions as pt, createExponentialBackoffPolicy as q, ForwardActivityOptions as r, ParallelMessageQueue as rt, OutboxContext as s, CircuitBreakerCreateOptions as st, ActorKeyPair as t, MessageQueueEnqueueOptions as tt, RequestContext as u, CircuitBreakerOptions as ut, Federatable as v, ActorHandleMapper as vt, FederationStartQueueOptions as w, CustomCollectionCounter as wt, FederationBuilder as x, CollectionCounter as xt, Federation as y, ActorKeyPairsDispatcher as yt, TaskDefinition as z, UnverifiedActivityReason as zt };
|
|
@@ -8,7 +8,7 @@ import { lookupWebFinger } from "@fedify/webfinger";
|
|
|
8
8
|
import { metrics, trace } from "@opentelemetry/api";
|
|
9
9
|
//#region src/testing/context.ts
|
|
10
10
|
function createContext(values) {
|
|
11
|
-
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
11
|
+
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getPortableObjectUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
12
12
|
function throwRouterError() {
|
|
13
13
|
throw new RouterError("Not implemented");
|
|
14
14
|
}
|
|
@@ -30,6 +30,7 @@ function createContext(values) {
|
|
|
30
30
|
getNodeInfoUri: getNodeInfoUri ?? throwRouterError,
|
|
31
31
|
getActorUri: getActorUri ?? throwRouterError,
|
|
32
32
|
getObjectUri: getObjectUri ?? throwRouterError,
|
|
33
|
+
getPortableObjectUri: getPortableObjectUri ?? throwRouterError,
|
|
33
34
|
getCollectionUri: getCollectionUri ?? throwRouterError,
|
|
34
35
|
getOutboxUri: getOutboxUri ?? throwRouterError,
|
|
35
36
|
getMediaUploaderUri: getMediaUploaderUri ?? throwRouterError,
|
|
@@ -87,6 +88,7 @@ function createRequestContext(args) {
|
|
|
87
88
|
})),
|
|
88
89
|
request: args.request ?? new Request(args.url),
|
|
89
90
|
url: args.url,
|
|
91
|
+
portableRequest: args.portableRequest,
|
|
90
92
|
getActor: args.getActor ?? (() => Promise.resolve(null)),
|
|
91
93
|
getObject: args.getObject ?? (() => Promise.resolve(null)),
|
|
92
94
|
getSignedKey: args.getSignedKey ?? (() => Promise.resolve(null)),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { s as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { s as validateCryptoKey } from "./key-CzCAq6D9.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-CK6kjLnO.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { curry } from "es-toolkit";
|
|
8
8
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
6
6
|
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
|
-
import { r as createFederationBuilder } from "../builder-
|
|
9
|
+
import { r as createFederationBuilder } from "../builder-Cue1kVHU.mjs";
|
|
10
10
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
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 { t as exportJwk } from "../key-
|
|
9
|
+
import { t as exportJwk } from "../key-CzCAq6D9.mjs";
|
|
10
10
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
11
11
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
12
|
-
import { n as FederationImpl } from "../middleware-
|
|
13
|
-
import { c as verifyProof, r as signObject } from "../proof-
|
|
12
|
+
import { n as FederationImpl } from "../middleware-CtFNjIUD.mjs";
|
|
13
|
+
import { c as verifyProof, r as signObject } from "../proof-fKycdssC.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
|
|
15
15
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -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-DG5QeQ8W.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 { s as signRequest } from "../http-
|
|
8
|
+
import { s as signRequest } from "../http-CK6kjLnO.mjs";
|
|
9
9
|
import { a as rsaPrivateKey3, c as rsaPublicKey3 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { d as handleInbox, o as createFederation } from "../middleware-
|
|
11
|
-
import { p as signJsonLd } from "../ld-
|
|
10
|
+
import { d as handleInbox, o as createFederation } from "../middleware-CtFNjIUD.mjs";
|
|
11
|
+
import { p as signJsonLd } from "../ld-CNWm8mJc.mjs";
|
|
12
12
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
13
13
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
14
14
|
import { Create } 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-DG5QeQ8W.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";
|
|
@@ -10,12 +10,12 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
13
|
-
import { a as generateCryptoKeyPair } from "../key-
|
|
14
|
-
import { s as signRequest } from "../http-
|
|
13
|
+
import { a as generateCryptoKeyPair } from "../key-CzCAq6D9.mjs";
|
|
14
|
+
import { s as signRequest } from "../http-CK6kjLnO.mjs";
|
|
15
15
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
16
|
-
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-
|
|
17
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
18
|
-
import { r as signObject } from "../proof-
|
|
16
|
+
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-CtFNjIUD.mjs";
|
|
17
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-CNWm8mJc.mjs";
|
|
18
|
+
import { r as signObject } from "../proof-fKycdssC.mjs";
|
|
19
19
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
20
20
|
import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
|
|
21
21
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -5,8 +5,8 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
8
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
-
import { r as signObject } from "../proof-
|
|
8
|
+
import { o as createFederation } from "../middleware-CtFNjIUD.mjs";
|
|
9
|
+
import { r as signObject } from "../proof-fKycdssC.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-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.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-CDoBPWjf.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";
|
|
@@ -5,7 +5,7 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
7
|
import { a as numberSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
|
|
8
|
-
import "../testing-
|
|
8
|
+
import "../testing-By1YYsIK.mjs";
|
|
9
9
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
10
10
|
import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
|
|
11
11
|
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
@@ -16,14 +16,14 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
16
16
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
17
17
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
18
18
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
19
|
-
import { g as recordInboxActivity } from "../metrics-
|
|
20
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
19
|
+
import { g as recordInboxActivity } from "../metrics-CDoBPWjf.mjs";
|
|
20
|
+
import { l as verifyRequest, s as signRequest } from "../http-CK6kjLnO.mjs";
|
|
21
21
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
22
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
23
|
-
import {
|
|
24
|
-
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-
|
|
25
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
26
|
-
import { a as verifyObject, r as signObject } from "../proof-
|
|
22
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BRlNjHlQ.mjs";
|
|
23
|
+
import { _ as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-CtFNjIUD.mjs";
|
|
24
|
+
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-CNWm8mJc.mjs";
|
|
25
|
+
import { t as doesActorOwnKey } from "../owner-B3PgGiJ1.mjs";
|
|
26
|
+
import { a as verifyObject, r as signObject } from "../proof-fKycdssC.mjs";
|
|
27
27
|
import { t as CircuitBreaker } from "../circuit-breaker-C5NqoLBJ.mjs";
|
|
28
28
|
import { t as TaskCodec } from "../codec-C6rTrpIp.mjs";
|
|
29
29
|
import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-DW6YC_Pe.mjs";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_federation = require("../federation-
|
|
3
|
+
const require_federation = require("../federation-Bdu06LEl.cjs");
|
|
4
4
|
exports.CircuitBreaker = require_federation.CircuitBreaker;
|
|
5
5
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
6
6
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|