federation-api: Add versions endpoint (MSC3723)
This commit is contained in:
parent
e336db767a
commit
1ffccaba18
@ -19,6 +19,7 @@ unstable-exhaustive-types = []
|
|||||||
unstable-pre-spec = []
|
unstable-pre-spec = []
|
||||||
unstable-msc2448 = []
|
unstable-msc2448 = []
|
||||||
unstable-msc3618 = []
|
unstable-msc3618 = []
|
||||||
|
unstable-msc3723 = []
|
||||||
client = []
|
client = []
|
||||||
server = []
|
server = []
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ pub mod get_remote_server_keys;
|
|||||||
pub mod get_remote_server_keys_batch;
|
pub mod get_remote_server_keys_batch;
|
||||||
pub mod get_server_keys;
|
pub mod get_server_keys;
|
||||||
pub mod get_server_version;
|
pub mod get_server_version;
|
||||||
|
#[cfg(feature = "unstable-msc3723")]
|
||||||
|
pub mod get_server_versions;
|
||||||
|
|
||||||
/// Public key of the homeserver for verifying digital signatures.
|
/// Public key of the homeserver for verifying digital signatures.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
//! Endpoint to receive metadata about implemented matrix versions.
|
||||||
|
|
||||||
|
pub mod msc3723 {
|
||||||
|
//! [GET /_matrix/federation/versions](https://github.com/matrix-org/matrix-doc/pull/3723)
|
||||||
|
|
||||||
|
use ruma_common::api::ruma_api;
|
||||||
|
|
||||||
|
ruma_api! {
|
||||||
|
metadata: {
|
||||||
|
description: "Get the supported matrix versions of this homeserver",
|
||||||
|
method: GET,
|
||||||
|
name: "get_server_versions",
|
||||||
|
unstable_path: "/_matrix/federation/unstable/org.matrix.msc3723/versions",
|
||||||
|
rate_limited: false,
|
||||||
|
authentication: None,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
request: {}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
response: {
|
||||||
|
/// A list of Matrix Server API protocol versions supported by the homeserver.
|
||||||
|
pub versions: Vec<String>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Request {
|
||||||
|
/// Creates an empty `Request`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates an empty `Response`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Default::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -120,6 +120,7 @@ unstable-msc2677 = ["ruma-common/unstable-msc2677"]
|
|||||||
unstable-msc3551 = ["ruma-common/unstable-msc3551"]
|
unstable-msc3551 = ["ruma-common/unstable-msc3551"]
|
||||||
unstable-msc3552 = ["ruma-common/unstable-msc3552"]
|
unstable-msc3552 = ["ruma-common/unstable-msc3552"]
|
||||||
unstable-msc3618 = ["ruma-federation-api/unstable-msc3618"]
|
unstable-msc3618 = ["ruma-federation-api/unstable-msc3618"]
|
||||||
|
unstable-msc3723 = ["ruma-federation-api/unstable-msc3723"]
|
||||||
|
|
||||||
# Private feature, only used in test / benchmarking code
|
# Private feature, only used in test / benchmarking code
|
||||||
__ci = [
|
__ci = [
|
||||||
@ -133,6 +134,7 @@ __ci = [
|
|||||||
"unstable-msc3551",
|
"unstable-msc3551",
|
||||||
"unstable-msc3552",
|
"unstable-msc3552",
|
||||||
"unstable-msc3618",
|
"unstable-msc3618",
|
||||||
|
"unstable-msc3723",
|
||||||
"ruma-state-res/__ci",
|
"ruma-state-res/__ci",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user