pub struct BearerAuthRequest {
pub request_timestamp_secs: u64,
pub lifetime_secs: u32,
pub scope: Option<Scope>,
}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: Option<Scope>The allowed API scope for the bearer auth token. If unset, the issued
token currently defaults to Scope::All.
Implementations§
Source§impl BearerAuthRequest
impl BearerAuthRequest
pub fn new( now: SystemTime, token_lifetime_secs: u32, scope: Option<Scope>, ) -> 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more