Files
synapse/rust/src/config/mod.rs
T
Johannes Marbach d0b105757e Add experimental support for MSC4502: Targeted and unrestricted room member queries (#19974)
This is another stopgap towards
https://github.com/element-hq/voip-internal/issues/641 and adds
experimental support for
[MSC4502](https://github.com/matrix-org/matrix-spec-proposals/pull/4502).

This adds a new endpoint `/rooms/{roomId}/is_joined` to query if a user
or server is joined to a room known to the homeserver. Access to the
endpoint is guarded behind a new OAuth scope that can be assigned when
registering application services.

Tracking issue: https://github.com/element-hq/synapse/issues/20118

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-08-20 15:27:11 +01:00

79 lines
2.4 KiB
Rust

/*
* This file is licensed under the Affero General Public License (AGPL) version 3.
*
* Copyright (C) 2026 Element Creations Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* See the GNU Affero General Public License for more details:
* <https://www.gnu.org/licenses/agpl-3.0.html>.
*
*/
use std::collections::BTreeSet;
use pyo3::prelude::*;
pub mod types;
/// A Rust-side view of Synapse's Python `HomeServerConfig`.
///
/// This only mirrors the subset of config that the Rust handlers need, rather
/// than the whole thing. Thanks to `#[derive(FromPyObject)]`, each field is
/// pulled directly off the corresponding attribute of the Python `config`
/// object, so you can populate it in one shot with:
/// ```ignore
/// let config: SynapseHomeServerConfig = homeserver.getattr("config")?.extract()?;
/// ```
#[derive(FromPyObject, Clone)]
pub struct SynapseHomeServerConfig {
pub room: RoomConfig,
pub auth: AuthConfig,
pub server: ServerConfig,
pub experimental: ExperimentalConfig,
}
#[derive(FromPyObject, Clone)]
pub struct RoomConfig {
pub encryption_enabled_by_default_for_room_presets: BTreeSet<types::RoomCreationPreset>,
}
#[derive(FromPyObject, Clone)]
pub struct AuthConfig {
pub login_via_existing_enabled: bool,
}
#[derive(FromPyObject, Clone)]
pub struct ServerConfig {
pub msc4140_enabled: bool,
pub include_profile_updates_in_sync: bool,
}
#[derive(FromPyObject, Clone)]
pub struct ExperimentalConfig {
pub msc3026_enabled: bool,
pub msc3773_enabled: bool,
pub msc2815_enabled: bool,
pub msc3881_enabled: bool,
pub msc3874_enabled: bool,
pub msc3912_enabled: bool,
pub msc3391_enabled: bool,
pub msc4069_profile_inhibit_propagation: bool,
pub msc4028_push_encrypted_events: bool,
pub msc4108_enabled: bool,
pub msc4108_delegation_endpoint: Option<String>,
pub msc3575_enabled: bool,
pub msc4133_enabled: bool,
pub msc4155_enabled: bool,
pub msc4306_enabled: bool,
pub msc4169_enabled: bool,
pub msc4354_enabled: bool,
pub msc4222_enabled: bool,
pub msc4491_enabled: bool,
pub msc4143_enabled: bool,
pub msc4446_enabled: bool,
pub msc4502_enabled: bool,
}