From f1c5be7e212054e04f18b63d0632220adbfac6d7 Mon Sep 17 00:00:00 2001 From: ahall Date: Mon, 6 Jul 2026 09:33:30 +0100 Subject: [PATCH] docs: document secure UnsafeEntityLogging default in datasync-server-cosmosdb-singlecontainer sample (#478) - Explicitly set UnsafeEntityLogging = false in TodoItemController and TodoListController with a comment explaining the sample keeps entity logging disabled to avoid writing TodoItem/TodoList contents to logs. - Pin Microsoft.OData.Core/Edm to 8.4.3 in the sample csproj to resolve a pre-existing assembly version conflict that blocked the sample from building, matching the same fix applied to the datasync-server sample. --- .../src/Controllers/TodoItemController.cs | 4 ++++ .../src/Controllers/TodoListController.cs | 5 ++++- .../src/Sample.Datasync.Server.SingleContainer.csproj | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoItemController.cs b/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoItemController.cs index 86c7aa47..12ae4ed5 100644 --- a/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoItemController.cs +++ b/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoItemController.cs @@ -14,5 +14,9 @@ public class TodoItemController : TableController public TodoItemController(IRepository repository) : base(repository) { + // UnsafeEntityLogging is intentionally left at its secure default (false). + // This sample stores user-supplied TodoItem content (Title), so only the + // entity ID is logged; the full serialized entity is never written to the logs. + Options = new TableControllerOptions { UnsafeEntityLogging = false }; } } \ No newline at end of file diff --git a/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoListController.cs b/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoListController.cs index 1795e77a..7bbf19e3 100644 --- a/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoListController.cs +++ b/samples/datasync-server-cosmosdb-singlecontainer/src/Controllers/TodoListController.cs @@ -13,6 +13,9 @@ public class TodoListController : TableController { public TodoListController(IRepository repository) : base(repository) { - Options = new TableControllerOptions { EnableSoftDelete = true }; + // UnsafeEntityLogging is intentionally left at its secure default (false). + // This sample stores user-supplied TodoList content (Title), so only the + // entity ID is logged; the full serialized entity is never written to the logs. + Options = new TableControllerOptions { EnableSoftDelete = true, UnsafeEntityLogging = false }; } } \ No newline at end of file diff --git a/samples/datasync-server-cosmosdb-singlecontainer/src/Sample.Datasync.Server.SingleContainer.csproj b/samples/datasync-server-cosmosdb-singlecontainer/src/Sample.Datasync.Server.SingleContainer.csproj index 000edcef..9d103873 100644 --- a/samples/datasync-server-cosmosdb-singlecontainer/src/Sample.Datasync.Server.SingleContainer.csproj +++ b/samples/datasync-server-cosmosdb-singlecontainer/src/Sample.Datasync.Server.SingleContainer.csproj @@ -10,6 +10,15 @@ + + + +