pub struct TokenSourceResponse {
pub server_url: String,
pub participant_token: String,
}Expand description
The credentials returned by a token source: the server to connect to and the participant token to authenticate with.
Fields§
§server_url: String§participant_token: StringImplementations§
Source§impl TokenSourceResponse
impl TokenSourceResponse
Sourcepub fn has_valid_token(&self) -> bool
pub fn has_valid_token(&self) -> bool
Reports whether the participant token is currently usable, with the default tolerance of 60 seconds.
Sourcepub fn has_valid_token_with_tolerance(&self, tolerance: Duration) -> bool
pub fn has_valid_token_with_tolerance(&self, tolerance: Duration) -> bool
Reports whether the participant token is currently usable: it decodes
the token as a JWT without verifying its signature and checks the
nbf/exp claims against the current time. The token is considered
valid when it is already active (now >= nbf, if present) and does not
expire within the given tolerance (now + tolerance < exp).
A token that does not parse as a JWT or has no exp claim is treated
as invalid.
This is a client-side freshness heuristic only — since the signature is never verified, it must not be used as an authorization check.
Trait Implementations§
Source§impl Clone for TokenSourceResponse
impl Clone for TokenSourceResponse
Source§fn clone(&self) -> TokenSourceResponse
fn clone(&self) -> TokenSourceResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more