Skip to main content

Crate actpub_axum

Crate actpub_axum 

Source
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 configured InboxPipeline.
  • webfinger_router/.well-known/webfinger endpoint resolving acct: URIs via a user-supplied callback.
  • nodeinfo_router/.well-known/nodeinfo discovery + per-version schema endpoints.
  • FederationJson<T> responder — serialises T with the application/activity+json media 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§

FederationJson
JSON responder that emits the federation-mandated Content-Type.
InboxState
Shared state handed to the inbox handler.
NodeInfoState
Shared state for the NodeInfo router.

Constants§

ACTIVITY_PUB_CONTENT_TYPE
Wire-mandated Content-Type for ActivityPub JSON 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-Type mandated by RFC 7033 §10.2 for JRD responses.
NODEINFO_CONTENT_TYPE
Content-Type Mastodon and most Fediverse peers send for NodeInfo documents (matches what nodeinfo.diaspora.software recommends).

Traits§

WebFingerResolver
Asynchronous callback that resolves a ?resource=<uri> query into a Jrd describing it.

Functions§

inbox_router
Builds an axum Router mounted at /inbox that POSTs into the supplied state’s pipeline.
nodeinfo_router
Builds the NodeInfo router.
webfinger_router
Builds the /.well-known/webfinger router.