Loading docs/manual/inbox.md +4 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,10 @@ federation }); ~~~~ > [!NOTE] > If a shared inbox key dispatcher returns `null`, the default `documentLoader`, > which is not authenticated, is used for the shared inbox. [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch [instance actor]: https://seb.jambor.dev/posts/understanding-activitypub-part-4-threads/#the-instance-actor Loading federation/callback.ts +3 −2 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ export type InboxErrorHandler<TContextData> = ( * @param context The request context. * @returns The handle of the actor or the key pair for the authenticated * document loader of the {@link Context} passed to the shared inbox * listener. * listener. If `null` is returned, the request is not authorized. * @since 0.11.0 */ export type SharedInboxKeyDispatcher<TContextData> = ( Loading @@ -144,7 +144,8 @@ export type SharedInboxKeyDispatcher<TContextData> = ( ) => | SenderKeyPair | { handle: string } | Promise<SenderKeyPair | { handle: string }>; | null | Promise<SenderKeyPair | { handle: string } | null>; /** * A callback that handles errors during outbox processing. Loading federation/middleware.ts +7 −5 Original line number Diff line number Diff line Loading @@ -1417,12 +1417,14 @@ export class Federation<TContextData> { case "sharedInbox": if (routeName !== "inbox" && this.#sharedInboxKeyDispatcher != null) { const identity = await this.#sharedInboxKeyDispatcher(context); if (identity != null) { context = this.#createContext(request, contextData, { documentLoader: "handle" in identity ? await context.getDocumentLoader(identity) : context.getDocumentLoader(identity), }); } } return await handleInbox(request, { handle: route.values.handle ?? null, context, Loading Loading
docs/manual/inbox.md +4 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,10 @@ federation }); ~~~~ > [!NOTE] > If a shared inbox key dispatcher returns `null`, the default `documentLoader`, > which is not authenticated, is used for the shared inbox. [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch [instance actor]: https://seb.jambor.dev/posts/understanding-activitypub-part-4-threads/#the-instance-actor Loading
federation/callback.ts +3 −2 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ export type InboxErrorHandler<TContextData> = ( * @param context The request context. * @returns The handle of the actor or the key pair for the authenticated * document loader of the {@link Context} passed to the shared inbox * listener. * listener. If `null` is returned, the request is not authorized. * @since 0.11.0 */ export type SharedInboxKeyDispatcher<TContextData> = ( Loading @@ -144,7 +144,8 @@ export type SharedInboxKeyDispatcher<TContextData> = ( ) => | SenderKeyPair | { handle: string } | Promise<SenderKeyPair | { handle: string }>; | null | Promise<SenderKeyPair | { handle: string } | null>; /** * A callback that handles errors during outbox processing. Loading
federation/middleware.ts +7 −5 Original line number Diff line number Diff line Loading @@ -1417,12 +1417,14 @@ export class Federation<TContextData> { case "sharedInbox": if (routeName !== "inbox" && this.#sharedInboxKeyDispatcher != null) { const identity = await this.#sharedInboxKeyDispatcher(context); if (identity != null) { context = this.#createContext(request, contextData, { documentLoader: "handle" in identity ? await context.getDocumentLoader(identity) : context.getDocumentLoader(identity), }); } } return await handleInbox(request, { handle: route.values.handle ?? null, context, Loading