pub struct Auth {
pub credentials: Option<Credentials>,
pub jwt: Option<String>,
pub nkey: Option<String>,
pub token: Option<String>,
pub user_and_password: Option<UserAndPassword>,
}Fields§
§credentials: Option<Credentials>Credentials in the NATS .creds format (user JWT + NKey seed).
jwt: Option<String>User JWT for decentralized (operator-mode) authentication.
Requires nkey to be set as well: the connection nonce is signed
with the NKey seed. Equivalent to credentials, for deployments
that store the JWT and seed separately (e.g. as two secrets)
rather than as one .creds file.
nkey: Option<String>NKey seed (SU...) for NKey challenge-response authentication.
On its own, authenticates as a bare NKey user (a nkey: user in
the server configuration). Combined with jwt, signs the
connection nonce for decentralized authentication.
token: Option<String>Token for token-based authentication.
user_and_password: Option<UserAndPassword>Username and password for password-based authentication.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Auth
impl<'de> Deserialize<'de> for Auth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Auth
impl StructuralPartialEq for Auth
Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
impl UnwindSafe for Auth
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.