mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-10 01:09:27 +00:00
cargo fmt
This commit is contained in:
parent
bd7391e344
commit
2d1f918d78
|
@ -1,9 +1,6 @@
|
|||
use crate::{
|
||||
activities::create_post::CreatePost,
|
||||
database::DatabaseHandle,
|
||||
error::Error,
|
||||
generate_object_id,
|
||||
objects::person::DbUser,
|
||||
activities::create_post::CreatePost, database::DatabaseHandle, error::Error,
|
||||
generate_object_id, objects::person::DbUser,
|
||||
};
|
||||
use activitypub_federation::{
|
||||
config::Data,
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
use crate::{activities::follow::Follow, instance::DatabaseHandle, objects::person::DbUser};
|
||||
use activitypub_federation::{
|
||||
config::Data,
|
||||
fetch::object_id::ObjectId,
|
||||
kinds::activity::AcceptType,
|
||||
traits::ActivityHandler,
|
||||
config::Data, fetch::object_id::ObjectId, kinds::activity::AcceptType, traits::ActivityHandler,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use url::Url;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
use crate::{
|
||||
activities::accept::Accept,
|
||||
generate_object_id,
|
||||
instance::DatabaseHandle,
|
||||
activities::accept::Accept, generate_object_id, instance::DatabaseHandle,
|
||||
objects::person::DbUser,
|
||||
};
|
||||
use activitypub_federation::{
|
||||
|
|
|
@ -17,8 +17,7 @@ use axum::{
|
|||
extract::{Path, Query},
|
||||
response::IntoResponse,
|
||||
routing::{get, post},
|
||||
Json,
|
||||
Router,
|
||||
Json, Router,
|
||||
};
|
||||
use axum_macros::debug_handler;
|
||||
use serde::Deserialize;
|
||||
|
|
|
@ -77,14 +77,14 @@ where
|
|||
.unique()
|
||||
.filter(|i| !config.is_local_url(i))
|
||||
.collect();
|
||||
|
||||
// This field is only optional to make builder work, its always present at this point
|
||||
let activity_queue = config
|
||||
.activity_queue
|
||||
.as_ref()
|
||||
.expect("Config has activity queue");
|
||||
for inbox in inboxes {
|
||||
if config.verify_url_valid(&inbox).await.is_err() {
|
||||
if let Err(err) = config.verify_url_valid(&inbox).await {
|
||||
debug!("inbox url invalid, skipping: {inbox}: {err}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ where
|
|||
{
|
||||
verify_body_hash(request.headers().get("Digest"), &body)?;
|
||||
|
||||
let activity: Activity = serde_json::from_slice(&body)?;
|
||||
let activity: Activity = serde_json::from_slice(&body)
|
||||
.with_context(|| format!("deserializing body: {}", String::from_utf8_lossy(&body)))?;
|
||||
data.config.verify_url_and_domain(&activity).await?;
|
||||
let actor = ObjectId::<ActorT>::from(activity.actor().clone())
|
||||
.dereference(data)
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
use crate::config::{Data, FederationConfig, FederationMiddleware};
|
||||
use actix_web::{
|
||||
dev::{forward_ready, Payload, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
Error,
|
||||
FromRequest,
|
||||
HttpMessage,
|
||||
HttpRequest,
|
||||
Error, FromRequest, HttpMessage, HttpRequest,
|
||||
};
|
||||
use std::future::{ready, Ready};
|
||||
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
#![doc = include_str!("../../docs/07_fetching_data.md")]
|
||||
|
||||
use crate::{
|
||||
config::Data,
|
||||
error::Error,
|
||||
http_signatures::sign_request,
|
||||
reqwest_shim::ResponseExt,
|
||||
config::Data, error::Error, http_signatures::sign_request, reqwest_shim::ResponseExt,
|
||||
FEDERATION_CONTENT_TYPE,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
|
|
Loading…
Reference in a new issue