mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 12:46:49 +00:00
refactor: Represent route auth information in the type system
This commit is contained in:
1 parent
dabbdc7517
commit
74841b6711
78 files changed
+496
-482
No files matched your search
@@ -28,7 +28,7 @@ pub(crate) async fn get_backfill_route(
|
||||
) -> Result<get_backfill::v1::Response> {
|
||||
AccessCheck {
|
||||
services: &services,
|
||||
origin: body.origin(),
|
||||
origin: &body.identity,
|
||||
room_id: &body.room_id,
|
||||
event_id: None,
|
||||
}
|
||||
@@ -41,7 +41,7 @@ pub(crate) async fn get_backfill_route(
|
||||
.await
|
||||
{
|
||||
info!(
|
||||
origin = body.origin().as_str(),
|
||||
origin = body.identity.as_str(),
|
||||
"Refusing to serve backfill for room we aren't participating in"
|
||||
);
|
||||
return Err!(Request(NotFound("This server is not participating in that room.")));
|
||||
@@ -76,7 +76,7 @@ pub(crate) async fn get_backfill_route(
|
||||
Ok(services
|
||||
.rooms
|
||||
.state_accessor
|
||||
.server_can_see_event(body.origin(), &pdu.room_id_or_hash(), &pdu.event_id)
|
||||
.server_can_see_event(&body.identity, &pdu.room_id_or_hash(), &pdu.event_id)
|
||||
.await
|
||||
.then_some(pdu))
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user