Drop Python 3.9 support

This commit is contained in:
François Voron
2025-10-25 08:19:03 +02:00
parent ae5ff025ef
commit fcf9a2041a
33 changed files with 224 additions and 234 deletions

View File

@@ -1,10 +1,10 @@
from datetime import datetime, timedelta, timezone
from typing import Any, Optional, Union
from typing import Any
import jwt
from pydantic import SecretStr
SecretType = Union[str, SecretStr]
SecretType = str | SecretStr
JWT_ALGORITHM = "HS256"
@@ -17,7 +17,7 @@ def _get_secret_value(secret: SecretType) -> str:
def generate_jwt(
data: dict,
secret: SecretType,
lifetime_seconds: Optional[int] = None,
lifetime_seconds: int | None = None,
algorithm: str = JWT_ALGORITHM,
) -> str:
payload = data.copy()