2024-11-14 03:16:12 +00:00
|
|
|
use axum::http::StatusCode;
|
2024-11-14 03:02:40 +00:00
|
|
|
use axum_extra::extract::Query;
|
|
|
|
use serde::Deserialize;
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
|
|
pub struct WebfingerQuery {
|
|
|
|
pub resource: String,
|
|
|
|
|
|
|
|
#[serde(default)]
|
|
|
|
pub rel: Vec<String>,
|
|
|
|
}
|
|
|
|
|
2024-11-14 03:16:12 +00:00
|
|
|
#[axum::debug_handler]
|
2024-11-14 03:02:40 +00:00
|
|
|
pub async fn webfinger_handler(
|
|
|
|
Query(WebfingerQuery {resource, rel}): Query<WebfingerQuery>
|
2024-11-14 03:16:12 +00:00
|
|
|
) -> StatusCode {
|
|
|
|
log::info!("Handling a WebFinger request!");
|
|
|
|
log::debug!("Resource is: {resource:#?}");
|
|
|
|
log::debug!("Rel is: {rel:#?}");
|
|
|
|
|
|
|
|
StatusCode::NO_CONTENT
|
2024-11-14 02:50:59 +00:00
|
|
|
}
|