From 631cc9653739637dfc32ba5e02224b8257170ba1 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 9 Apr 2024 21:53:11 +0200 Subject: [PATCH] Give more appropriate name to define authorized route for API token --- virtweb_backend/src/api_tokens.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtweb_backend/src/api_tokens.rs b/virtweb_backend/src/api_tokens.rs index f216974..f71342d 100644 --- a/virtweb_backend/src/api_tokens.rs +++ b/virtweb_backend/src/api_tokens.rs @@ -21,7 +21,7 @@ impl TokenID { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] pub struct TokenRight { verb: TokenVerb, - uri: String, + path: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] @@ -108,7 +108,7 @@ pub struct NewToken { impl TokenRights { pub fn check_error(&self) -> Option<&'static str> { for r in &self.0 { - if !r.uri.starts_with("/api/") { + if !r.path.starts_with("/api/") { return Some("All API rights shall start with /api/"); } }