pub struct AuthStore { /* private fields */ }Expand description
File-backed authentication state shared by all accepted connections.
Implementations§
Source§impl AuthStore
impl AuthStore
Sourcepub fn initialize(path: impl Into<PathBuf>) -> Result<(Self, PairingGrant)>
pub fn initialize(path: impl Into<PathBuf>) -> Result<(Self, PairingGrant)>
Creates fresh auth state and returns the short-lived bootstrap code.
Sourcepub fn open(path: impl Into<PathBuf>) -> Result<Self>
pub fn open(path: impl Into<PathBuf>) -> Result<Self>
Opens previously initialized authentication state.
Sourcepub fn pair(&self, code: &str, client_label: &str) -> Result<IssuedToken>
pub fn pair(&self, code: &str, client_label: &str) -> Result<IssuedToken>
Consumes the pending code and appends an independently issued client token.
Sourcepub fn create_pairing_code(&self) -> Result<PairingGrant>
pub fn create_pairing_code(&self) -> Result<PairingGrant>
Replaces any unused pairing code without invalidating paired clients.
Sourcepub fn authenticate(&self, token: &str) -> Result<ClientIdentity>
pub fn authenticate(&self, token: &str) -> Result<ClientIdentity>
Verifies a bearer token against every paired client digest.
Auto Trait Implementations§
impl !Freeze for AuthStore
impl RefUnwindSafe for AuthStore
impl Send for AuthStore
impl Sync for AuthStore
impl Unpin for AuthStore
impl UnsafeUnpin for AuthStore
impl UnwindSafe for AuthStore
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