From 30c05c9f987fc69b53b83efa0fdf025d3c20ba92 Mon Sep 17 00:00:00 2001 From: ahall Date: Mon, 6 Jul 2026 09:56:55 +0100 Subject: [PATCH] docs: document secure UnsafeEntityLogging default in todoapp-blazor-wasm sample (#479) - Explicitly set UnsafeEntityLogging = false in TodoItemsController with a comment explaining the sample keeps entity logging disabled to avoid writing TodoItem contents to logs. - Bump CommunityToolkit.Datasync.Server(.EntityFrameworkCore) to 10.1.0 so the sample builds against the release that introduced UnsafeEntityLogging (#446). - Bump Microsoft.EntityFrameworkCore(.InMemory) to 10.0.9 to resolve a package downgrade error against the updated Datasync EF Core package. --- .../Controllers/TodoItemsController.cs | 5 +++++ .../TodoApp.BlazorWasm.Server.csproj | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/Controllers/TodoItemsController.cs b/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/Controllers/TodoItemsController.cs index 3e96cf73..000582b7 100644 --- a/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/Controllers/TodoItemsController.cs +++ b/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/Controllers/TodoItemsController.cs @@ -70,5 +70,10 @@ public class TodoItemsController : TableController public TodoItemsController(TodoContext context) : base() { Repository = new EntityTableRepository(context); + + // 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 }; } } diff --git a/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/TodoApp.BlazorWasm.Server.csproj b/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/TodoApp.BlazorWasm.Server.csproj index ba91cfa2..a6be7990 100644 --- a/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/TodoApp.BlazorWasm.Server.csproj +++ b/samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/TodoApp.BlazorWasm.Server.csproj @@ -7,10 +7,10 @@ - - - - + + + +