From d7929e7e9fee879a28871c2195620869db291441 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 5 Sep 2022 17:57:28 +0200 Subject: feat: add authentication --- src/errors/auth.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/errors/auth.rs (limited to 'src/errors/auth.rs') diff --git a/src/errors/auth.rs b/src/errors/auth.rs new file mode 100644 index 0000000..cd4741d --- /dev/null +++ b/src/errors/auth.rs @@ -0,0 +1,23 @@ +//! Authentication related error types. + +/// Authentication prompt handler error. +#[derive(Debug, thiserror::Error)] +pub enum AuthPromptHandlerError +{ + /// HTTP server failed to bind to a address. + #[error("HTTP server failed to bind to address")] + BindAddressFailed, +} + +/// Access token request error. +#[derive(Debug, thiserror::Error)] +pub enum AccessTokenRequestError +{ + /// Sending access token request failed. + #[error("Sending access token request failed")] + SendFailed(#[from] reqwest::Error), + + /// Parsing access token respone failed. + #[error("Parsing access token respone failed")] + ResponseParseFailed, +} -- cgit v1.2.3-18-g5258