fistinc-auth 0.1.0

Paging types for Fist Inc bank
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use async_trait::async_trait;
use fistinc_errors::ServiceResult;

use crate::domain::entity::Token;
use crate::domain::entity::User;

#[async_trait]
pub trait UserSecurityService: Send + Sync {
    async fn hash(&self, input: &str) -> ServiceResult<String>;
    async fn verify_hash(&self, hashed: &str, raw: &str) -> ServiceResult<bool>;
    async fn token_generator(&self, user: &User) -> ServiceResult<String>;
    async fn decode_token(&self, token: &str) -> ServiceResult<Token>;
}