Drop Python 3.8 support

This commit is contained in:
François Voron
2024-11-03 12:51:32 +00:00
committed by GitHub
parent 7f92a82e07
commit caa17889e1
41 changed files with 231 additions and 251 deletions

View File

@ -1,5 +1,5 @@
from datetime import datetime
from typing import Any, Dict, Generic, Optional, Protocol
from typing import Any, Generic, Optional, Protocol
from fastapi_users.authentication.strategy.db.models import AP
@ -13,11 +13,11 @@ class AccessTokenDatabase(Protocol, Generic[AP]):
"""Get a single access token by token."""
... # pragma: no cover
async def create(self, create_dict: Dict[str, Any]) -> AP:
async def create(self, create_dict: dict[str, Any]) -> AP:
"""Create an access token."""
... # pragma: no cover
async def update(self, access_token: AP, update_dict: Dict[str, Any]) -> AP:
async def update(self, access_token: AP, update_dict: dict[str, Any]) -> AP:
"""Update an access token."""
... # pragma: no cover

View File

@ -1,6 +1,6 @@
import secrets
from datetime import datetime, timedelta, timezone
from typing import Any, Dict, Generic, Optional
from typing import Any, Generic, Optional
from fastapi_users import exceptions, models
from fastapi_users.authentication.strategy.base import Strategy
@ -50,6 +50,6 @@ class DatabaseStrategy(
if access_token is not None:
await self.database.delete(access_token)
def _create_access_token_dict(self, user: models.UP) -> Dict[str, Any]:
def _create_access_token_dict(self, user: models.UP) -> dict[str, Any]:
token = secrets.token_urlsafe()
return {"token": token, "user_id": user.id}