Skip to main content

resolve_with

Function resolve_with 

Source
pub async fn resolve_with<F, Fut>(
    address: &Address,
    lookup: F,
) -> Result<Resolved, ResolveError>
where F: FnMut(&Address) -> Fut, Fut: Future<Output = Result<Found, FetchError>>,
Expand description

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.

The actor is only what the host claims: look it up afterwards to establish it like any other.

§Errors

When a host cannot be asked or its answer is missing either part, the subject is not a handle, or a redirect leads to yet another handle.