Skip to main content

Module webfinger

Module webfinger 

Source
Expand description

Finding an actor by its handle, through WebFinger (RFC 7033).

A handle, @alice@social.example, is an Address: a user and a host. Fetcher::webfinger asks the host’s WebFinger endpoint for it, through the guarded client, and reads the actors its self links name. The host answers only for itself: an actor it names on another origin is a claim an application that shows the handle should check against the actor, as it would any other.

Structs§

Address
A handle: a user at a host.
Found
What a WebFinger answer says of an address.
Named
An actor a WebFinger answer names.
Resolved
A handle resolved through WebFinger: the handle its host gave as the subject, and the actor the answer’s first ActivityPub self link names.

Enums§

ResolveError
Why a handle could not be resolved.

Constants§

JRD_ACCEPT
What a WebFinger query asks for.
XRD_ACCEPT
What a host-meta query asks for.

Functions§

confirm_with
Confirm that address names actor, as Mastodon’s ProcessAccountService#check_webfinger! does before it believes an actor’s handle: resolve_with, and the actor the canonical handle’s answer names has to be actor. Returns what it resolved to, whose address is the handle to show.
lrdd_template
The WebFinger query template a host-meta document (an XRD) gives in its lrdd link, as Mastodon’s Webfinger#url_from_template reads it: the first Link element, in the document’s default namespace, whose rel is lrdd.
resolve_with
Resolve address through WebFinger as Mastodon’s ResolveAccountService does, asking each host with lookup: an answer has to have a subject and an ActivityPub self link. When the subject is the handle asked about, compared without regard to case, that is the answer; when it is another, that handle is asked about in turn, once, and its answer has to name itself. An application that builds the query URL itself — over plain http for an onion service, say — passes a lookup that calls Fetcher::webfinger_at; Fetcher::resolve asks with Fetcher::webfinger.