client-api: Add MSC2965 feature and m.authentication discovery
This commit is contained in:
parent
11d926ed17
commit
aae6fa2843
@ -16,6 +16,7 @@ Improvements:
|
|||||||
|
|
||||||
* Add unstable support for querying relating events (MSC2675)
|
* Add unstable support for querying relating events (MSC2675)
|
||||||
* Move `filter::RelationType` to `ruma_common::events::relations`
|
* Move `filter::RelationType` to `ruma_common::events::relations`
|
||||||
|
* Add unstable support for discovering an OpenID Connect server (MSC2965)
|
||||||
|
|
||||||
# 0.14.1
|
# 0.14.1
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ unstable-msc2675 = []
|
|||||||
unstable-msc2676 = []
|
unstable-msc2676 = []
|
||||||
unstable-msc2677 = []
|
unstable-msc2677 = []
|
||||||
unstable-msc2918 = []
|
unstable-msc2918 = []
|
||||||
|
unstable-msc2965 = []
|
||||||
unstable-msc3316 = []
|
unstable-msc3316 = []
|
||||||
unstable-msc3440 = []
|
unstable-msc3440 = []
|
||||||
unstable-msc3488 = []
|
unstable-msc3488 = []
|
||||||
|
@ -32,6 +32,11 @@ ruma_api! {
|
|||||||
#[cfg(feature = "unstable-msc3488")]
|
#[cfg(feature = "unstable-msc3488")]
|
||||||
#[serde(rename = "org.matrix.msc3488.tile_server", alias = "m.tile_server")]
|
#[serde(rename = "org.matrix.msc3488.tile_server", alias = "m.tile_server")]
|
||||||
pub tile_server: Option<TileServerInfo>,
|
pub tile_server: Option<TileServerInfo>,
|
||||||
|
|
||||||
|
/// Information about the authentication server to connect to when using OpenID Connect.
|
||||||
|
#[cfg(feature = "unstable-msc2965")]
|
||||||
|
#[serde(rename = "m.authentication")]
|
||||||
|
pub authentication: Option<AuthenticationServerInfo>,
|
||||||
}
|
}
|
||||||
|
|
||||||
error: crate::Error
|
error: crate::Error
|
||||||
@ -52,6 +57,8 @@ impl Response {
|
|||||||
identity_server: None,
|
identity_server: None,
|
||||||
#[cfg(feature = "unstable-msc3488")]
|
#[cfg(feature = "unstable-msc3488")]
|
||||||
tile_server: None,
|
tile_server: None,
|
||||||
|
#[cfg(feature = "unstable-msc2965")]
|
||||||
|
authentication: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,3 +111,25 @@ impl TileServerInfo {
|
|||||||
Self { map_style_url }
|
Self { map_style_url }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Information about a discovered authentication server.
|
||||||
|
#[cfg(feature = "unstable-msc2965")]
|
||||||
|
#[derive(Clone, Debug, Deserialize, Hash, Serialize)]
|
||||||
|
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||||
|
pub struct AuthenticationServerInfo {
|
||||||
|
/// The OIDC Provider that is trusted by the homeserver.
|
||||||
|
pub issuer: String,
|
||||||
|
|
||||||
|
/// The URL where the user is able to access the account management
|
||||||
|
/// capabilities of the OIDC Provider.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub account: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable-msc2965")]
|
||||||
|
impl AuthenticationServerInfo {
|
||||||
|
/// Creates an `AuthenticationServerInfo` with the given `issuer` and an optional `account.
|
||||||
|
pub fn new(issuer: String, account: Option<String>) -> Self {
|
||||||
|
Self { issuer, account }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user