pub struct TokenParams {
pub ttl: Option<i64>,
pub capability: Option<String>,
pub client_id: Option<String>,
}Expand description
TokenParams : An unsigned token request. Sent with HTTP Basic auth; Ably signs the token server-side. To request all of the key’s capabilities, omit capability.
Fields§
§ttl: Option<i64>Requested time-to-live in milliseconds. Defaults to 3600000 (1 hour) when omitted. Tokens from a revocable-tokens key are capped at 1 hour.
capability: Option<String>A capability document as a JSON string (a stringified object mapping resource-name patterns to arrays of operations, e.g. {\"my-room\":[\"publish\",\"history\"]}). For a signed TokenRequest this string must be canonicalized (resource keys and operation arrays sorted, no whitespace) because it is part of the HMAC-signed text. See SPEC §13.
client_id: Option<String>The identity to bind the token to. The resulting token may only act as this clientId; * grants the privileged wildcard identity.
Implementations§
Source§impl TokenParams
impl TokenParams
Sourcepub fn new() -> TokenParams
pub fn new() -> TokenParams
An unsigned token request. Sent with HTTP Basic auth; Ably signs the token server-side. To request all of the key’s capabilities, omit capability.
Trait Implementations§
Source§impl Clone for TokenParams
impl Clone for TokenParams
Source§fn clone(&self) -> TokenParams
fn clone(&self) -> TokenParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more