pub enum Auth {
Token(String),
Bearer(String),
Basic {
username: String,
password: Option<String>,
},
}Expand description
Authentication strategy for the Zammad API.
Zammad accepts personal access tokens (Token token=...), OAuth bearer
tokens (Bearer ...) and HTTP Basic auth on every endpoint.
Variants§
Token(String)
Personal access token issued from a user’s profile.
Bearer(String)
OAuth2 bearer token.
Basic
HTTP Basic auth.
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn basic(username: impl Into<String>, password: impl Into<String>) -> Self
pub fn basic(username: impl Into<String>, password: impl Into<String>) -> Self
Build an HTTP Basic credential with a password.
Sourcepub fn basic_no_password(username: impl Into<String>) -> Self
pub fn basic_no_password(username: impl Into<String>) -> Self
Build an HTTP Basic credential without a password (some Zammad proxies accept a bare token as the username).
Trait Implementations§
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