pub enum Credential {
Secret(Arc<SecretBox<String>>),
AccessToken(Arc<SecretBox<String>>),
}Expand description
What the client authenticates with.
Two credentials reach the same API by different headers, and a request carries exactly one. Modelling it as a choice rather than two optional fields means “both set” and “neither set” are states that cannot be built.
Both arms hold the value in SecretBox, so a credential is redacted in
Debug and zeroized on drop. It is exposed only in Self::apply, at the
moment the header is written.
Variants§
Secret(Arc<SecretBox<String>>)
A One secret key, sent as X-One-Secret. The long-lived agency
credential.
AccessToken(Arc<SecretBox<String>>)
An OAuth access token, sent as Authorization: Bearer. What an app
holding an end user’s grant uses; the reachable surface is whatever that
grant consented to, not the whole account.
Implementations§
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Auto Trait Implementations§
impl Forget for Credential
impl Freeze for Credential
impl Move for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credentialwhere
*const ArcInner<SecretBox<String>> is !null: UnsafeUnpin,
PhantomData<ArcInner<SecretBox<String>>>: UnsafeUnpin,
impl UnwindSafe for Credential
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