summaryrefslogtreecommitdiff
path: root/server/src/fake_auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/fake_auth.rs')
-rw-r--r--server/src/fake_auth.rs33
1 files changed, 33 insertions, 0 deletions
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<String, error::BridgeError> {
+ Err(BridgeError::NotLoggedIn)
+ }
+
+ async fn authenticate(
+ &self,
+ pool: &sqlx::PgPool,
+ session_id: SessionId,
+ auth_params: HashMap<String, String>,
+ ) -> Result<AuthenticatedSession, error::BridgeError> {
+ Err(BridgeError::Internal("not implemented".to_string()))
+ }
+
+ async fn get_login_url(&self) -> (SessionId, reqwest::Url) {
+ todo!()
+ }
+}