pub struct ApiKeyAuth {
pub key: String,
pub aa_url: Url,
pub device_id: String,
/* private fields */
}Expand description
An Anapaya AA API key and where to exchange it, see
Config::with_api_key.
Fields§
§key: StringThe API key.
aa_url: UrlThe Anapaya AA service that exchanges the key for tokens.
device_id: StringIdentifies this device to the AA. The AA puts it in the token and refuses a device on its blocklist, so the same device has to present the same value every time.
Implementations§
Source§impl ApiKeyAuth
impl ApiKeyAuth
Sourcepub fn new(
key: impl Into<String>,
aa_url: Url,
device_id: impl Into<String>,
) -> Self
pub fn new( key: impl Into<String>, aa_url: Url, device_id: impl Into<String>, ) -> Self
Creates the credential.
Sourcepub fn with_trust_anchors(self, anchors: Vec<Certificate>) -> Self
pub fn with_trust_anchors(self, anchors: Vec<Certificate>) -> Self
Trusts anchors instead of the default roots when reaching the AA, for
a deployment that signs its own certificate.
Sourcepub fn allow_insecure_http(self) -> Self
pub fn allow_insecure_http(self) -> Self
Allows an http AA URL. The API key then crosses the network in
cleartext. Use it only for local testing.
Trait Implementations§
Source§impl Clone for ApiKeyAuth
impl Clone for ApiKeyAuth
Auto Trait Implementations§
impl Freeze for ApiKeyAuth
impl RefUnwindSafe for ApiKeyAuth
impl Send for ApiKeyAuth
impl Sync for ApiKeyAuth
impl Unpin for ApiKeyAuth
impl UnsafeUnpin for ApiKeyAuth
impl UnwindSafe for ApiKeyAuth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more