api: refactor ccujack state keeping
This commit is contained in:
parent
07c72c752f
commit
b623082c4a
5 changed files with 22 additions and 36 deletions
|
|
@ -4,7 +4,6 @@ from datetime import datetime, UTC, timedelta
|
|||
from fastapi import Request, Depends, Response
|
||||
from simple_openid_connect.data import TokenSuccessResponse
|
||||
from simple_openid_connect.client import OpenidClient
|
||||
from cachetools import Cache
|
||||
|
||||
from dooris_api import models, exceptions
|
||||
from dooris_api.ccujack import CCUJackClient
|
||||
|
|
@ -124,13 +123,6 @@ def clear_auth_state(resp: Response):
|
|||
CurrentUser = Annotated[Optional[models.CurrentUser], Depends(get_current_user)]
|
||||
|
||||
|
||||
def get_cache(req: Request) -> Cache:
|
||||
return req.app.extra["cache"]
|
||||
|
||||
|
||||
Cache = Annotated[Cache, Depends(get_cache)]
|
||||
|
||||
|
||||
def get_ccujack(req: Request) -> CCUJackClient:
|
||||
return req.app.extra["ccujack"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue