"diesel",
"futures",
"lemmy_api_common",
- "lemmy_apub",
"lemmy_db_schema",
"lemmy_db_views",
"lemmy_db_views_actor",
use itertools::Itertools;
use lemmy_api_common::LemmyContext;
use lemmy_db_schema::newtypes::DbUrl;
-use lemmy_utils::error::LemmyError;
-use serde::{Deserialize, Serialize};
+use lemmy_utils::{error::LemmyError, WebfingerResponse};
use tracing::debug;
use url::Url;
-#[derive(Serialize, Deserialize, Debug)]
-pub struct WebfingerLink {
- pub rel: Option<String>,
- #[serde(rename = "type")]
- pub kind: Option<String>,
- pub href: Option<Url>,
-}
-
-#[derive(Serialize, Deserialize, Debug)]
-pub struct WebfingerResponse {
- pub subject: String,
- pub links: Vec<WebfingerLink>,
-}
-
/// Turns a person id like `@name@example.com` into an apub ID, like `https://example.com/user/name`,
/// using webfinger.
#[tracing::instrument(skip_all)]
lemmy_db_views_actor = { workspace = true }
lemmy_db_schema = { workspace = true }
lemmy_api_common = { workspace = true }
-lemmy_apub = { workspace = true }
diesel = { workspace = true }
actix-web = { workspace = true }
anyhow = { workspace = true }
use actix_web::{web, web::Query, HttpResponse};
use anyhow::Context;
use lemmy_api_common::LemmyContext;
-use lemmy_apub::fetcher::webfinger::{WebfingerLink, WebfingerResponse};
use lemmy_db_schema::{
source::{community::Community, person::Person},
traits::ApubActor,
};
-use lemmy_utils::{error::LemmyError, location_info};
+use lemmy_utils::{error::LemmyError, location_info, WebfingerLink, WebfingerResponse};
use serde::Deserialize;
use url::Url;
pub mod utils;
pub mod version;
+use serde::{Deserialize, Serialize};
use std::{fmt, time::Duration};
+use url::Url;
pub type ConnectionId = usize;
}
}
+#[derive(Serialize, Deserialize, Debug)]
+pub struct WebfingerLink {
+ pub rel: Option<String>,
+ #[serde(rename = "type")]
+ pub kind: Option<String>,
+ pub href: Option<Url>,
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct WebfingerResponse {
+ pub subject: String,
+ pub links: Vec<WebfingerLink>,
+}
+
#[macro_export]
macro_rules! location_info {
() => {