From 8f806b1bd613594d4d6a541a5881cb8844fec560 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 13 May 2024 13:52:38 +0200 Subject: [PATCH] feat: on debug level show in/out activities --- src/routes/activitypub/inbox.rs | 2 ++ src/routes/activitypub/user/outbox.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/routes/activitypub/inbox.rs b/src/routes/activitypub/inbox.rs index 4612eecc..ac5cabd8 100644 --- a/src/routes/activitypub/inbox.rs +++ b/src/routes/activitypub/inbox.rs @@ -66,6 +66,8 @@ pub async fn post( return Err(UpubError::unauthorized()); } + tracing::debug!("processing federated activity: '{}'", serde_json::to_string(&activity).unwrap_or_default()); + // TODO we could process Links and bare Objects maybe, but probably out of AP spec? match activity.activity_type().ok_or_else(UpubError::bad_request)? { ActivityType::Activity => { diff --git a/src/routes/activitypub/user/outbox.rs b/src/routes/activitypub/user/outbox.rs index decaa1e8..2e132e99 100644 --- a/src/routes/activitypub/user/outbox.rs +++ b/src/routes/activitypub/user/outbox.rs @@ -48,6 +48,7 @@ pub async fn post( Identity::Anonymous => Err(StatusCode::UNAUTHORIZED.into()), Identity::Remote(_) => Err(StatusCode::NOT_IMPLEMENTED.into()), Identity::Local(uid) => if ctx.uid(id.clone()) == uid { + tracing::debug!("processing new local activity: {}", serde_json::to_string(&activity).unwrap_or_default()); match activity.base_type() { None => Err(StatusCode::BAD_REQUEST.into()),