api with oauth2 provider

This commit is contained in:
2025-09-25 23:17:28 -03:00
parent a3e13a113c
commit 187a064687
11 changed files with 1580 additions and 0 deletions

View File

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