Реализовать observability для лабораторной 6

This commit is contained in:
2026-11-20 17:55:23 +03:00
parent 58f3d4c457
commit 9e6428de05
50 changed files with 3573 additions and 98 deletions
+3 -2
View File
@@ -2,7 +2,7 @@ from __future__ import annotations
from dataclasses import dataclass
from fastapi import Depends, Header, HTTPException, Request, status
from fastapi import Depends, HTTPException, Request, Security, status
from ..db.redis import RedisSessionStore
from ..domain.errors import Unauthorized
@@ -11,6 +11,7 @@ from ..services.chats import ChatService
from ..services.attachments import AttachmentService
from ..services.messages import MessageService
from ..services.users import UserService
from .security import bearer_auth
_BEARER_CHALLENGE = 'Bearer realm="messenger"'
@@ -56,7 +57,7 @@ def _bearer_error() -> HTTPException:
)
async def bearer_token(authorization: str | None = Header(None)) -> str:
async def bearer_token(authorization: str | None = Security(bearer_auth)) -> str:
if not authorization:
raise _bearer_error()
scheme, separator, token = authorization.partition(' ')