service_man/api/application/protocols/jwt.py

15 lines
372 B
Python

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
def refresh_token(self, token: str) -> str:
raise NotImplementedError