Skip to main content

Module federation

Module federation 

Source
Expand description

Serving: what Ojak answers when another server, or a person, sends a GET.

An application builds one Federation at start-up, registering a dispatcher for each kind of actor, object and collection it serves, each with the URI template that both routes requests to it and builds its URIs. WebFinger and host-meta follow from the actors, and NodeInfo from one more dispatcher. docs/guide/serving.md explains it.

Federation::handle answers a request in http types, so that it works under any server framework; ojak-axum adapts it to axum.

Re-exports§

pub use crate::template::Values;

Structs§

ActorRef
An actor, as the application names it: its kind and its identifier.
BuildError
Why a federation could not be built.
Builder
Builds a Federation.
Collection
A collection’s dispatchers.
CollectionDocument
An ActivityStreams collection or collection page, written as a document: what Ojak serves a Collection as, for an application that serves one itself, such as a collection paged by a query of its own or embedded in another object.
CollectionRef
A collection of this server’s, as the application registered it.
Context
What every callback receives: the application’s data, the canonical origin, and the request, if there is one. Cheap to clone.
Federation
Everything Ojak serves, and the URIs it builds. Cheap to clone.
Forward
An activity to forward, as it was authenticated here: the receiver establishes it for itself, from its proof or from its origin, since the signature on the forward is this server’s.
GatewayInbox
A portable inbox this server is a gateway for, as the application describes it: who receives what arrives there, and every gateway the actor lists, this one included.
InboxWorker
Runs the listeners for activities queued in an inbox’s queue.
InboxWorkerConfig
How an InboxWorker runs.
KnownKey
A key the application already holds for a key ID: its PEM, and the actor that published it.
NodeInfo
A server’s NodeInfo, in the 2.1 schema; 2.0 is served from it without what 2.0 lacks.
Page
One page of a collection.
Received
An activity, as a listener receives it.
Software
The software a server runs.
Uris
The URIs of what a federation serves, in one origin, built from the templates their routes were registered with.
Usage
How much a server is used.

Enums§

Access
What a guard (Builder::guard) makes of a request.
First
Where a paged collection starts.
ForwardTo
Where an activity is forwarded.
Found
What a dispatcher found.
Handled
What Federation::handle made of a request.
PublicKey
A public key an actor publishes.
Route
What an IRI of ours is, from Context::parse_uri.
Signing
How a GET was signed, as Context::signing tells it.
UriError
Why a URI could not be built.
VouchedBy
What an activity was taken on: whose word it is that its actor sent it.

Constants§

ACTIVITY_JSON
The media type every ActivityPub document is served as.
MAX_INBOX_BODY
The largest activity an inbox reads.
PORTABLE_JSON
The media type a gateway serves portable objects as (FEP-ef61).

Functions§

default_context
The @context a document gets when its dispatcher gave it none: ActivityStreams, with the security and Multikey vocabularies that keys are written in.
with_keys
Put keys into actor, a document whose id is set: the first RSA key as publicKey, and every Multikey in assertionMethod.

Type Aliases§

Error
What a dispatcher’s error is turned into: anything that is an error, a String, or an anyhow::Error.