From 781123aaa5669efa66de3a2d693b4227e0ee1006 Mon Sep 17 00:00:00 2001 From: Lucas Messenger <1335960+layertwo@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:53:59 -0800 Subject: [PATCH 1/3] fix: use json_dumps to handle Decimal types in attached_clients response DynamoDB returns numeric fields (createdAt, lastAccessTime) as Decimal objects, which the standard json.dumps cannot serialize. Swap to the existing json_dumps utility which uses DecimalEncoder to convert Decimals to floats. --- lambda/src/routes/auth/account_attached_clients.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambda/src/routes/auth/account_attached_clients.py b/lambda/src/routes/auth/account_attached_clients.py index 8aab5e7..c1511f0 100644 --- a/lambda/src/routes/auth/account_attached_clients.py +++ b/lambda/src/routes/auth/account_attached_clients.py @@ -1,6 +1,5 @@ """AccountAttachedClients route — GET /v1/account/attached_clients""" -import json from typing import Sequence from aws_lambda_powertools.event_handler import APIGatewayRestResolver, Response @@ -8,6 +7,7 @@ from src.services.device_manager import DeviceManager from src.shared.base_route import BaseRoute +from src.shared.utils import json_dumps class AccountAttachedClientsRoute(BaseRoute): @@ -54,5 +54,5 @@ def handle(self, event) -> Response: return Response( status_code=200, content_type="application/json", - body=json.dumps(clients), + body=json_dumps(clients), ) From 56c32847b5a5acd822f08529780dc4c88b0be078 Mon Sep 17 00:00:00 2001 From: Lucas Messenger <1335960+layertwo@users.noreply.github.com> Date: Tue, 3 Mar 2026 19:01:28 -0800 Subject: [PATCH 2/3] fix: use json_dumps in account_device and account_devices routes Same Decimal serialization issue as account_attached_clients: both routes serialize DynamoDB data that may contain Decimal values for createdAt and lastAccessTime fields. --- lambda/src/routes/auth/account_device.py | 3 ++- lambda/src/routes/auth/account_devices.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lambda/src/routes/auth/account_device.py b/lambda/src/routes/auth/account_device.py index a2fd0dd..489a3a3 100644 --- a/lambda/src/routes/auth/account_device.py +++ b/lambda/src/routes/auth/account_device.py @@ -8,6 +8,7 @@ from src.services.device_manager import DeviceManager from src.shared.base_route import BaseRoute +from src.shared.utils import json_dumps class AccountDeviceRoute(BaseRoute): @@ -35,5 +36,5 @@ def handle(self, event) -> Response: return Response( status_code=200, content_type="application/json", - body=json.dumps(device), + body=json_dumps(device), ) diff --git a/lambda/src/routes/auth/account_devices.py b/lambda/src/routes/auth/account_devices.py index 3cc797f..bcf1c5f 100644 --- a/lambda/src/routes/auth/account_devices.py +++ b/lambda/src/routes/auth/account_devices.py @@ -8,6 +8,7 @@ from src.services.device_manager import DeviceManager from src.shared.base_route import BaseRoute +from src.shared.utils import json_dumps class AccountDevicesRoute(BaseRoute): @@ -41,5 +42,5 @@ def handle(self, event) -> Response: return Response( status_code=200, content_type="application/json", - body=json.dumps(devices), + body=json_dumps(devices), ) From 557f269e14f7302ce2f85442af47289489685c1e Mon Sep 17 00:00:00 2001 From: Lucas Messenger <1335960+layertwo@users.noreply.github.com> Date: Tue, 3 Mar 2026 19:03:35 -0800 Subject: [PATCH 3/3] fix: remove unused json import from account_devices --- lambda/src/routes/auth/account_devices.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lambda/src/routes/auth/account_devices.py b/lambda/src/routes/auth/account_devices.py index bcf1c5f..ac0b009 100644 --- a/lambda/src/routes/auth/account_devices.py +++ b/lambda/src/routes/auth/account_devices.py @@ -1,6 +1,5 @@ """AccountDevices route — GET /v1/account/devices""" -import json from typing import Sequence from aws_lambda_powertools.event_handler import APIGatewayRestResolver, Response