feat: on debug level show in/out activities

This commit is contained in:
əlemi 2024-05-13 13:52:38 +02:00
parent aba8c14cf4
commit 8f806b1bd6
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 3 additions and 0 deletions

View file

@ -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 => {

View file

@ -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()),