Class AuditAndLoggingPrivacyDefaultsTests
- Namespace
- ProjectTemplate.Web.Tests
- Assembly
- ProjectTemplate.Web.Tests.dll
Pins the privacy-affecting defaults a generated application starts with.
public sealed class AuditAndLoggingPrivacyDefaultsTests
- Inheritance
-
AuditAndLoggingPrivacyDefaultsTests
- Inherited Members
Remarks
These defaults decide what personal data a generated application writes without its consumer having chosen to. Audit rows and request logs are both durable and typically retained longer than the data they describe, so a permissive default here is difficult to undo after the fact.
Properties
MaskedExternalLoginAccountProperties
The contact fields on ExternalLoginAccount that the default policy masks.
public static TheoryData<string> MaskedExternalLoginAccountProperties { get; }
Property Value
- TheoryData<string>
Methods
DefaultPolicyDoesNotMaskSimilarlyNamedPropertiesOnOtherEntities()
Verifies that the masking is scoped to the entity it was written for rather than applied by property name.
[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/AuditAndLoggingPrivacyDefaultsTests.cs", 68)]
public void DefaultPolicyDoesNotMaskSimilarlyNamedPropertiesOnOtherEntities()
DefaultPolicyIncludesNonPersonalExternalLoginAccountProperties(string)
Verifies that the default policy still includes non-personal properties, so audit records stay useful.
[Theory("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/AuditAndLoggingPrivacyDefaultsTests.cs", 49)]
[InlineData(new object?[] { "ProviderName" })]
[InlineData(new object?[] { "NormalizedProviderName" })]
[InlineData(new object?[] { "LocalUserId" })]
public void DefaultPolicyIncludesNonPersonalExternalLoginAccountProperties(string propertyName)
Parameters
propertyNamestringThe property expected to be included unchanged.
DefaultPolicyMasksExternalLoginAccountContactFields(string)
Verifies that the default policy masks the contact fields carried by an external login account.
[Theory("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/AuditAndLoggingPrivacyDefaultsTests.cs", 31)]
[MemberData("MaskedExternalLoginAccountProperties", new object?[] { })]
public void DefaultPolicyMasksExternalLoginAccountContactFields(string propertyName)
Parameters
propertyNamestringThe property expected to be masked.
RequestLoggingDoesNotRecordPersonalFieldsByDefault()
Verifies that request logging does not record user names or client IP addresses unless enabled.
[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/AuditAndLoggingPrivacyDefaultsTests.cs", 84)]
public void RequestLoggingDoesNotRecordPersonalFieldsByDefault()