[[package]]
name = "cookie"
-version = "0.16.1"
+version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917"
+checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
dependencies = [
"percent-encoding",
"time 0.3.15",
"bcrypt",
"captcha",
"chrono",
- "diesel",
"lemmy_api_common",
"lemmy_db_schema",
"lemmy_db_views",
"lemmy_db_views_moderator",
"lemmy_utils",
"serde",
- "serde_json",
"serial_test",
"tokio",
"tracing",
"actix-web",
"actix-ws",
"anyhow",
- "background-jobs",
"chrono",
- "diesel",
"encoding",
"futures",
"lemmy_db_schema",
"lemmy_db_views_actor",
"lemmy_db_views_moderator",
"lemmy_utils",
- "opentelemetry 0.17.0",
"percent-encoding",
"rand 0.8.5",
"regex",
"serde_json",
"strum",
"strum_macros",
- "tokio",
"tracing",
- "tracing-opentelemetry 0.17.4",
"url",
"uuid",
"webpage",
"lemmy_db_views_actor",
"lemmy_utils",
"serde",
- "serde_json",
"tracing",
"url",
"webmention",
"sha2",
"strum_macros",
"task-local-extensions",
- "tokio",
"tracing",
"url",
"uuid",
"diesel-derive-newtype",
"diesel_ltree",
"diesel_migrations",
- "futures",
"lemmy_utils",
"once_cell",
"regex",
"strum_macros",
"tokio",
"tracing",
- "tracing-error",
"typed-builder",
"url",
]
"tokio",
"tracing",
"typed-builder",
- "url",
]
[[package]]
"actix-web",
"anyhow",
"chrono",
- "diesel",
"futures",
"lemmy_api_common",
"lemmy_db_schema",
"console-subscriber",
"diesel",
"diesel-async",
- "diesel_migrations",
"doku",
"futures",
"lemmy_api",
"lemmy_utils",
"opentelemetry 0.17.0",
"opentelemetry-otlp 0.10.0",
- "parking_lot 0.12.1",
"pict-rs",
- "rand 0.8.5",
"reqwest",
"reqwest-middleware",
"reqwest-retry",
"lettre",
"once_cell",
"openssl",
- "parking_lot 0.12.1",
"percent-encoding",
- "rand 0.8.5",
"regex",
"reqwest",
"reqwest-middleware",
reqwest-tracing = "0.4.0"
clokwerk = "0.3.5"
doku = { version = "0.20.0", features = ["url-2"] }
-parking_lot = "0.12.1"
reqwest-retry = "0.2.0"
bcrypt = "0.13.0"
chrono = { version = "0.4.22", features = ["serde"], default-features = false }
lemmy_routes = { workspace = true }
activitypub_federation = { workspace = true }
diesel = { workspace = true }
-diesel_migrations = { workspace = true }
diesel-async = { workspace = true }
serde = { workspace = true }
actix-web = { workspace = true }
reqwest-tracing = { workspace = true }
clokwerk = { workspace = true }
doku = { workspace = true }
-parking_lot = { workspace = true }
reqwest-retry = { workspace = true }
serde_json = { workspace = true }
futures = { workspace = true }
opentelemetry = { workspace = true, optional = true }
actix-web-actors = { version = "4.1.0", default-features = false }
actix-rt = "2.6"
-rand = { workspace = true }
console-subscriber = { version = "0.1.8", optional = true }
opentelemetry-otlp = { version = "0.10.0", optional = true }
pict-rs = { version = "0.4.0-beta.9", optional = true }
lemmy_db_views_moderator = { workspace = true, features = ["full"] }
lemmy_db_views_actor = { workspace = true, features = ["full"] }
lemmy_api_common = { workspace = true, features = ["full"] }
-diesel = { workspace = true }
bcrypt = { workspace = true }
chrono = { workspace = true }
-serde_json = { workspace = true }
serde = { workspace = true }
actix-web = { workspace = true }
base64 = { workspace = true }
doctest = false
[features]
-full = ["diesel", "tracing", "rosetta-i18n", "chrono", "actix-web", "lemmy_utils",
+full = ["tracing", "rosetta-i18n", "chrono", "actix-web", "lemmy_utils",
"lemmy_db_views/full", "lemmy_db_views_actor/full", "lemmy_db_views_moderator/full",
"percent-encoding", "encoding", "reqwest-middleware", "webpage"]
url = { workspace = true }
actix-web = { workspace = true, features = ["cookies"], optional = true }
chrono = { workspace = true, optional = true }
-diesel = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
reqwest-middleware = { workspace = true, optional = true }
regex = { workspace = true }
rand = { workspace = true }
serde_json = { workspace = true }
anyhow = { workspace = true }
-tokio = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
-opentelemetry = { workspace = true }
-tracing-opentelemetry = { workspace = true }
actix-ws = { workspace = true }
futures = { workspace = true }
-background-jobs = "0.13.0"
uuid = { workspace = true }
actix-rt = { workspace = true }
reqwest = { workspace = true }
lemmy_api_common = { workspace = true, features = ["full"] }
activitypub_federation = { workspace = true }
bcrypt = { workspace = true }
-serde_json = { workspace = true }
serde = { workspace = true }
actix-web = { workspace = true }
tracing = { workspace = true }
anyhow = { workspace = true }
reqwest = { workspace = true }
once_cell = { workspace = true }
-tokio = { workspace = true }
html2md = "0.2.13"
serde_with = "1.14.0"
http-signature-normalization-actix = { version = "0.6.1", default-features = false, features = ["server", "sha-2"] }
async-trait = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
-tracing-error = { workspace = true }
-futures = { workspace = true }
deadpool = { version = "0.9.5", features = ["rt_tokio_1"], optional = true }
[dev-dependencies]
serde = { workspace = true }
tracing = { workspace = true, optional = true }
typed-builder = { workspace = true }
-url = { workspace = true }
[dev-dependencies]
serial_test = { workspace = true }
lemmy_db_schema = { workspace = true }
lemmy_api_common = { workspace = true, features = ["full"] }
activitypub_federation = { workspace = true }
-diesel = { workspace = true }
actix-web = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
-use activitypub_federation::fetch::webfinger::{Webfinger, WebfingerLink};
+use activitypub_federation::{
+ config::Data,
+ fetch::webfinger::{extract_webfinger_name, Webfinger, WebfingerLink},
+};
use actix_web::{web, web::Query, HttpResponse};
-use anyhow::Context;
use lemmy_api_common::context::LemmyContext;
use lemmy_db_schema::{
source::{community::Community, person::Person},
traits::ApubActor,
};
-use lemmy_utils::{error::LemmyError, location_info};
+use lemmy_utils::error::LemmyError;
use serde::Deserialize;
use std::collections::HashMap;
use url::Url;
/// https://radical.town/.well-known/webfinger?resource=acct:felix@radical.town
async fn get_webfinger_response(
info: Query<Params>,
- context: web::Data<LemmyContext>,
+ context: Data<LemmyContext>,
) -> Result<HttpResponse, LemmyError> {
- let name = context
- .settings()
- .webfinger_regex()
- .captures(&info.resource)
- .and_then(|c| c.get(1))
- .context(location_info!())?
- .as_str()
- .to_string();
+ let name = extract_webfinger_name(&info.resource, &context)?;
let name_ = name.clone();
let user_id: Option<Url> = Person::read_from_name(context.pool(), &name_, false)
tracing = { workspace = true }
tracing-error = { workspace = true }
itertools = { workspace = true }
-rand = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
once_cell = { workspace = true }
doku = { workspace = true, features = ["url-2"] }
uuid = { workspace = true, features = ["serde", "v4"] }
rosetta-i18n = { workspace = true }
-parking_lot = { workspace = true }
typed-builder = { workspace = true }
percent-encoding = { workspace = true }
tokio = { workspace = true }