From 9d191019757eae3bba45e8e1a021fefdc69a9fae Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 25 Nov 2022 12:35:35 -0500 Subject: Add fake authenticator --- server/src/fake_auth.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 server/src/fake_auth.rs (limited to 'server/src/fake_auth.rs') diff --git a/server/src/fake_auth.rs b/server/src/fake_auth.rs new file mode 100644 index 0000000..5ef9cc8 --- /dev/null +++ b/server/src/fake_auth.rs @@ -0,0 +1,33 @@ +use std::collections::HashMap; + +use async_trait::async_trait; + +use crate::{ + auth::{AuthenticatedSession, Authenticator, SessionId}, + error::{self, BridgeError}, +}; + +pub struct FakeAuthenticator {} + +#[async_trait] +impl Authenticator for FakeAuthenticator { + async fn user_info( + &self, + session: &mut AuthenticatedSession, + ) -> Result { + Err(BridgeError::NotLoggedIn) + } + + async fn authenticate( + &self, + pool: &sqlx::PgPool, + session_id: SessionId, + auth_params: HashMap, + ) -> Result { + Err(BridgeError::Internal("not implemented".to_string())) + } + + async fn get_login_url(&self) -> (SessionId, reqwest::Url) { + todo!() + } +} -- cgit v1.2.3