mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 16:44:30 +02:00
fix(policy-server): Fixup refactor
Some checks failed
Checks / Prefligit / prefligit (push) Failing after 5s
Release Docker Image / define-variables (push) Failing after 2s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Checks / Rust / Format (push) Failing after 3s
Checks / Rust / Clippy (push) Failing after 19s
Checks / Rust / Cargo Test (push) Failing after 18s
Some checks failed
Checks / Prefligit / prefligit (push) Failing after 5s
Release Docker Image / define-variables (push) Failing after 2s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Checks / Rust / Format (push) Failing after 3s
Checks / Rust / Clippy (push) Failing after 19s
Checks / Rust / Cargo Test (push) Failing after 18s
This commit is contained in:
parent
0df2686255
commit
12cd0b61a9
2 changed files with 13 additions and 5 deletions
|
@ -265,7 +265,7 @@ where
|
|||
"Event has passed policy server check or the policy server was unavailable."
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Additionally, if this is a redaction for a soft-failed event, we soft-fail it
|
||||
|
|
|
@ -166,14 +166,22 @@ pub async fn create_hash_and_sign_event(
|
|||
}
|
||||
|
||||
// Check with the policy server
|
||||
if self
|
||||
match self
|
||||
.services
|
||||
.event_handler
|
||||
.policyserv_check(&pdu, room_id)
|
||||
.ask_policy_server(&pdu, room_id)
|
||||
.await
|
||||
.is_err()
|
||||
{
|
||||
return Err!(Request(Forbidden(debug_warn!("Policy server marked this event as spam"))));
|
||||
| Ok(true) => {},
|
||||
| Ok(false) => {
|
||||
return Err!(Request(Forbidden(debug_warn!(
|
||||
"Policy server marked this event as spam"
|
||||
))));
|
||||
},
|
||||
| Err(e) => {
|
||||
// fail open
|
||||
warn!("Failed to check event with policy server: {e}");
|
||||
},
|
||||
}
|
||||
|
||||
// Hash and sign
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue