#[non_exhaustive]pub struct ApiKeyConfig {
pub prefix: String,
pub secret_length: usize,
pub touch_threshold_secs: u64,
}Expand description
Configuration for the API key module.
Deserialised from the apikey key in the application YAML config.
All fields have defaults, so an empty apikey: block is valid.
§YAML example
apikey:
prefix: "modo"
secret_length: 32
touch_threshold_secs: 60Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.prefix: StringKey prefix prepended before the underscore separator.
Must be [a-zA-Z0-9], 1-20 characters.
Defaults to "modo".
secret_length: usizeLength of the random secret portion in base62 characters.
Minimum 16. Defaults to 32.
touch_threshold_secs: u64Minimum interval between last_used_at updates, in seconds.
Defaults to 60 (1 minute).
Implementations§
Trait Implementations§
Source§impl Clone for ApiKeyConfig
impl Clone for ApiKeyConfig
Source§fn clone(&self) -> ApiKeyConfig
fn clone(&self) -> ApiKeyConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiKeyConfig
impl Debug for ApiKeyConfig
Source§impl Default for ApiKeyConfig
impl Default for ApiKeyConfig
Source§impl<'de> Deserialize<'de> for ApiKeyConfigwhere
ApiKeyConfig: Default,
impl<'de> Deserialize<'de> for ApiKeyConfigwhere
ApiKeyConfig: Default,
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
Auto Trait Implementations§
impl Freeze for ApiKeyConfig
impl RefUnwindSafe for ApiKeyConfig
impl Send for ApiKeyConfig
impl Sync for ApiKeyConfig
impl Unpin for ApiKeyConfig
impl UnsafeUnpin for ApiKeyConfig
impl UnwindSafe for ApiKeyConfig
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