Add context reqruied later for authentication

This commit is contained in:
Simon Goller 2024-05-03 19:01:26 +02:00
parent 9a367c9260
commit 20828fb4a1
14 changed files with 463 additions and 330 deletions

View file

@ -0,0 +1,14 @@
use std::sync::Arc;
use async_trait::async_trait;
use mockall::automock;
use crate::ServiceError;
#[automock(type Context=();)]
#[async_trait]
pub trait UserService {
type Context: Clone + Send + Sync + 'static;
async fn current_user(&self, context: Self::Context) -> Result<Arc<str>, ServiceError>;
}