Add get event auth endpoint
This commit is contained in:
parent
4ff6c6ecbe
commit
c19bcaab31
@ -8,6 +8,7 @@ Improvements:
|
|||||||
|
|
||||||
* Add endpoints:
|
* Add endpoints:
|
||||||
```
|
```
|
||||||
|
authorization::get_event_authorization::v1,
|
||||||
directory::get_public_rooms::v1,
|
directory::get_public_rooms::v1,
|
||||||
discovery::{
|
discovery::{
|
||||||
discover_homeserver,
|
discover_homeserver,
|
||||||
|
3
ruma-federation-api/src/authorization.rs
Normal file
3
ruma-federation-api/src/authorization.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
//! Endpoints to retrieve the complete auth chain for a given event.
|
||||||
|
|
||||||
|
pub mod get_event_authorization;
|
@ -0,0 +1,2 @@
|
|||||||
|
//! Endpoint to retrieve the complete auth chain for a given event.
|
||||||
|
pub mod v1;
|
@ -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>,
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
mod serde;
|
mod serde;
|
||||||
|
|
||||||
|
pub mod authorization;
|
||||||
pub mod directory;
|
pub mod directory;
|
||||||
pub mod discovery;
|
pub mod discovery;
|
||||||
pub mod membership;
|
pub mod membership;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user