Expand description
axum 0.8 integration for actpub-federation.
Drop-in router builders that wire the federation runtime into an existing axum service:
inbox_router— POST endpoint dispatching to a configuredInboxPipeline.webfinger_router—/.well-known/webfingerendpoint resolvingacct:URIs via a user-supplied callback.nodeinfo_router—/.well-known/nodeinfodiscovery + per-version schema endpoints.FederationJson<T>responder — serialisesTwith theapplication/activity+jsonmedia type required by every Fediverse peer.
Each router is a standalone Router that mounts at
its conventional path; compose them via
Router::merge to build a complete service.
Structs§
- Federation
Json - JSON responder that emits the federation-mandated
Content-Type. - Inbox
State - Shared state handed to the inbox handler.
- Node
Info State - Shared state for the
NodeInforouter.
Constants§
- ACTIVITY_
PUB_ CONTENT_ TYPE - Wire-mandated
Content-TypeforActivityPubJSON responses. - DEFAULT_
MAX_ INBOX_ BYTES - Default inbox body cap (1 MiB) — large enough for any realistic activity, small enough to bound memory under hostile load.
- JRD_
CONTENT_ TYPE Content-Typemandated by RFC 7033 §10.2 for JRD responses.- NODEINFO_
CONTENT_ TYPE Content-TypeMastodon and most Fediverse peers send forNodeInfodocuments (matches what nodeinfo.diaspora.software recommends).
Traits§
- WebFinger
Resolver - Asynchronous callback that resolves a
?resource=<uri>query into aJrddescribing it.
Functions§
- inbox_
router - Builds an axum
Routermounted at/inboxthat POSTs into the supplied state’s pipeline. - nodeinfo_
router - Builds the
NodeInforouter. - webfinger_
router - Builds the
/.well-known/webfingerrouter.