pub struct SetupCodeIssuer { /* private fields */ }Implementations§
Source§impl SetupCodeIssuer
impl SetupCodeIssuer
Sourcepub fn open_or_create(path: &Path) -> Result<Self, PairingError>
pub fn open_or_create(path: &Path) -> Result<Self, PairingError>
Open the secret file at path, or generate it if missing. On
Unix the new file gets 0600 perms; on other platforms we log
and proceed (paridad con OpenClaw).
pub fn issue( &self, url: &str, profile: &str, ttl: Duration, device_label: Option<&str>, ) -> Result<SetupCode, PairingError>
Sourcepub fn verify(&self, token: &str) -> Result<TokenClaims, PairingError>
pub fn verify(&self, token: &str) -> Result<TokenClaims, PairingError>
Verify a previously-issued token. Returns the claims on
success. Constant-time compare on the HMAC. Any tampering
(modified claims, wrong sig, expired) returns the appropriate
PairingError variant.
Auto Trait Implementations§
impl Freeze for SetupCodeIssuer
impl RefUnwindSafe for SetupCodeIssuer
impl Send for SetupCodeIssuer
impl Sync for SetupCodeIssuer
impl Unpin for SetupCodeIssuer
impl UnsafeUnpin for SetupCodeIssuer
impl UnwindSafe for SetupCodeIssuer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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