update session

This commit is contained in:
2025-10-10 12:52:41 -03:00
parent 2de2d4dc0e
commit c9438d49fb
15 changed files with 116 additions and 112 deletions

View File

@@ -1,4 +1,3 @@
import os
from dataclasses import asdict
import authlib.oauth2 as oauth2
@@ -17,24 +16,19 @@ from config import OAUTH2_REFRESH_TOKEN_EXPIRES_IN
from .client import OAuth2Client
from .requests import APIGatewayJsonRequest, APIGatewayOAuth2Request
OAUTH2_SCOPES_SUPPORTED = os.getenv('OAUTH2_SCOPES_SUPPORTED')
logger = Logger(__name__)
class AuthorizationServer(oauth2.AuthorizationServer):
def __init__(
self,
scopes_supported: list[str],
*,
persistence_layer: DynamoDBPersistenceLayer,
) -> None:
super().__init__(scopes_supported=scopes_supported)
self._persistence_layer = persistence_layer
if OAUTH2_SCOPES_SUPPORTED:
super().__init__(
scopes_supported=set(OAUTH2_SCOPES_SUPPORTED.split()),
)
def save_token(
self,
token: dict,