pub struct BearerAuthRequest {
pub request_timestamp_secs: u64,
pub lifetime_secs: u32,
pub scope: LexeScope,
}Expand description
A client’s request for a new BearerAuthToken.
This is the convenient in-memory representation.
Fields§
§request_timestamp_secs: u64The timestamp of this auth request, in seconds since UTC Unix time, interpreted relative to the server clock. Used to prevent replaying old auth requests after expiration.
The server will reject timestamps w/ > 30 minute clock skew from the server clock.
lifetime_secs: u32How long the new auth token should be valid for, in seconds. Must be at most 1 hour. The new token expiration is generated relative to the server clock.
scope: LexeScopeThe LexeScope requested for the new bearer auth token.
Implementations§
Source§impl BearerAuthRequest
impl BearerAuthRequest
pub fn new(now: SystemTime, token_lifetime_secs: u32, scope: LexeScope) -> Self
Sourcepub fn request_timestamp(&self) -> Result<SystemTime, Error>
pub fn request_timestamp(&self) -> Result<SystemTime, Error>
Get the request_timestamp as a SystemTime. Returns Err if the
issued_timestamp is too large to be represented as a unix timestamp
(> 2^63 on linux).
Trait Implementations§
Source§impl Clone for BearerAuthRequest
impl Clone for BearerAuthRequest
Source§fn clone(&self) -> BearerAuthRequest
fn clone(&self) -> BearerAuthRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BearerAuthRequest
impl Debug for BearerAuthRequest
Source§impl From<BearerAuthRequest> for BearerAuthRequestWire
impl From<BearerAuthRequest> for BearerAuthRequestWire
Source§fn from(req: BearerAuthRequest) -> Self
fn from(req: BearerAuthRequest) -> Self
Converts to this type from the input type.
Source§impl From<BearerAuthRequestWire> for BearerAuthRequest
impl From<BearerAuthRequestWire> for BearerAuthRequest
Source§fn from(wire: BearerAuthRequestWire) -> Self
fn from(wire: BearerAuthRequestWire) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BearerAuthRequest
impl RefUnwindSafe for BearerAuthRequest
impl Send for BearerAuthRequest
impl Sync for BearerAuthRequest
impl Unpin for BearerAuthRequest
impl UnsafeUnpin for BearerAuthRequest
impl UnwindSafe for BearerAuthRequest
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