auth next part
This commit is contained in:
7
api/application/protocols/date_time.py
Normal file
7
api/application/protocols/date_time.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
class DateTimeProvider(Protocol):
|
||||
def get_current_time(self) -> datetime:
|
||||
raise NotImplementedError
|
11
api/application/protocols/jwt.py
Normal file
11
api/application/protocols/jwt.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Protocol
|
||||
|
||||
from api.domain.user.model import UserId
|
||||
|
||||
|
||||
class JwtTokenProcessor(Protocol):
|
||||
def generate_token(self, user_id: UserId) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
def validate_token(self, token: str) -> UserId | None:
|
||||
raise NotImplementedError
|
Reference in New Issue
Block a user