Add API tokens support #9

Merged
pierre merged 40 commits from api into master 2024-04-23 17:04:45 +00:00
3 changed files with 3 additions and 3 deletions
Showing only changes of commit f28f9dbc5a - Show all commits

View File

@ -34,7 +34,7 @@ impl TokenRights {
return Some("All API rights shall start with /api/"); return Some("All API rights shall start with /api/");
} }
if r.path.len() > constants::API_TOKEN_PATH_MAX_LENGTH { if r.path.len() > constants::API_TOKEN_RIGHT_PATH_MAX_LENGTH {
return Some("An API path shall not exceed maximum URL size!"); return Some("An API path shall not exceed maximum URL size!");
} }
} }

View File

@ -106,4 +106,4 @@ pub const API_TOKEN_DESCRIPTION_MIN_LENGTH: usize = 5;
pub const API_TOKEN_DESCRIPTION_MAX_LENGTH: usize = 30; pub const API_TOKEN_DESCRIPTION_MAX_LENGTH: usize = 30;
/// API token right path max length /// API token right path max length
pub const API_TOKEN_PATH_MAX_LENGTH: usize = 255; pub const API_TOKEN_RIGHT_PATH_MAX_LENGTH: usize = 255;

View File

@ -114,7 +114,7 @@ pub async fn static_config(local_auth: LocalAuthEnabled) -> impl Responder {
api_token_right_path_size: LenConstraints { api_token_right_path_size: LenConstraints {
min: 0, min: 0,
max: constants::API_TOKEN_PATH_MAX_LENGTH, max: constants::API_TOKEN_RIGHT_PATH_MAX_LENGTH,
}, },
}, },
}) })