forked from alemi/upub
feat: on debug level show in/out activities
This commit is contained in:
parent
aba8c14cf4
commit
8f806b1bd6
2 changed files with 3 additions and 0 deletions
|
@ -66,6 +66,8 @@ pub async fn post(
|
||||||
return Err(UpubError::unauthorized());
|
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?
|
// 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)? {
|
match activity.activity_type().ok_or_else(UpubError::bad_request)? {
|
||||||
ActivityType::Activity => {
|
ActivityType::Activity => {
|
||||||
|
|
|
@ -48,6 +48,7 @@ pub async fn post(
|
||||||
Identity::Anonymous => Err(StatusCode::UNAUTHORIZED.into()),
|
Identity::Anonymous => Err(StatusCode::UNAUTHORIZED.into()),
|
||||||
Identity::Remote(_) => Err(StatusCode::NOT_IMPLEMENTED.into()),
|
Identity::Remote(_) => Err(StatusCode::NOT_IMPLEMENTED.into()),
|
||||||
Identity::Local(uid) => if ctx.uid(id.clone()) == uid {
|
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() {
|
match activity.base_type() {
|
||||||
None => Err(StatusCode::BAD_REQUEST.into()),
|
None => Err(StatusCode::BAD_REQUEST.into()),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue