From ecca0e8cef755899049e7f541c86b9d06b2438a4 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Mon, 30 May 2022 00:24:40 -0400 Subject: meta: Add Bearer authentication Makes use of a pre-shared key. Do not expose this to the internet! --- src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index c1d6672..d4b365f 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -15,6 +15,9 @@ pub enum ServiceError { #[error("Not Found")] NotFound, + + #[error("Not Authorized")] + NotAuthorized, } pub type StringResult = Result; @@ -27,6 +30,7 @@ impl IntoResponse for ServiceError { let status = match self { ServiceError::NotFound => StatusCode::NOT_FOUND, + ServiceError::NotAuthorized => StatusCode::UNAUTHORIZED, _ => StatusCode::INTERNAL_SERVER_ERROR, }; -- cgit v1.2.3