Merge branch 'capabilities_auth' into 'master'

Getting capabilities requires authentication

See merge request famedly/conduit!117
next
Timo Kösters 2021-07-13 07:55:19 +00:00
commit bd4bd58612
1 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,5 @@
use crate::ConduitResult; use crate::ConduitResult;
use crate::Ruma;
use ruma::{ use ruma::{
api::client::r0::capabilities::{ api::client::r0::capabilities::{
get_capabilities, Capabilities, RoomVersionStability, RoomVersionsCapability, get_capabilities, Capabilities, RoomVersionStability, RoomVersionsCapability,
@ -13,9 +14,14 @@ use rocket::get;
/// # `GET /_matrix/client/r0/capabilities` /// # `GET /_matrix/client/r0/capabilities`
/// ///
/// Get information on this server's supported feature set and other relevent capabilities. /// Get information on this server's supported feature set and other relevent capabilities.
#[cfg_attr(feature = "conduit_bin", get("/_matrix/client/r0/capabilities"))] #[cfg_attr(
#[tracing::instrument] feature = "conduit_bin",
pub async fn get_capabilities_route() -> ConduitResult<get_capabilities::Response> { get("/_matrix/client/r0/capabilities", data = "<_body>")
)]
#[tracing::instrument(skip(_body))]
pub async fn get_capabilities_route(
_body: Ruma<get_capabilities::Request>,
) -> ConduitResult<get_capabilities::Response> {
let mut available = BTreeMap::new(); let mut available = BTreeMap::new();
available.insert(RoomVersionId::Version6, RoomVersionStability::Stable); available.insert(RoomVersionId::Version6, RoomVersionStability::Stable);