pub struct AuthClient<'a> { /* private fields */ }Expand description
Thin typed client for Trellis auth/admin RPCs used by the CLI.
Implementations§
Source§impl<'a> AuthClient<'a>
impl<'a> AuthClient<'a>
Sourcepub fn new(inner: &'a TrellisClient) -> Self
pub fn new(inner: &'a TrellisClient) -> Self
Wrap an already-connected low-level Trellis client.
Sourcepub async fn me(&self) -> Result<AuthenticatedUser, TrellisAuthError>
pub async fn me(&self) -> Result<AuthenticatedUser, TrellisAuthError>
Return the currently authenticated user.
Sourcepub async fn list_approvals(
&self,
user: Option<&str>,
digest: Option<&str>,
) -> Result<Vec<ApprovalEntryRecord>, TrellisAuthError>
pub async fn list_approvals( &self, user: Option<&str>, digest: Option<&str>, ) -> Result<Vec<ApprovalEntryRecord>, TrellisAuthError>
List stored app approval decisions.
Sourcepub async fn revoke_approval(
&self,
digest: &str,
user: Option<&str>,
) -> Result<bool, TrellisAuthError>
pub async fn revoke_approval( &self, digest: &str, user: Option<&str>, ) -> Result<bool, TrellisAuthError>
Revoke one stored approval decision.
Sourcepub async fn list_services(
&self,
) -> Result<Vec<ServiceListEntry>, TrellisAuthError>
pub async fn list_services( &self, ) -> Result<Vec<ServiceListEntry>, TrellisAuthError>
List installed services.
Sourcepub async fn logout(&self) -> Result<bool, TrellisAuthError>
pub async fn logout(&self) -> Result<bool, TrellisAuthError>
Log out the current admin session remotely.
Sourcepub async fn renew_binding_token(
&self,
state: &mut AdminSessionState,
) -> Result<(), TrellisAuthError>
pub async fn renew_binding_token( &self, state: &mut AdminSessionState, ) -> Result<(), TrellisAuthError>
Mint and persist a fresh binding token for the current session.
Auto Trait Implementations§
impl<'a> Freeze for AuthClient<'a>
impl<'a> !RefUnwindSafe for AuthClient<'a>
impl<'a> Send for AuthClient<'a>
impl<'a> Sync for AuthClient<'a>
impl<'a> Unpin for AuthClient<'a>
impl<'a> UnsafeUnpin for AuthClient<'a>
impl<'a> !UnwindSafe for AuthClient<'a>
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
Mutably borrows from an owned value. Read more