docs: documented most of the code
This commit is contained in:
parent
e367930505
commit
e4287bb2ac
18 changed files with 223 additions and 191 deletions
|
@ -1,3 +1,5 @@
|
|||
//! Сборник утилит для работы с Redis.
|
||||
|
||||
use crate::web_server::app_error::AppError;
|
||||
use fred::prelude::*;
|
||||
use heapless::String as HeaplessString;
|
||||
|
@ -6,13 +8,17 @@ use regex::Regex;
|
|||
use ufmt::uwrite;
|
||||
|
||||
lazy_static! {
|
||||
/// Разрешённые знаки для API ключа.
|
||||
static ref ALLOWED_API_KEY_CHARACTERS: Regex = Regex::new("[a-zA-Z0-9]{13}").unwrap();
|
||||
}
|
||||
|
||||
/// Описание полей в KV DB у `apikey_{}`.
|
||||
pub struct ApiKeyDescription {
|
||||
/// ID владельца API ключа.
|
||||
apikey_owner: i64,
|
||||
}
|
||||
|
||||
/// Проверка API ключа на валидность.
|
||||
pub async fn is_api_key_valid(
|
||||
client: &RedisClient,
|
||||
api_key: &str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue