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:
parent
789981ee92
commit
926ac006e7
3 changed files with 29 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue