pub struct IdentityClient {
pub metrics: Arc<Metrics>,
pub brand: Option<String>,
pub access_token: String,
pub server_url: Url,
pub matrix_client: Arc<MatrixClient>,
}Expand description
A way to access an Identity Server using the Identity Service API from a MatrixClient.
Fields§
§metrics: Arc<Metrics>§brand: Option<String>§access_token: String§server_url: Url§matrix_client: Arc<MatrixClient>Implementations§
Source§impl IdentityClient
impl IdentityClient
pub fn new( access_token: &str, server_url: Url, matrix_client: Arc<MatrixClient>, ) -> Self
Sourcepub async fn do_request(
&self,
method: Method,
endpoint: &str,
qs: Option<&[(&str, &str)]>,
body: Option<Value>,
) -> Result<Response>
pub async fn do_request( &self, method: Method, endpoint: &str, qs: Option<&[(&str, &str)]>, body: Option<Value>, ) -> Result<Response>
Performs a web request to the server, applying appropriate authorization headers for this client.
Sourcepub async fn get_account(&self) -> Result<Value>
pub async fn get_account(&self) -> Result<Value>
Gets account information for the logged in user.
Sourcepub async fn get_terms_of_service(&self) -> Result<Value>
pub async fn get_terms_of_service(&self) -> Result<Value>
Gets the terms of service for which the identity server has.
Sourcepub async fn accept_terms(&self, terms_urls: Vec<String>) -> Result<()>
pub async fn accept_terms(&self, terms_urls: Vec<String>) -> Result<()>
Accepts a given set of URLs from Policy objects returned by the server.
Sourcepub async fn accept_all_terms(&self) -> Result<()>
pub async fn accept_all_terms(&self) -> Result<()>
Accepts all terms of service offered by the identity server.
Sourcepub async fn lookup(
&self,
addresses: Vec<String>,
algorithm: &str,
pepper: &str,
) -> Result<Value>
pub async fn lookup( &self, addresses: Vec<String>, algorithm: &str, pepper: &str, ) -> Result<Value>
Looks up a series of third party identifiers.
Sourcepub async fn lookup_threepids(
&self,
identifiers: &[Threepid],
allow_plaintext: bool,
) -> Result<Vec<Option<String>>>
pub async fn lookup_threepids( &self, identifiers: &[Threepid], allow_plaintext: bool, ) -> Result<Vec<Option<String>>>
Looks up third-party identifiers and returns mxids in the same order as input.
Mirrors the TypeScript SDK behaviour: it negotiates hashing via /hash_details,
prefers sha256, and can optionally fall back to plaintext (none).
Sourcepub async fn make_email_invite(
&self,
email_address: &str,
room_id: &str,
) -> Result<Value>
pub async fn make_email_invite( &self, email_address: &str, room_id: &str, ) -> Result<Value>
Creates a third party email invite.
Sourcepub async fn acquire(
oidc: &OpenIDConnect,
server_url: Url,
matrix_client: Arc<MatrixClient>,
) -> Result<Self>
pub async fn acquire( oidc: &OpenIDConnect, server_url: Url, matrix_client: Arc<MatrixClient>, ) -> Result<Self>
Registers an OpenID Connect token against an identity server and acquires a client.
Trait Implementations§
Source§impl Clone for IdentityClient
impl Clone for IdentityClient
Source§fn clone(&self) -> IdentityClient
fn clone(&self) -> IdentityClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more