api: add better response documentation
This commit is contained in:
parent
bc7e74f28d
commit
745dfaf19f
4 changed files with 97 additions and 16 deletions
|
|
@ -4,8 +4,9 @@ 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
|
||||
from dooris_api import models, exceptions
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -40,7 +41,7 @@ async def get_current_user(req: Request, resp: Response, oidc_client: OpenidClie
|
|||
|
||||
# otherwise we can't meaningfully recover any user information or the user is simply not authenticated
|
||||
logger.debug("no currently authenticated user")
|
||||
return None
|
||||
raise exceptions.HttpProblemException(models.HttpProblemDetail.new_unauthorized(req.url))
|
||||
|
||||
|
||||
def persist_auth_state(oidc_client: OpenidClient, resp: Response, tokens: TokenSuccessResponse, auth_start_time: datetime, token_nonce: Optional[str] = None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue