A crate to help you fetch and serve WebFinger resources
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
Gelez 4e8f12810c
Merge pull request #11 from Plume-org/feat/async-trait
11 ay önce
src add tests for AsyncResolver; use cargo clippy for further guidance. 11 ay önce
.gitattributes add git attributes and remove executable bit from files in repo 11 ay önce
.gitignore Initial commit 2 yıl önce
.travis.yml add async tests to travis test script 11 ay önce
Cargo.toml update mockito to fix its compile issue 11 ay önce
LICENSE Add a license file (GPL-3.0) 2 yıl önce
README.md Add some badges! 2 yıl önce
coverage.sh Try to add codecov 2 yıl önce


WebFinger Crates.io Libraries.io dependency status for GitHub repo Codecov Build Status

A crate to help you fetch and serve WebFinger resources.


Fetching a resource:

use webfinger::resolve;

fn main() {
    let res = resolve("acct:test@example.org", true).expect("Error while fetching resource");

    println!("Places to get more informations about {}:", res.subject);
    for link in res.links.into_iter() {
        println!("- {}", link.href);

Serving resources:

use webfinger::Resolver;

pub struct MyResolver;

impl Resolver<DatabaseConnection> for MyResolver {
    fn instance_domain<'a>() -> &'a str {

    fn find(acct: String, db: DatabaseConnection) -> Result<Webfinger, ResolverError> {
        if let Some(user) = db.find_user_by_name(acct) {
            Ok(Webfinger {
                subject: acct.clone(),
                aliases: vec![acct.clone()],
                links: vec![
                    Link {
                        rel: "http://webfinger.net/rel/profile-page".to_string(),
                        mime_type: None,
                        href: user.profile_url()
        } else {

fn main() {
    // Start a web server and map /.well-known/webfinger to a function calling MyResolver::endpoint