Return the username in a separate service

This allows us to use a service implementation which
returns a dummy user during development and the actual authenticated
user during production.  It also simplifies tests.
This commit is contained in:
Simon Goller 2024-04-26 22:41:44 +02:00
parent 789981ee92
commit 926ac006e7
3 changed files with 29 additions and 7 deletions

View file

@ -19,6 +19,8 @@ pub trait PermissionService {
&self,
privilege: &str,
) -> impl Future<Output = Result<(), ServiceError>> + Send;
}
pub trait UserService {
fn current_user(&self) -> impl Future<Output = Result<Arc<str>, ServiceError>> + Send;
}