pub mod v2 {
use ruma_common::{
api::{auth_scheme::NoAuthentication, request, response},
metadata,
serde::Raw,
};
use crate::discovery::ServerSigningKeys;
metadata! {
method: GET,
rate_limited: false,
authentication: NoAuthentication,
path: "/_matrix/key/v2/server",
}
#[request]
#[derive(Default)]
pub struct Request {}
#[response]
pub struct Response {
#[ruma_api(body)]
pub server_key: Raw<ServerSigningKeys>,
}
impl Request {
pub fn new() -> Self {
Self {}
}
}
impl Response {
pub fn new(server_key: Raw<ServerSigningKeys>) -> Self {
Self { server_key }
}
}
impl From<Raw<ServerSigningKeys>> for Response {
fn from(server_key: Raw<ServerSigningKeys>) -> Self {
Self::new(server_key)
}
}
}