View Source Mobilizon.Federation.WebFinger (Mobilizon v5.0.0-beta.1)

Performs the WebFinger requests and responses (JSON only).

Summary

Functions

Finger an actor to retreive it's ActivityPub ID/URL

Returns the Web Host Metadata (for /.well-known/host-meta) representation for the instance, following RFC6414.

Return an Mobilizon.Actors.Actor Webfinger representation (as JSON)

Returns the Webfinger representation for the instance, following RFC7033.

Types

@type finger_errors() ::
  :host_not_found
  | :address_invalid
  | :http_error
  | :webfinger_information_not_json
  | :webfinger_information_not_valid
  | :no_url_in_webfinger_data

Functions

@spec finger(String.t()) :: {:ok, String.t()} | {:error, finger_errors()}

Finger an actor to retreive it's ActivityPub ID/URL

Fetches the Extensible Resource Descriptor endpoint /.well-known/host-meta to find the Webfinger endpoint (usually /.well-known/webfinger?resource=) and then performs a Webfinger query to get the ActivityPub ID associated to an actor.

@spec host_meta() :: String.t()

Returns the Web Host Metadata (for /.well-known/host-meta) representation for the instance, following RFC6414.

Link to this function

represent_actor(actor, binary)

View Source
@spec represent_actor(Mobilizon.Actors.Actor.t(), String.t()) :: map()

Return an Mobilizon.Actors.Actor Webfinger representation (as JSON)

Link to this function

webfinger(resource, binary)

View Source
@spec webfinger(String.t(), String.t()) :: {:ok, map()} | {:error, :actor_not_found}

Returns the Webfinger representation for the instance, following RFC7033.