docs: document secure UnsafeEntityLogging default in datasync-server sample (#477) - #488
Merged
Merged
Conversation
…sample (CommunityToolkit#477) - 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. - Bump Microsoft.AspNetCore.OpenApi, Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Tools to 10.0.9 to resolve a package downgrade error against the repo's centrally-managed dotnet 10 version. - Pin Microsoft.OData.Core/Edm to 8.4.3 to resolve a resulting assembly version conflict, matching CommunityToolkit.Datasync.Server.Abstractions' existing Microsoft.Spatial pin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #477.
Reviews
samples/datasync-server/src/Sample.Datasync.Serveragainst theUnsafeEntityLoggingoption added in v10.1.0 (#446) and explicitly documents the secure default.Changes
Controllers/TodoItemController.cs: previously had noOptionsconfigured (implicit default). Now explicitly setsOptions = new TableControllerOptions { UnsafeEntityLogging = false }with a comment explaining thatTodoItem.Titleis user-supplied content, so the sample intentionally keeps entity logging disabled.Controllers/TodoListController.cs: already setOptions = new TableControllerOptions { EnableSoftDelete = true }. Extended it with the same explicitUnsafeEntityLogging = falseand comment, sinceTodoList.Titleis also user-supplied content.Sample.Datasync.Server.csproj: bumpedMicrosoft.AspNetCore.OpenApi,Microsoft.EntityFrameworkCore.SqlServer, andMicrosoft.EntityFrameworkCore.Toolsfrom10.0.3to10.0.9to resolve aNU1605package-downgrade error that was breaking the sample build against the repo's currently centrally-managed dotnet 10 version (DotNetVersioninDirectory.Packages.props). Resolving that surfaced a furtherCS1705assembly version conflict onMicrosoft.OData.Edm/Microsoft.OData.Core(a transitive dependency viaMicrosoft.AspNetCore.OData), so those are now pinned to8.4.3as well, matching theMicrosoft.Spatialpin already used byCommunityToolkit.Datasync.Server.Abstractionsand theODataVersionused in the rootDirectory.Packages.props. These build-fix changes were pre-existing and unrelated toUnsafeEntityLogging, but were needed to satisfy the issue's "sample builds and runs against v10.1.0" acceptance criterion.This mirrors the pattern already used for the
todoapp-mvcsample (#480/#485) and thetodoapp-tutorialsample (#476/#487).Acceptance criteria
UnsafeEntityLoggingremainsfalse(default) in this sample.TableControllerOptionsis configured (both controllers).Testing
dotnet build samples/datasync-server/src/Sample.Datasync.Server/Sample.Datasync.Server.csproj— succeeds with 0 errors (previously failed withNU1605/CS1705before the version pins were added).dotnet restore Datasync.Toolkit.sln/dotnet build Datasync.Toolkit.sln— succeed with 0 errors.dotnet test tests/CommunityToolkit.Datasync.Server.Test/CommunityToolkit.Datasync.Server.Test.csproj— 2280 passed, 0 failed, 465 skipped (live/container-dependent tests, unaffected by this change).