@fedify/fedify 2.0.36-dev.2653 → 2.0.36-dev.2734
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-D6LGNjSj.mjs → builder-D0y_1xPt.mjs} +3 -3
- package/dist/callback-CJd-aCRE.d.mts +2223 -0
- 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/{context-C00pWP8x.d.ts → context-CgpkmUFq.d.ts} +23 -12
- package/dist/{context-ao-qb3eP.d.cts → context-DGC1C_UU.d.cts} +23 -12
- package/dist/{deno-DnlTCwP9.mjs → deno-CvHOP0XE.mjs} +1 -1
- package/dist/{docloader-ClA1cBXp.mjs → docloader-QmdzA0HA.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +6 -6
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- 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/send.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-Cd8UD1ym.d.ts → http-B57wVmZ3.d.cts} +3 -3
- package/dist/{http-CUyMHX68.cjs → http-CIiwaoIn.cjs} +6 -4
- package/dist/{http-DFqAb11b.d.cts → http-CURWmZlP.d.ts} +3 -3
- package/dist/{http-Cqbz1vSQ.js → http-CacZaxQy.js} +6 -4
- package/dist/{http-pcUSzQJO.mjs → http-DM--MHnA.mjs} +6 -4
- package/dist/{inbox-Dvd92fR4.mjs → inbox-BgsnvP5o.mjs} +1 -1
- package/dist/{key-WbbcbEg2.mjs → key-RrdwitZu.mjs} +3 -2
- package/dist/{kv-cache-C2CZ0wo0.cjs → kv-cache--kqYNgl4.cjs} +1 -1
- package/dist/{kv-cache-CFnt0ze9.js → kv-cache-DO77nN26.js} +1 -1
- package/dist/{ld-CQIFcE4D.mjs → ld-BpBoDQsD.mjs} +20 -7
- package/dist/{middleware-C1wIK-Eo.js → middleware-BcLbgxfC.js} +14 -6
- package/dist/{middleware-CNSvd_Yd.cjs → middleware-ByORyvfD.cjs} +1 -1
- package/dist/{middleware-BW7yDR0N.cjs → middleware-DkQNfZyL.cjs} +15 -7
- package/dist/{middleware-pG3fni-8.mjs → middleware-DoMxpm9r.mjs} +22 -13
- package/dist/{middleware-DdgQlj3K.mjs → middleware-j3sV7iws.mjs} +1 -1
- package/dist/{mod-DtRh015i.d.ts → mod-BqnolIm8.d.ts} +1 -1
- package/dist/{mod-6uJWdCc0.d.cts → mod-BzKteaAe.d.cts} +1 -1
- package/dist/{mod-DGP89q0u.d.ts → mod-CIjZ1RmH.d.ts} +3 -3
- package/dist/{mod-BPDfu4Ey.d.cts → mod-DaQ6pIH3.d.cts} +3 -3
- package/dist/{mod-CL9Ep0uo.d.ts → mod-DmmcsbU8.d.cts} +12 -7
- package/dist/{mod-BA6vqC2S.d.cts → mod-fnE_D0lV.d.ts} +12 -7
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +7 -7
- package/dist/mod.d.ts +7 -7
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-U2uzi8vw.mjs → owner-zSUyR5Fs.mjs} +2 -2
- package/dist/{proof-DuGHbMbs.mjs → proof-C90umkRN.mjs} +4 -3
- package/dist/{proof-DlcTuXU1.js → proof-DJvdhpXO.js} +20 -7
- package/dist/{proof-Czu16ywv.cjs → proof-qxFPzf3D.cjs} +20 -7
- package/dist/{send-JCtYxtYm.mjs → send-BE4hcPfe.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key-types.test.d.mts +218 -0
- package/dist/sig/key-types.test.mjs +8 -0
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +156 -4
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +2 -2
- package/dist/{temporal-B7Rg3f1o.mjs → temporal-BQUGkj5T.mjs} +1 -1
- package/dist/testing/mod.d.mts +2 -2123
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { bt as ActivityTransformer, n as Context } from "../context-
|
|
2
|
+
import { bt as ActivityTransformer, n as Context } from "../context-DGC1C_UU.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 { bt as ActivityTransformer, n as Context } from "../context-
|
|
2
|
+
import { bt as ActivityTransformer, n as Context } from "../context-CgpkmUFq.js";
|
|
3
3
|
import { Activity } from "@fedify/vocab";
|
|
4
4
|
|
|
5
5
|
//#region src/compat/transformers.d.ts
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
6
6
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
7
|
-
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-
|
|
7
|
+
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-DoMxpm9r.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
import { Follow, Person } from "@fedify/vocab";
|
|
10
10
|
//#region src/compat/transformers.test.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-jE7oGvRh.js";
|
|
3
|
-
import { t as HttpMessageSignaturesSpec } from "./http-
|
|
3
|
+
import { t as HttpMessageSignaturesSpec } from "./http-CURWmZlP.js";
|
|
4
4
|
import { n as GetKeyOwnerOptions } from "./owner-CiBPcC6F.js";
|
|
5
5
|
import { n as KvStore, t as KvKey } from "./kv-CxaI4eGo.js";
|
|
6
6
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
7
7
|
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
8
|
-
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
8
|
+
import { AuthenticatedDocumentLoaderFactory, CryptoKeyLike, CryptoKeyPairLike, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
9
9
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
10
10
|
|
|
11
11
|
//#region src/compat/types.d.ts
|
|
@@ -46,13 +46,18 @@ declare function buildCollectionSynchronizationHeader(collectionId: string | URL
|
|
|
46
46
|
//#region src/federation/send.d.ts
|
|
47
47
|
/**
|
|
48
48
|
* A key pair for an actor who sends an activity.
|
|
49
|
+
*
|
|
50
|
+
* The private key type is parameterized so that Fedify can accept keys from
|
|
51
|
+
* `node:crypto` at its input boundaries while `SenderKeyPair` still exposes the
|
|
52
|
+
* ambient `CryptoKey` type by default.
|
|
53
|
+
* @template TKey The type of the private key.
|
|
49
54
|
* @since 0.10.0
|
|
50
55
|
*/
|
|
51
|
-
interface SenderKeyPair {
|
|
56
|
+
interface SenderKeyPair<TKey extends CryptoKeyLike = CryptoKey> {
|
|
52
57
|
/**
|
|
53
58
|
* The actor's private key to sign the request.
|
|
54
59
|
*/
|
|
55
|
-
readonly privateKey:
|
|
60
|
+
readonly privateKey: TKey;
|
|
56
61
|
/**
|
|
57
62
|
* The public key ID that corresponds to the private key.
|
|
58
63
|
*/
|
|
@@ -116,13 +121,19 @@ type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, ide
|
|
|
116
121
|
/**
|
|
117
122
|
* A callback that dispatches key pairs for an actor.
|
|
118
123
|
*
|
|
124
|
+
* The returned key pairs may come from any supported runtime, including keys
|
|
125
|
+
* obtained from `node:crypto`'s Web Crypto API, so the key pair type is
|
|
126
|
+
* parameterized. It defaults to the ambient `CryptoKeyPair` type for
|
|
127
|
+
* compatibility with code that calls a dispatcher directly.
|
|
128
|
+
*
|
|
119
129
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
130
|
+
* @template TKeyPair The type of the key pairs the dispatcher returns.
|
|
120
131
|
* @param context The context.
|
|
121
132
|
* @param identifier The actor's internal identifier or username.
|
|
122
133
|
* @returns The key pairs.
|
|
123
134
|
* @since 0.10.0
|
|
124
135
|
*/
|
|
125
|
-
type ActorKeyPairsDispatcher<TContextData> = (context: Context<TContextData>, identifier: string) =>
|
|
136
|
+
type ActorKeyPairsDispatcher<TContextData, TKeyPair extends CryptoKeyPairLike = CryptoKeyPair> = (context: Context<TContextData>, identifier: string) => TKeyPair[] | Promise<TKeyPair[]>;
|
|
126
137
|
/**
|
|
127
138
|
* A callback that maps a WebFinger username to the corresponding actor's
|
|
128
139
|
* internal identifier, or `null` if the username is not found.
|
|
@@ -229,11 +240,11 @@ type InboxErrorHandler<TContextData> = (context: Context<TContextData>, error: E
|
|
|
229
240
|
* not authorized.
|
|
230
241
|
* @since 0.11.0
|
|
231
242
|
*/
|
|
232
|
-
type SharedInboxKeyDispatcher<TContextData> = (context: Context<TContextData>) => SenderKeyPair | {
|
|
243
|
+
type SharedInboxKeyDispatcher<TContextData, TKeyPair extends CryptoKeyLike = CryptoKey> = (context: Context<TContextData>) => SenderKeyPair<TKeyPair> | {
|
|
233
244
|
identifier: string;
|
|
234
245
|
} | {
|
|
235
246
|
username: string;
|
|
236
|
-
} | null | Promise<SenderKeyPair | {
|
|
247
|
+
} | null | Promise<SenderKeyPair<TKeyPair> | {
|
|
237
248
|
identifier: string;
|
|
238
249
|
} | {
|
|
239
250
|
username: string;
|
|
@@ -1531,7 +1542,7 @@ interface ActorCallbackSetters<TContextData> {
|
|
|
1531
1542
|
* @returns The setters object so that settings can be chained.
|
|
1532
1543
|
* @since 0.10.0
|
|
1533
1544
|
*/
|
|
1534
|
-
setKeyPairsDispatcher(dispatcher: ActorKeyPairsDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
|
1545
|
+
setKeyPairsDispatcher(dispatcher: ActorKeyPairsDispatcher<TContextData, CryptoKeyPairLike>): ActorCallbackSetters<TContextData>;
|
|
1535
1546
|
/**
|
|
1536
1547
|
* Sets the callback function that maps a WebFinger username to
|
|
1537
1548
|
* the corresponding actor's identifier. If it's omitted, the identifier
|
|
@@ -1669,7 +1680,7 @@ interface InboxListenerSetters<TContextData> {
|
|
|
1669
1680
|
* @returns The setters object so that settings can be chained.
|
|
1670
1681
|
* @since 0.11.0
|
|
1671
1682
|
*/
|
|
1672
|
-
setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData>): InboxListenerSetters<TContextData>;
|
|
1683
|
+
setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData, CryptoKeyLike>): InboxListenerSetters<TContextData>;
|
|
1673
1684
|
/**
|
|
1674
1685
|
* Configures the strategy for handling activity idempotency in inbox processing.
|
|
1675
1686
|
*
|
|
@@ -2002,7 +2013,7 @@ interface Context<TContextData> {
|
|
|
2002
2013
|
*/
|
|
2003
2014
|
getDocumentLoader(identity: {
|
|
2004
2015
|
keyId: URL;
|
|
2005
|
-
privateKey:
|
|
2016
|
+
privateKey: CryptoKeyLike;
|
|
2006
2017
|
}): DocumentLoader;
|
|
2007
2018
|
/**
|
|
2008
2019
|
* Looks up an ActivityStreams object by its URI (including `acct:` URIs)
|
|
@@ -2115,7 +2126,7 @@ interface Context<TContextData> {
|
|
|
2115
2126
|
* @param activity The activity to send.
|
|
2116
2127
|
* @param options Options for sending the activity.
|
|
2117
2128
|
*/
|
|
2118
|
-
sendActivity(sender: SenderKeyPair | SenderKeyPair[] | {
|
|
2129
|
+
sendActivity(sender: SenderKeyPair<CryptoKeyLike> | SenderKeyPair<CryptoKeyLike>[] | {
|
|
2119
2130
|
identifier: string;
|
|
2120
2131
|
} | {
|
|
2121
2132
|
username: string;
|
|
@@ -2335,7 +2346,7 @@ interface InboxContext<TContextData> extends Context<TContextData> {
|
|
|
2335
2346
|
* @param options Options for forwarding the activity.
|
|
2336
2347
|
* @since 1.0.0
|
|
2337
2348
|
*/
|
|
2338
|
-
forwardActivity(forwarder: SenderKeyPair | SenderKeyPair[] | {
|
|
2349
|
+
forwardActivity(forwarder: SenderKeyPair<CryptoKeyLike> | SenderKeyPair<CryptoKeyLike>[] | {
|
|
2339
2350
|
identifier: string;
|
|
2340
2351
|
} | {
|
|
2341
2352
|
username: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-BIBzqEIp.cjs";
|
|
3
|
-
import { t as HttpMessageSignaturesSpec } from "./http-
|
|
3
|
+
import { t as HttpMessageSignaturesSpec } from "./http-B57wVmZ3.cjs";
|
|
4
4
|
import { n as GetKeyOwnerOptions } from "./owner-B3hNQCG8.cjs";
|
|
5
5
|
import { n as KvStore, t as KvKey } from "./kv-CZKl1IUS.cjs";
|
|
6
6
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
7
|
-
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
7
|
+
import { AuthenticatedDocumentLoaderFactory, CryptoKeyLike, CryptoKeyPairLike, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
8
8
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
9
9
|
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
10
10
|
|
|
@@ -46,13 +46,18 @@ declare function buildCollectionSynchronizationHeader(collectionId: string | URL
|
|
|
46
46
|
//#region src/federation/send.d.ts
|
|
47
47
|
/**
|
|
48
48
|
* A key pair for an actor who sends an activity.
|
|
49
|
+
*
|
|
50
|
+
* The private key type is parameterized so that Fedify can accept keys from
|
|
51
|
+
* `node:crypto` at its input boundaries while `SenderKeyPair` still exposes the
|
|
52
|
+
* ambient `CryptoKey` type by default.
|
|
53
|
+
* @template TKey The type of the private key.
|
|
49
54
|
* @since 0.10.0
|
|
50
55
|
*/
|
|
51
|
-
interface SenderKeyPair {
|
|
56
|
+
interface SenderKeyPair<TKey extends CryptoKeyLike = CryptoKey> {
|
|
52
57
|
/**
|
|
53
58
|
* The actor's private key to sign the request.
|
|
54
59
|
*/
|
|
55
|
-
readonly privateKey:
|
|
60
|
+
readonly privateKey: TKey;
|
|
56
61
|
/**
|
|
57
62
|
* The public key ID that corresponds to the private key.
|
|
58
63
|
*/
|
|
@@ -116,13 +121,19 @@ type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, ide
|
|
|
116
121
|
/**
|
|
117
122
|
* A callback that dispatches key pairs for an actor.
|
|
118
123
|
*
|
|
124
|
+
* The returned key pairs may come from any supported runtime, including keys
|
|
125
|
+
* obtained from `node:crypto`'s Web Crypto API, so the key pair type is
|
|
126
|
+
* parameterized. It defaults to the ambient `CryptoKeyPair` type for
|
|
127
|
+
* compatibility with code that calls a dispatcher directly.
|
|
128
|
+
*
|
|
119
129
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
130
|
+
* @template TKeyPair The type of the key pairs the dispatcher returns.
|
|
120
131
|
* @param context The context.
|
|
121
132
|
* @param identifier The actor's internal identifier or username.
|
|
122
133
|
* @returns The key pairs.
|
|
123
134
|
* @since 0.10.0
|
|
124
135
|
*/
|
|
125
|
-
type ActorKeyPairsDispatcher<TContextData> = (context: Context<TContextData>, identifier: string) =>
|
|
136
|
+
type ActorKeyPairsDispatcher<TContextData, TKeyPair extends CryptoKeyPairLike = CryptoKeyPair> = (context: Context<TContextData>, identifier: string) => TKeyPair[] | Promise<TKeyPair[]>;
|
|
126
137
|
/**
|
|
127
138
|
* A callback that maps a WebFinger username to the corresponding actor's
|
|
128
139
|
* internal identifier, or `null` if the username is not found.
|
|
@@ -229,11 +240,11 @@ type InboxErrorHandler<TContextData> = (context: Context<TContextData>, error: E
|
|
|
229
240
|
* not authorized.
|
|
230
241
|
* @since 0.11.0
|
|
231
242
|
*/
|
|
232
|
-
type SharedInboxKeyDispatcher<TContextData> = (context: Context<TContextData>) => SenderKeyPair | {
|
|
243
|
+
type SharedInboxKeyDispatcher<TContextData, TKeyPair extends CryptoKeyLike = CryptoKey> = (context: Context<TContextData>) => SenderKeyPair<TKeyPair> | {
|
|
233
244
|
identifier: string;
|
|
234
245
|
} | {
|
|
235
246
|
username: string;
|
|
236
|
-
} | null | Promise<SenderKeyPair | {
|
|
247
|
+
} | null | Promise<SenderKeyPair<TKeyPair> | {
|
|
237
248
|
identifier: string;
|
|
238
249
|
} | {
|
|
239
250
|
username: string;
|
|
@@ -1531,7 +1542,7 @@ interface ActorCallbackSetters<TContextData> {
|
|
|
1531
1542
|
* @returns The setters object so that settings can be chained.
|
|
1532
1543
|
* @since 0.10.0
|
|
1533
1544
|
*/
|
|
1534
|
-
setKeyPairsDispatcher(dispatcher: ActorKeyPairsDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
|
1545
|
+
setKeyPairsDispatcher(dispatcher: ActorKeyPairsDispatcher<TContextData, CryptoKeyPairLike>): ActorCallbackSetters<TContextData>;
|
|
1535
1546
|
/**
|
|
1536
1547
|
* Sets the callback function that maps a WebFinger username to
|
|
1537
1548
|
* the corresponding actor's identifier. If it's omitted, the identifier
|
|
@@ -1669,7 +1680,7 @@ interface InboxListenerSetters<TContextData> {
|
|
|
1669
1680
|
* @returns The setters object so that settings can be chained.
|
|
1670
1681
|
* @since 0.11.0
|
|
1671
1682
|
*/
|
|
1672
|
-
setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData>): InboxListenerSetters<TContextData>;
|
|
1683
|
+
setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData, CryptoKeyLike>): InboxListenerSetters<TContextData>;
|
|
1673
1684
|
/**
|
|
1674
1685
|
* Configures the strategy for handling activity idempotency in inbox processing.
|
|
1675
1686
|
*
|
|
@@ -2002,7 +2013,7 @@ interface Context<TContextData> {
|
|
|
2002
2013
|
*/
|
|
2003
2014
|
getDocumentLoader(identity: {
|
|
2004
2015
|
keyId: URL;
|
|
2005
|
-
privateKey:
|
|
2016
|
+
privateKey: CryptoKeyLike;
|
|
2006
2017
|
}): DocumentLoader;
|
|
2007
2018
|
/**
|
|
2008
2019
|
* Looks up an ActivityStreams object by its URI (including `acct:` URIs)
|
|
@@ -2115,7 +2126,7 @@ interface Context<TContextData> {
|
|
|
2115
2126
|
* @param activity The activity to send.
|
|
2116
2127
|
* @param options Options for sending the activity.
|
|
2117
2128
|
*/
|
|
2118
|
-
sendActivity(sender: SenderKeyPair | SenderKeyPair[] | {
|
|
2129
|
+
sendActivity(sender: SenderKeyPair<CryptoKeyLike> | SenderKeyPair<CryptoKeyLike>[] | {
|
|
2119
2130
|
identifier: string;
|
|
2120
2131
|
} | {
|
|
2121
2132
|
username: string;
|
|
@@ -2335,7 +2346,7 @@ interface InboxContext<TContextData> extends Context<TContextData> {
|
|
|
2335
2346
|
* @param options Options for forwarding the activity.
|
|
2336
2347
|
* @since 1.0.0
|
|
2337
2348
|
*/
|
|
2338
|
-
forwardActivity(forwarder: SenderKeyPair | SenderKeyPair[] | {
|
|
2349
|
+
forwardActivity(forwarder: SenderKeyPair<CryptoKeyLike> | SenderKeyPair<CryptoKeyLike>[] | {
|
|
2339
2350
|
identifier: string;
|
|
2340
2351
|
} | {
|
|
2341
2352
|
username: string;
|
|
@@ -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 { r as doubleKnockScoped } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-RrdwitZu.mjs";
|
|
5
|
+
import { r as doubleKnockScoped } from "./http-DM--MHnA.mjs";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
7
7
|
import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest } from "@fedify/vocab-runtime";
|
|
8
8
|
import { openDirectFetch, openPublicFetch } from "@fedify/vocab-runtime/internal";
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { i as assertExists, n as assertStrictEquals } from "../std__assert-DflMZha5.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
8
|
-
import { n as createFederationBuilder } from "../builder-
|
|
8
|
+
import { n as createFederationBuilder } from "../builder-D0y_1xPt.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/builder.test.ts
|
|
@@ -6,14 +6,14 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
6
6
|
import "../std__assert-DflMZha5.mjs";
|
|
7
7
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
8
8
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
9
|
-
import { i as generateCryptoKeyPair } from "../key-
|
|
10
|
-
import { c as signRequest } from "../http-
|
|
9
|
+
import { i as generateCryptoKeyPair } from "../key-RrdwitZu.mjs";
|
|
10
|
+
import { c as signRequest } from "../http-DM--MHnA.mjs";
|
|
11
11
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
12
|
-
import { a as compactJsonLd, f as signJsonLd } from "../ld-
|
|
13
|
-
import { n as signObject } from "../proof-
|
|
12
|
+
import { a as compactJsonLd, f as signJsonLd } from "../ld-BpBoDQsD.mjs";
|
|
13
|
+
import { n as signObject } from "../proof-C90umkRN.mjs";
|
|
14
14
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
15
|
-
import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-
|
|
16
|
-
import { t as InboxListenerSet } from "../inbox-
|
|
15
|
+
import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-DoMxpm9r.mjs";
|
|
16
|
+
import { t as InboxListenerSet } from "../inbox-BgsnvP5o.mjs";
|
|
17
17
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
18
18
|
import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
|
|
19
19
|
//#region src/federation/handler.test.ts
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-DflMZha5.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
7
|
-
import { n as signObject } from "../proof-
|
|
7
|
+
import { n as signObject } from "../proof-C90umkRN.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
9
|
-
import { a as createFederation } from "../middleware-
|
|
9
|
+
import { a as createFederation } from "../middleware-DoMxpm9r.mjs";
|
|
10
10
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
6
|
-
import { n as actorsHaveSameOrigin, t as InboxListenerSet } from "../inbox-
|
|
6
|
+
import { n as actorsHaveSameOrigin, t as InboxListenerSet } from "../inbox-BgsnvP5o.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
9
9
|
//#region src/federation/inbox.test.ts
|
|
@@ -9,15 +9,15 @@ import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.m
|
|
|
9
9
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
10
10
|
import { t as assertNotEquals } from "../assert_not_equals-BkxW5QJI.mjs";
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
12
|
-
import { c as signRequest, u as verifyRequest } from "../http-
|
|
12
|
+
import { c as signRequest, u as verifyRequest } from "../http-DM--MHnA.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
14
|
-
import { n as getAuthenticatedDocumentLoader } from "../docloader-
|
|
15
|
-
import { a as compactJsonLd, f as signJsonLd, i as attachSignature, m as verifyJsonLd, s as detachSignature } from "../ld-
|
|
16
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
17
|
-
import { n as signObject, r as verifyObject } from "../proof-
|
|
14
|
+
import { n as getAuthenticatedDocumentLoader } from "../docloader-QmdzA0HA.mjs";
|
|
15
|
+
import { a as compactJsonLd, f as signJsonLd, i as attachSignature, m as verifyJsonLd, s as detachSignature } from "../ld-BpBoDQsD.mjs";
|
|
16
|
+
import { t as doesActorOwnKey } from "../owner-zSUyR5Fs.mjs";
|
|
17
|
+
import { n as signObject, r as verifyObject } from "../proof-C90umkRN.mjs";
|
|
18
18
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
19
|
-
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
20
|
-
import { t as SendActivityError } from "../send-
|
|
19
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-DoMxpm9r.mjs";
|
|
20
|
+
import { t as SendActivityError } from "../send-BE4hcPfe.mjs";
|
|
21
21
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
22
22
|
import * as vocab from "@fedify/vocab";
|
|
23
23
|
import { Create, Offer, Person, getTypeId, lookupObject } from "@fedify/vocab";
|
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-DkQNfZyL.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-
|
|
2
|
+
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-DGC1C_UU.cjs";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-CZKl1IUS.cjs";
|
|
4
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
4
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-BzKteaAe.cjs";
|
|
5
5
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-
|
|
2
|
+
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-CgpkmUFq.js";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-CxaI4eGo.js";
|
|
4
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
4
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-BqnolIm8.js";
|
|
5
5
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
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 createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-
|
|
3
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-BcLbgxfC.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -8,10 +8,10 @@ import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
|
8
8
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals-BkxW5QJI.mjs";
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
11
|
-
import { u as verifyRequest } from "../http-
|
|
11
|
+
import { u as verifyRequest } from "../http-DM--MHnA.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { i as sendActivity, n as extractInboxes, r as fetchWithValidatedRedirects, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-zSUyR5Fs.mjs";
|
|
14
|
+
import { i as sendActivity, n as extractInboxes, r as fetchWithValidatedRedirects, t as SendActivityError } from "../send-BE4hcPfe.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
17
17
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-DflMZha5.mjs";
|
|
5
5
|
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
6
6
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-BQUGkj5T.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 () => {
|
|
@@ -5,7 +5,7 @@ import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-DflMZha5.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
8
|
-
import { a as createFederation, o as handleWebFinger } from "../middleware-
|
|
8
|
+
import { a as createFederation, o as handleWebFinger } from "../middleware-DoMxpm9r.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Image, Link, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/webfinger.test.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { Actor, CryptographicKey, Multikey } from "@fedify/vocab";
|
|
3
|
+
import { CryptoKeyLike, DocumentLoader } from "@fedify/vocab-runtime";
|
|
3
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
4
|
-
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
5
5
|
//#region src/sig/key.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Generates a key pair which is appropriate for Fedify.
|
|
@@ -18,7 +18,7 @@ declare function generateCryptoKeyPair(algorithm?: "RSASSA-PKCS1-v1_5" | "Ed2551
|
|
|
18
18
|
* serialization and storage.
|
|
19
19
|
* @throws {TypeError} If the key is invalid or unsupported.
|
|
20
20
|
*/
|
|
21
|
-
declare function exportJwk(key:
|
|
21
|
+
declare function exportJwk(key: CryptoKeyLike): Promise<JsonWebKey>;
|
|
22
22
|
/**
|
|
23
23
|
* Imports a key from JWK format.
|
|
24
24
|
* @param jwk The key in JWK format.
|
|
@@ -156,7 +156,7 @@ interface SignRequestOptions {
|
|
|
156
156
|
* @returns The signed request.
|
|
157
157
|
* @throws {TypeError} If the private key is invalid or unsupported.
|
|
158
158
|
*/
|
|
159
|
-
declare function signRequest(request: Request, privateKey:
|
|
159
|
+
declare function signRequest(request: Request, privateKey: CryptoKeyLike, keyId: URL, options?: SignRequestOptions): Promise<Request>;
|
|
160
160
|
/**
|
|
161
161
|
* Options for {@link verifyRequest}.
|
|
162
162
|
*/
|
|
@@ -6,12 +6,13 @@ let _fedify_vocab = require("@fedify/vocab");
|
|
|
6
6
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
7
7
|
let byte_encodings_hex = require("byte-encodings/hex");
|
|
8
8
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
9
|
+
let _fedify_vocab_runtime_internal = require("@fedify/vocab-runtime/internal");
|
|
9
10
|
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
10
11
|
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
11
12
|
let structured_field_values = require("structured-field-values");
|
|
12
13
|
//#region deno.json
|
|
13
14
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.0.36-dev.
|
|
15
|
+
var version = "2.0.36-dev.2734+3364869b";
|
|
15
16
|
//#endregion
|
|
16
17
|
//#region src/sig/key.ts
|
|
17
18
|
/** Classifies decoding failures without hiding unexpected loader errors. */
|
|
@@ -106,7 +107,7 @@ function generateCryptoKeyPair(algorithm) {
|
|
|
106
107
|
*/
|
|
107
108
|
async function exportJwk(key) {
|
|
108
109
|
validateCryptoKey(key);
|
|
109
|
-
const jwk = await crypto.subtle.exportKey("jwk", key);
|
|
110
|
+
const jwk = await crypto.subtle.exportKey("jwk", (0, _fedify_vocab_runtime_internal.asCryptoKey)(key));
|
|
110
111
|
if (jwk.crv === "Ed25519") jwk.alg = "Ed25519";
|
|
111
112
|
return jwk;
|
|
112
113
|
}
|
|
@@ -506,12 +507,13 @@ const DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS = 100;
|
|
|
506
507
|
*/
|
|
507
508
|
async function signRequest(request, privateKey, keyId, options = {}) {
|
|
508
509
|
validateCryptoKey(privateKey, "private");
|
|
510
|
+
const signingKey = (0, _fedify_vocab_runtime_internal.asCryptoKey)(privateKey);
|
|
509
511
|
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(name, version).startActiveSpan("http_signatures.sign", async (span) => {
|
|
510
512
|
try {
|
|
511
513
|
const spec = options.spec ?? "draft-cavage-http-signatures-12";
|
|
512
514
|
let signed;
|
|
513
|
-
if (spec === "rfc9421") signed = await signRequestRfc9421(request,
|
|
514
|
-
else signed = await signRequestDraft(request,
|
|
515
|
+
if (spec === "rfc9421") signed = await signRequestRfc9421(request, signingKey, keyId, span, options.currentTime, options.body);
|
|
516
|
+
else signed = await signRequestDraft(request, signingKey, keyId, span, options.currentTime, options.body);
|
|
515
517
|
if (span.isRecording()) {
|
|
516
518
|
span.setAttribute(_opentelemetry_semantic_conventions.ATTR_HTTP_REQUEST_METHOD, signed.method);
|
|
517
519
|
span.setAttribute(_opentelemetry_semantic_conventions.ATTR_URL_FULL, signed.url);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { Actor, CryptographicKey, Multikey } from "@fedify/vocab";
|
|
3
|
-
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
4
3
|
import { TracerProvider } from "@opentelemetry/api";
|
|
4
|
+
import { CryptoKeyLike, DocumentLoader } from "@fedify/vocab-runtime";
|
|
5
5
|
//#region src/sig/key.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Generates a key pair which is appropriate for Fedify.
|
|
@@ -18,7 +18,7 @@ declare function generateCryptoKeyPair(algorithm?: "RSASSA-PKCS1-v1_5" | "Ed2551
|
|
|
18
18
|
* serialization and storage.
|
|
19
19
|
* @throws {TypeError} If the key is invalid or unsupported.
|
|
20
20
|
*/
|
|
21
|
-
declare function exportJwk(key:
|
|
21
|
+
declare function exportJwk(key: CryptoKeyLike): Promise<JsonWebKey>;
|
|
22
22
|
/**
|
|
23
23
|
* Imports a key from JWK format.
|
|
24
24
|
* @param jwk The key in JWK format.
|
|
@@ -156,7 +156,7 @@ interface SignRequestOptions {
|
|
|
156
156
|
* @returns The signed request.
|
|
157
157
|
* @throws {TypeError} If the private key is invalid or unsupported.
|
|
158
158
|
*/
|
|
159
|
-
declare function signRequest(request: Request, privateKey:
|
|
159
|
+
declare function signRequest(request: Request, privateKey: CryptoKeyLike, keyId: URL, options?: SignRequestOptions): Promise<Request>;
|
|
160
160
|
/**
|
|
161
161
|
* Options for {@link verifyRequest}.
|
|
162
162
|
*/
|
|
@@ -5,12 +5,13 @@ import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
|
5
5
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
6
6
|
import { encodeHex } from "byte-encodings/hex";
|
|
7
7
|
import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
8
|
+
import { asCryptoKey } from "@fedify/vocab-runtime/internal";
|
|
8
9
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
9
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
10
11
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
11
12
|
//#region deno.json
|
|
12
13
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "2.0.36-dev.
|
|
14
|
+
var version = "2.0.36-dev.2734+3364869b";
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/sig/key.ts
|
|
16
17
|
/** Classifies decoding failures without hiding unexpected loader errors. */
|
|
@@ -105,7 +106,7 @@ function generateCryptoKeyPair(algorithm) {
|
|
|
105
106
|
*/
|
|
106
107
|
async function exportJwk(key) {
|
|
107
108
|
validateCryptoKey(key);
|
|
108
|
-
const jwk = await crypto.subtle.exportKey("jwk", key);
|
|
109
|
+
const jwk = await crypto.subtle.exportKey("jwk", asCryptoKey(key));
|
|
109
110
|
if (jwk.crv === "Ed25519") jwk.alg = "Ed25519";
|
|
110
111
|
return jwk;
|
|
111
112
|
}
|
|
@@ -505,12 +506,13 @@ const DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS = 100;
|
|
|
505
506
|
*/
|
|
506
507
|
async function signRequest(request, privateKey, keyId, options = {}) {
|
|
507
508
|
validateCryptoKey(privateKey, "private");
|
|
509
|
+
const signingKey = asCryptoKey(privateKey);
|
|
508
510
|
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("http_signatures.sign", async (span) => {
|
|
509
511
|
try {
|
|
510
512
|
const spec = options.spec ?? "draft-cavage-http-signatures-12";
|
|
511
513
|
let signed;
|
|
512
|
-
if (spec === "rfc9421") signed = await signRequestRfc9421(request,
|
|
513
|
-
else signed = await signRequestDraft(request,
|
|
514
|
+
if (spec === "rfc9421") signed = await signRequestRfc9421(request, signingKey, keyId, span, options.currentTime, options.body);
|
|
515
|
+
else signed = await signRequestDraft(request, signingKey, keyId, span, options.currentTime, options.body);
|
|
514
516
|
if (span.isRecording()) {
|
|
515
517
|
span.setAttribute(ATTR_HTTP_REQUEST_METHOD, signed.method);
|
|
516
518
|
span.setAttribute(ATTR_URL_FULL, signed.url);
|
|
@@ -1,11 +1,12 @@
|
|
|
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 { o as validateCryptoKey, r as fetchKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-CvHOP0XE.mjs";
|
|
5
|
+
import { o as validateCryptoKey, r as fetchKey } from "./key-RrdwitZu.mjs";
|
|
6
6
|
import { CryptographicKey } from "@fedify/vocab";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
9
|
+
import { asCryptoKey } from "@fedify/vocab-runtime/internal";
|
|
9
10
|
import { getLogger } from "@logtape/logtape";
|
|
10
11
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
11
12
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
@@ -25,12 +26,13 @@ const DOUBLE_KNOCK_TRANSPORT_RETRY_DELAY_MS = 100;
|
|
|
25
26
|
*/
|
|
26
27
|
async function signRequest(request, privateKey, keyId, options = {}) {
|
|
27
28
|
validateCryptoKey(privateKey, "private");
|
|
29
|
+
const signingKey = asCryptoKey(privateKey);
|
|
28
30
|
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("http_signatures.sign", async (span) => {
|
|
29
31
|
try {
|
|
30
32
|
const spec = options.spec ?? "draft-cavage-http-signatures-12";
|
|
31
33
|
let signed;
|
|
32
|
-
if (spec === "rfc9421") signed = await signRequestRfc9421(request,
|
|
33
|
-
else signed = await signRequestDraft(request,
|
|
34
|
+
if (spec === "rfc9421") signed = await signRequestRfc9421(request, signingKey, keyId, span, options.currentTime, options.body);
|
|
35
|
+
else signed = await signRequestDraft(request, signingKey, keyId, span, options.currentTime, options.body);
|
|
34
36
|
if (span.isRecording()) {
|
|
35
37
|
span.setAttribute(ATTR_HTTP_REQUEST_METHOD, signed.method);
|
|
36
38
|
span.setAttribute(ATTR_URL_FULL, signed.url);
|