feat(security): add resource token authentication using HttpOnly Cookie

This commit is contained in:
InfinityPacer
2024-10-10 00:45:26 +08:00
parent e31df15b5e
commit 871f8d3529
6 changed files with 145 additions and 42 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ from app import schemas
from app.chain.douban import DoubanChain
from app.core.config import settings
from app.core.context import MediaInfo
from app.core.security import verify_token
from app.core.security import verify_token, verify_resource_token
from app.schemas import MediaType
from app.utils.http import RequestUtils
@@ -15,7 +15,7 @@ router = APIRouter()
@router.get("/img", summary="豆瓣图片代理")
def douban_img(imgurl: str) -> Any:
def douban_img(imgurl: str, _: schemas.TokenPayload = Depends(verify_resource_token)) -> Any:
"""
豆瓣图片代理
"""