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 +++++++++++++++++++++++ src/errors/mod.rs | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 src/errors/auth.rs create mode 100644 src/errors/mod.rs (limited to 'src/errors') 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, +} diff --git a/src/errors/mod.rs b/src/errors/mod.rs new file mode 100644 index 0000000..ea85f4a --- /dev/null +++ b/src/errors/mod.rs @@ -0,0 +1,3 @@ +//! Error types. + +pub mod auth; -- cgit v1.2.3-18-g5258