This commit is contained in:
2025-10-03 19:31:41 -03:00
parent 48ed8d8345
commit 5ae2128dee
29 changed files with 996 additions and 168 deletions

View File

@@ -1,19 +1,19 @@
import os
from typing import TYPE_CHECKING
import boto3
if TYPE_CHECKING:
from mypy_boto3_dynamodb.client import DynamoDBClient
else:
DynamoDBClient = object
def get_dynamodb_client():
running_sam_local = os.getenv('AWS_SAM_LOCAL')
if os.getenv('AWS_LAMBDA_FUNCTION_NAME') and not running_sam_local:
def get_dynamodb_client() -> DynamoDBClient:
if os.getenv('AWS_LAMBDA_FUNCTION_NAME'):
return boto3.client('dynamodb')
dockerhost = 'host.docker.internal'
localhost = '127.0.0.1'
host = dockerhost if running_sam_local else localhost
return boto3.client('dynamodb', endpoint_url=f'http://{host}:8000')
return boto3.client('dynamodb', endpoint_url='http://127.0.0.1:8000')
dynamodb_client = get_dynamodb_client()
dynamodb_client: DynamoDBClient = get_dynamodb_client()

View File

@@ -157,7 +157,6 @@ class AuthorizationServer(oauth2.AuthorizationServer):
body,
headers,
):
logger.debug('handle_response', status=status, body=body)
return Response(
status_code=status,
body=body,