#[non_exhaustive]pub enum Auth {
Jwt(SecretString),
ApiKey {
key: String,
secret: SecretString,
},
}Expand description
Authentication method for the ANS API.
Secrets are stored using SecretString which provides:
- Zeroization on drop (secret bytes overwritten in memory)
- Debug output prints
[REDACTED]instead of the secret value - Explicit
.expose_secret()required to access the value
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Jwt(SecretString)
JWT authentication for internal endpoints.
ApiKey
API key authentication for public gateway.
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