chore: remove Client::authentication_server_info as it's duplicated from Oidc::authentication_server_info

This commit is contained in:
Benjamin Bouvier
2023-09-05 16:03:26 +02:00
parent 44a13fac9f
commit 28ab8e9efc
4 changed files with 3 additions and 15 deletions

View File

@@ -328,7 +328,7 @@ impl Client {
/// OpenID Connect and this `Client` was constructed using auto-discovery by
/// setting the homeserver with [`ClientBuilder::server_name()`].
pub(crate) fn discovered_authentication_server(&self) -> Option<AuthenticationServerInfo> {
self.inner.authentication_server_info().cloned()
self.inner.oidc().authentication_server_info().cloned()
}
/// The sliding sync proxy that is trusted by the homeserver. `None` when

View File

@@ -23,6 +23,7 @@ use crate::oidc::{self, Oidc, OidcAuthData};
/// children.
pub(crate) struct AuthCtx {
/// The authentication server info discovered from the homeserver.
#[cfg_attr(not(feature = "experimental-oidc"), allow(dead_code))]
pub(crate) authentication_server_info: Option<AuthenticationServerInfo>,
}

View File

@@ -53,7 +53,6 @@ use ruma::{
device::{delete_devices, get_devices, update_device},
directory::{get_public_rooms, get_public_rooms_filtered},
discovery::{
discover_homeserver::AuthenticationServerInfo,
get_capabilities::{self, Capabilities},
get_supported_versions,
},
@@ -371,18 +370,6 @@ impl Client {
self.inner.homeserver.read().await.clone()
}
/// The authentication server info discovered from the homeserver.
///
/// This will only be set if the homeserver supports authenticating via
/// OpenID Connect ([MSC3861]) and this `Client` was constructed using
/// auto-discovery by setting the homeserver with
/// [`ClientBuilder::server_name()`].
///
/// [MSC3861]: https://github.com/matrix-org/matrix-spec-proposals/pull/3861
pub fn authentication_server_info(&self) -> Option<&AuthenticationServerInfo> {
self.inner.auth_ctx.authentication_server_info.as_ref()
}
/// The sliding sync proxy that is trusted by the homeserver.
#[cfg(feature = "experimental-sliding-sync")]
pub fn sliding_sync_proxy(&self) -> Option<Url> {

View File

@@ -552,7 +552,7 @@ async fn build_client(
// Check if the homeserver advertises an OIDC Provider with auto-discovery.
// This can be bypassed by providing the issuer manually, but it should be the
// most common case for public homeservers.
if let Some(issuer_info) = client.authentication_server_info().cloned() {
if let Some(issuer_info) = client.oidc().authentication_server_info().cloned() {
println!("Found issuer: {}", issuer_info.issuer);
let homeserver = client.homeserver().await.to_string();