aboutsummaryrefslogtreecommitdiffstats
path: root/lib/auth-service/src/service
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-02-09 13:25:17 +0200
committerrtkay123 <dev@kanjala.com>2026-02-09 13:25:17 +0200
commitbac76a98bf4e90610d0a7105d2ebe6872dc147d4 (patch)
tree341a1a31bd20741f781d48e01f7ded253bf34caf /lib/auth-service/src/service
parent253c5631ae09fd5ad9fd6b3eff104e6099d4676c (diff)
downloadsellershut-bac76a98bf4e90610d0a7105d2ebe6872dc147d4.tar.bz2
sellershut-bac76a98bf4e90610d0a7105d2ebe6872dc147d4.zip
feat: svc crate
Diffstat (limited to 'lib/auth-service/src/service')
-rw-r--r--lib/auth-service/src/service/mod.rs51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/auth-service/src/service/mod.rs b/lib/auth-service/src/service/mod.rs
new file mode 100644
index 0000000..3d45523
--- /dev/null
+++ b/lib/auth-service/src/service/mod.rs
@@ -0,0 +1,51 @@
+use async_session::{Result, Session, SessionStore};
+use async_trait::async_trait;
+use shared_svc::cache::RedisManager;
+use tracing::instrument;
+
+#[derive(Debug, Clone)]
+pub struct AuthService {
+ cache: RedisManager,
+}
+
+impl AuthService {
+ pub fn new(cache: &RedisManager) -> Self {
+ Self {
+ cache: cache.clone(),
+ }
+ }
+}
+
+#[async_trait]
+impl SessionStore for AuthService {
+ #[doc = " Get a session from the storage backend."]
+ #[doc = ""]
+ #[doc = " The input is expected to be the value of an identifying"]
+ #[doc = " cookie. This will then be parsed by the session middleware"]
+ #[doc = " into a session if possible"]
+ #[instrument(skip(self))]
+ async fn load_session(&self, cookie_value: String) -> Result<Option<Session>> {
+ todo!()
+ }
+
+ #[doc = " Store a session on the storage backend."]
+ #[doc = ""]
+ #[doc = " The return value is the value of the cookie to store for the"]
+ #[doc = " user that represents this session"]
+ #[instrument(skip(self))]
+ async fn store_session(&self, session: Session) -> Result<Option<String>> {
+ todo!()
+ }
+
+ #[doc = " Remove a session from the session store"]
+ #[instrument(skip(self))]
+ async fn destroy_session(&self, session: Session) -> Result {
+ todo!()
+ }
+
+ #[doc = " Empties the entire store, destroying all sessions"]
+ #[instrument(skip(self))]
+ async fn clear_store(&self) -> Result {
+ todo!()
+ }
+}