ruma_federation_api/discovery/
get_server_keys.rs1pub mod v2 {
6 use ruma_common::{
11 api::{auth_scheme::NoAuthentication, request, response},
12 metadata,
13 serde::Raw,
14 };
15
16 use crate::discovery::ServerSigningKeys;
17
18 metadata! {
19 method: GET,
20 rate_limited: false,
21 authentication: NoAuthentication,
22 path: "/_matrix/key/v2/server",
23 }
24
25 #[request]
27 #[derive(Default)]
28 pub struct Request {}
29
30 #[response]
32 pub struct Response {
33 #[ruma_api(body)]
35 pub server_key: Raw<ServerSigningKeys>,
36 }
37
38 impl Request {
39 pub fn new() -> Self {
41 Self {}
42 }
43 }
44
45 impl Response {
46 pub fn new(server_key: Raw<ServerSigningKeys>) -> Self {
48 Self { server_key }
49 }
50 }
51
52 impl From<Raw<ServerSigningKeys>> for Response {
53 fn from(server_key: Raw<ServerSigningKeys>) -> Self {
54 Self::new(server_key)
55 }
56 }
57}