pub struct TokenBrokerConfig {
pub url: String,
pub headers: Vec<(String, String)>,
pub claims: Map<String, Value>,
pub auth: BrokerAuth,
pub timeout: Duration,
pub default_ttl: Duration,
}Expand description
Token broker settings.
Fields§
§url: String§headers: Vec<(String, String)>Extra headers sent to the broker.
claims: Map<String, Value>Extra JSON fields sent with every request (e.g. app id, device id).
auth: BrokerAuth§timeout: Duration§default_ttl: DurationLifetime assumed for tokens returned without an expiry.
Implementations§
Source§impl TokenBrokerConfig
impl TokenBrokerConfig
pub fn new(url: impl Into<String>) -> Self
Sourcepub fn default_ttl(self, ttl: Duration) -> Self
pub fn default_ttl(self, ttl: Duration) -> Self
Lifetime assumed for tokens returned without an expiry.
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn claim(self, key: impl Into<String>, value: Value) -> Self
pub fn auth(self, auth: BrokerAuth) -> Self
Trait Implementations§
Source§impl Clone for TokenBrokerConfig
impl Clone for TokenBrokerConfig
Auto Trait Implementations§
impl !RefUnwindSafe for TokenBrokerConfig
impl !UnwindSafe for TokenBrokerConfig
impl Forget for TokenBrokerConfig
impl Freeze for TokenBrokerConfig
impl Move for TokenBrokerConfig
impl Send for TokenBrokerConfig
impl Sync for TokenBrokerConfig
impl Unpin for TokenBrokerConfig
impl UnsafeUnpin for TokenBrokerConfig
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