Обновление документации.

This commit is contained in:
2025-04-15 22:09:10 +04:00
parent 2fd6d787a0
commit 5068fe3069
26 changed files with 370 additions and 235 deletions

View File

@@ -16,19 +16,19 @@ use std::fmt::Debug;
#[status_code = "actix_web::http::StatusCode::UNAUTHORIZED"]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Error {
/// В запросе отсутствует заголовок Authorization
/// There is no Authorization header in the request.
#[display("No Authorization header found")]
NoHeader,
/// Неизвестный тип авторизации, отличающийся от Bearer
/// Unknown authorization type other than Bearer.
#[display("Bearer token is required")]
UnknownAuthorizationType,
/// Токен не действителен
/// Invalid or expired access token.
#[display("Invalid or expired access token")]
InvalidAccessToken,
/// Пользователь привязанный к токену не найден в базе данных
/// The user bound to the token is not found in the database.
#[display("No user associated with access token")]
NoUser,
}
@@ -39,7 +39,7 @@ impl Error {
}
}
/// Экстрактор пользователя из запроса с токеном
/// User extractor from request with Bearer access token.
impl FromRequestSync for User {
type Error = actix_web::Error;
@@ -87,7 +87,7 @@ impl<const FCM: bool> UserExtractor<{ FCM }> {
}
}
/// Экстрактор пользователя и дополнительных параметров из запроса с токеном
/// Extractor of user and additional parameters from request with Bearer token.
impl<const FCM: bool> FromRequestSync for UserExtractor<{ FCM }> {
type Error = actix_web::Error;