service_man/api/application/protocols/jwt.py

15 lines
372 B
Python
Raw Normal View History

2024-04-02 22:33:15 +03:00
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
2024-04-08 00:31:15 +03:00
def refresh_token(self, token: str) -> str:
raise NotImplementedError