Add get event auth endpoint

This commit is contained in:
skim 2020-07-10 11:36:46 -07:00
parent 4ff6c6ecbe
commit c19bcaab31
No known key found for this signature in database
GPG Key ID: C34FAB15A47E38FA
5 changed files with 39 additions and 0 deletions

View File

@ -8,6 +8,7 @@ Improvements:
* Add endpoints:
```
authorization::get_event_authorization::v1,
directory::get_public_rooms::v1,
discovery::{
discover_homeserver,

View File

@ -0,0 +1,3 @@
//! Endpoints to retrieve the complete auth chain for a given event.
pub mod get_event_authorization;

View File

@ -0,0 +1,2 @@
//! Endpoint to retrieve the complete auth chain for a given event.
pub mod v1;

View File

@ -0,0 +1,32 @@
//! [GET /_matrix/federation/v1/event_auth/{roomId}/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#get-matrix-federation-v1-event-auth-roomid-eventid)
use ruma_api::ruma_api;
use ruma_events::pdu::Pdu;
use ruma_identifiers::{EventId, RoomId};
ruma_api! {
metadata: {
description: "Retrieves the complete auth chain for a given event.",
name: "get_event_authorization",
method: GET,
path: "/_matrix/federation/v1/event_auth/:room_id/:event_id",
rate_limited: false,
requires_authentication: true,
}
request: {
/// The room ID to get the auth chain for.
#[ruma_api(path)]
pub room_id: RoomId,
/// The event ID to get the auth chain for.
#[ruma_api(path)]
pub event_id: EventId,
}
response: {
/// The full set of authorization events that make up the state of the room,
/// and their authorization events, recursively.
pub auth_chain: Vec<Pdu>,
}
}

View File

@ -4,6 +4,7 @@
mod serde;
pub mod authorization;
pub mod directory;
pub mod discovery;
pub mod membership;