pub(crate) struct OidcCli {
pub(crate) client: Client,
pub(crate) restored: bool,
pub(crate) session_file: PathBuf,
}
Expand description
An OpenID Connect CLI.
Fields§
§client: Client
The Matrix client.
restored: bool
Whether this is a restored client.
session_file: PathBuf
The path to the file storing the session.
Implementations§
Source§impl OidcCli
impl OidcCli
Sourcepub(crate) async fn new(data_dir: &Path, session_file: PathBuf) -> Result<Self>
pub(crate) async fn new(data_dir: &Path, session_file: PathBuf) -> Result<Self>
Create a new session by logging in.
Sourcepub(crate) async fn register_client(&self, issuer: String) -> Result<String>
pub(crate) async fn register_client(&self, issuer: String) -> Result<String>
Register the OIDC client with the provider.
Returns the ID of the client returned by the provider.
Sourcepub(crate) async fn from_stored_session(session_file: PathBuf) -> Result<Self>
pub(crate) async fn from_stored_session(session_file: PathBuf) -> Result<Self>
Restore a previous session from a file.
pub(crate) async fn recover(&self) -> Result<()>
pub(crate) async fn reset_cross_signing(&self) -> Result<()>
Sourcepub(crate) async fn account(&self, action: Option<AccountManagementActionFull>)
pub(crate) async fn account(&self, action: Option<AccountManagementActionFull>)
Get the account management URL.
Sourcepub(crate) async fn watch_sliding_sync(&self) -> Result<()>
pub(crate) async fn watch_sliding_sync(&self) -> Result<()>
This watches for incoming responses using the high-level sliding sync
helpers (SyncService
).
Sourcepub(crate) fn setup_background_save(&self)
pub(crate) fn setup_background_save(&self)
Sets up this client so that it automatically saves the session onto disk whenever there are new tokens that have been received.
This should always be set up whenever automatic refresh is happening.
Sourcepub(crate) async fn update_stored_session(&self) -> Result<()>
pub(crate) async fn update_stored_session(&self) -> Result<()>
Update the session stored on the system.
This should be called everytime the access token (and possibly refresh token) has changed.
Authorize the given scopes using the OIDC Authorization Code flow.
Sourcepub(crate) async fn refresh_token(&self) -> Result<()>
pub(crate) async fn refresh_token(&self) -> Result<()>
Refresh the access token.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OidcCli
impl !RefUnwindSafe for OidcCli
impl Send for OidcCli
impl Sync for OidcCli
impl Unpin for OidcCli
impl !UnwindSafe for OidcCli
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more