58 instantiations of DataClassification
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Logging\HttpLoggingServiceExtensionsTests.cs (3)
63{ "one", new DataClassification("Taxonomy1", "Value1") }, 68{ "two", new DataClassification("Taxonomy2", "Value2") }, 73{ "three", new DataClassification("Taxonomy3", "Value3") },
Microsoft.Extensions.Compliance.Abstractions (2)
Classification\DataClassification.cs (2)
17public static DataClassification None => new(nameof(None)); 22public static DataClassification Unknown => new(nameof(Unknown));
Microsoft.Extensions.Compliance.Abstractions.Tests (15)
Classification\DataClassificationAttributeTests.cs (2)
16: base(new DataClassification(TaxonomyName, Value)) 26Assert.True(attribute.Classification == new DataClassification(TaxonomyName, Value));
Classification\DataClassificationTests.cs (10)
16var dc = new DataClassification(TaxonomyName, Value); 20Assert.True(dc == new DataClassification(TaxonomyName, Value)); 21Assert.False(dc != new DataClassification(TaxonomyName, Value)); 23Assert.True(dc != new DataClassification(TaxonomyName + "x", Value)); 24Assert.False(dc == new DataClassification(TaxonomyName + "x", Value)); 26Assert.True(dc != new DataClassification(TaxonomyName, Value + 1)); 27Assert.False(dc == new DataClassification(TaxonomyName, Value + 1)); 33Assert.NotEqual(dc.GetHashCode(), new DataClassification(TaxonomyName + "X", Value).GetHashCode()); 34Assert.NotEqual(dc.GetHashCode(), new DataClassification(TaxonomyName, Value + 1).GetHashCode()); 45var dc = new DataClassification(TaxonomyName, Value);
Redaction\NullRedactorTest.cs (3)
50var dc1 = new DataClassification("TAX", "1"); 51var dc2 = new DataClassification("TAX", "2"); 52var dc3 = new DataClassification("TAX", "4");
Microsoft.Extensions.Compliance.Redaction.Tests (18)
RedactionAcceptanceTests.cs (4)
16var dc1 = new DataClassification("TAX", "1"); 17var dc2 = new DataClassification("TAX", "2"); 42var dc = new DataClassification("TAX", "1"); 68var dc = new DataClassification("TAX", "1");
RedactorProviderTests.cs (14)
26var dc = new DataClassification("Foo", "0x2"); 36private static readonly DataClassification _dataClassification1 = new("TAX", "1"); 37private static readonly DataClassification _dataClassification2 = new("TAX", "2"); 38private static readonly DataClassification _dataClassification3 = new("TAX", "4"); 65var dc1 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification")); 66var dc2 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification2")); 67var dc3 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification3")); 68var dc4 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification4")); 69var dc5 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification5")); 70var dc6 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification6")); 71var dc7 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification7")); 72var dc8 = new DataClassificationSet(new DataClassification("DummyTaxonomy", "Classification8")); 74var dc9 = new DataClassification("DummyTaxonomy", "Classification9"); 76var dc1LogicalCopy = new DataClassificationSet(new[] { new DataClassification("DummyTaxonomy", "Classification") });
Microsoft.Extensions.Compliance.Testing (2)
FakeTaxonomy.cs (2)
21public static DataClassification PrivateData => new(TaxonomyName, nameof(PrivateData)); 26public static DataClassification PublicData => new(TaxonomyName, nameof(PublicData));
Microsoft.Extensions.Compliance.Testing.Tests (18)
FakeRedactorProviderTests.cs (2)
16var dc = new DataClassification("TAX", "1"); 25var dc = new DataClassification("TAX", "1");
FakeRedactorTests.cs (3)
79new DataClassification("TAX", "1"), 80new DataClassification("TAX", "2"), 81new DataClassification("TAX", "3"),
RedactionFakesAcceptanceTests.cs (12)
17var dc = new DataClassification("Foo", "0x1"); 37var dc = new DataClassification("TAX", "1"); 56var dc = new DataClassification("Foo", "0x1"); 76var dc = new DataClassification("TAX", "1"); 95var dc = new DataClassification("Foo", "0x1"); 115var dc = new DataClassification("TAX", "1"); 135var dc = new DataClassification("TAX", "1"); 155var dc = new DataClassification("TAX", "1"); 175var dc = new DataClassification("TAX", "1"); 207var dc = new DataClassification("TAX", "1"); 229var dc = new DataClassification("TAX", "1"); 248var dc = new DataClassification("TAX", "1");
RedactionFakesEventCollectorTests.cs (1)
54var dc = new DataClassification("TAX", "1");
264 references to DataClassification
Microsoft.AspNetCore.Diagnostics.Middleware (22)
Logging\HeaderNormalizer.cs (1)
10public static string[] PrepareNormalizedHeaderNames(KeyValuePair<string, DataClassification>[] headers, string prefix)
Logging\HeaderReader.cs (2)
18private readonly KeyValuePair<string, DataClassification>[] _headers; 21public HeaderReader(IDictionary<string, DataClassification> headersToLog, IRedactorProvider redactorProvider, string prefix)
Logging\HttpLoggingRedactionInterceptor.cs (1)
35private readonly FrozenDictionary<string, DataClassification> _parametersToRedactMap;
Logging\IIncomingHttpRouteUtility.cs (2)
22IReadOnlyDictionary<string, DataClassification> GetSensitiveParameters(string httpRoute, HttpRequest request, IReadOnlyDictionary<string, DataClassification> defaultSensitiveParameters);
Logging\IncomingHttpRouteUtility.cs (5)
22private readonly ConcurrentDictionary<string, FrozenDictionary<string, DataClassification>> _parametersToRedactCache = new(); 24public IReadOnlyDictionary<string, DataClassification> GetSensitiveParameters(string httpRoute, HttpRequest request, IReadOnlyDictionary<string, DataClassification> defaultSensitiveParameters) 36var parametersToRedact = new Dictionary<string, DataClassification>(); 56var classification = ((DataClassificationAttribute)dataClassificationAttributes[0]).Classification;
Logging\LoggingRedactionOptions.cs (8)
54/// it's not found in this map, it will be redacted as if it was <see cref="DataClassification.Unknown"/>. 55/// If you don't want a parameter to be redacted, mark it as <see cref="DataClassification.None"/>. 59public IDictionary<string, DataClassification> RouteParameterDataClasses { get; set; } = new Dictionary<string, DataClassification>(StringComparer.OrdinalIgnoreCase); 70public IDictionary<string, DataClassification> RequestHeadersDataClasses { get; set; } = new Dictionary<string, DataClassification>(StringComparer.OrdinalIgnoreCase); 81public IDictionary<string, DataClassification> ResponseHeadersDataClasses { get; set; } = new Dictionary<string, DataClassification>(StringComparer.OrdinalIgnoreCase);
Logging\RequestHeadersLogEnricher.cs (1)
21private readonly KeyValuePair<string, DataClassification>[] _headersDataClasses;
Logging\RequestHeadersLogEnricherOptions.cs (2)
27public IDictionary<string, DataClassification> HeadersDataClasses { get; set; } = new Dictionary<string, DataClassification>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (31)
Logging\AcceptanceTests.cs (4)
277x.RequestHeadersDataClasses.Add(HeaderNames.Accept, DataClassification.None); 278x.ResponseHeadersDataClasses.Add(HeaderNames.TransferEncoding, DataClassification.None); 348x.RequestHeadersDataClasses.Add(HeaderNames.Accept, DataClassification.None); 349x.ResponseHeadersDataClasses.Add(HeaderNames.TransferEncoding, DataClassification.None);
Logging\AcceptanceTests.Mvc.cs (1)
137x.RouteParameterDataClasses.Add(new(NoDataClassParamName, DataClassification.None));
Logging\HeaderNormalizerTests.cs (4)
17new KeyValuePair<string, DataClassification>("Accept-Charset", DataClassification.Unknown), 18new KeyValuePair<string, DataClassification>("CONTENT-TYPE", DataClassification.Unknown)
Logging\HeaderReaderTests.cs (5)
20var reader = new HeaderReader(new Dictionary<string, DataClassification>(), null!, string.Empty); 30var reader = new HeaderReader(new Dictionary<string, DataClassification> { [HeaderNames.Accept] = DataClassification.Unknown }, null!, string.Empty); 42var headersToLog = new Dictionary<string, DataClassification> 44[HeaderNames.AcceptCharset] = DataClassification.Unknown
Logging\HttpLoggingServiceExtensionsTests.cs (3)
61o.RouteParameterDataClasses = new Dictionary<string, DataClassification> 66o.RequestHeadersDataClasses = new Dictionary<string, DataClassification> 71o.ResponseHeadersDataClasses = new Dictionary<string, DataClassification>
Logging\IncomingHttpRouteUtilityTests.cs (11)
57var sensitiveParameters = routeUtility.GetSensitiveParameters(httpRoute, mockHttpRequest.Object, new Dictionary<string, DataClassification>(StringComparer.Ordinal)); 95var sensitiveParameters = routeUtility.GetSensitiveParameters(httpRoute, mockHttpRequest.Object, new Dictionary<string, DataClassification>(StringComparer.Ordinal)); 135var sensitiveParameters = routeUtility.GetSensitiveParameters(httpRoute, mockHttpRequest.Object, new Dictionary<string, DataClassification>(StringComparer.Ordinal)); 177var d = new Dictionary<string, DataClassification> 220var d = new Dictionary<string, DataClassification> 267var sensitiveParameters = routeUtility.GetSensitiveParameters(httpRoute, mockHttpRequest.Object, new Dictionary<string, DataClassification>(StringComparer.Ordinal)); 306var d = new Dictionary<string, DataClassification> 354var d = new Dictionary<string, DataClassification> 399var d = new Dictionary<string, DataClassification>(); 438var d = new Dictionary<string, DataClassification> 460var d = new Dictionary<string, DataClassification>
Logging\RequestHeadersEnricherExtensionsTests.cs (2)
32.AddRequestHeadersLogEnricher(e => e.HeadersDataClasses.Add("TestKey", DataClassification.None)) 58e.HeadersDataClasses.Add("TestKey", DataClassification.None);
Logging\RequestHeadersEnricherTests.cs (1)
265HeadersDataClasses = new Dictionary<string, DataClassification>
Microsoft.Extensions.Compliance.Abstractions (26)
Classification\DataClassification.cs (13)
12public readonly struct DataClassification : IEquatable<DataClassification> 17public static DataClassification None => new(nameof(None)); 22public static DataClassification Unknown => new(nameof(Unknown)); 35/// Initializes a new instance of the <see cref="DataClassification"/> struct. 52/// Checks if an object is equal to this instance of <see cref="DataClassification"/>. 56public override bool Equals(object? obj) => (obj is DataClassification dc) && Equals(dc); 59/// Checks if an object is equal to this instance of <see cref="DataClassification"/>. 61/// <param name="other">Instance of <see cref="DataClassification"/> to check for equality.</param> 63public bool Equals(DataClassification other) => other.TaxonomyName == TaxonomyName && other.Value == Value; 77public static bool operator ==(DataClassification left, DataClassification right) 88public static bool operator !=(DataClassification left, DataClassification right)
Classification\DataClassificationAttribute.cs (2)
34public DataClassification Classification { get; } 40protected DataClassificationAttribute(DataClassification classification)
Classification\DataClassificationSet.cs (9)
17private readonly HashSet<DataClassification> _classifications = []; 24public DataClassificationSet(DataClassification classification) 34public DataClassificationSet(IEnumerable<DataClassification> classifications) 45public DataClassificationSet(params DataClassification[] classifications) 56public static implicit operator DataClassificationSet(DataClassification classification) 66public static DataClassificationSet FromDataClassification(DataClassification classification) => new(classification); 80var combinedClassifications = new HashSet<DataClassification>(_classifications); 122foreach (var c in a) 155foreach (var item in _classifications)
Classification\NoDataClassificationAttribute.cs (1)
15: base(DataClassification.None)
Classification\UnknownDataClassificationAttribute.cs (1)
15: base(DataClassification.Unknown)
Microsoft.Extensions.Compliance.Abstractions.Tests (11)
Classification\DataClassificationSetTests.cs (2)
17var dc3 = new DataClassificationSet(new List<DataClassification> { FakeTaxonomy.PublicData }); 39var dc3 = new DataClassificationSet(new List<DataClassification> { FakeTaxonomy.PublicData });
Classification\DataClassificationTests.cs (4)
16var dc = new DataClassification(TaxonomyName, Value); 45var dc = new DataClassification(TaxonomyName, Value); 49Assert.Equal("None", DataClassification.None.ToString()); 50Assert.Equal("Unknown", DataClassification.Unknown.ToString());
Classification\NoDataClassificationAttributeTests.cs (1)
14Assert.Equal(DataClassification.None, attribute.Classification);
Classification\UnknownDataClassificationAttributeTests.cs (1)
14Assert.Equal(DataClassification.Unknown, attribute.Classification);
Redaction\NullRedactorTest.cs (3)
50var dc1 = new DataClassification("TAX", "1"); 51var dc2 = new DataClassification("TAX", "2"); 52var dc3 = new DataClassification("TAX", "4");
Microsoft.Extensions.Compliance.Redaction (2)
RedactorProvider.cs (2)
40if (!map.ContainsKey(DataClassification.None)) 42map.Add(DataClassification.None, typeof(NullRedactor));
Microsoft.Extensions.Compliance.Redaction.Tests (13)
HmacRedactorExtensionsTests.cs (1)
53foreach (var dc in classifications)
RedactionAcceptanceTests.cs (5)
16var dc1 = new DataClassification("TAX", "1"); 17var dc2 = new DataClassification("TAX", "2"); 24.SetRedactor<FakePlaintextRedactor>(DataClassification.Unknown) 42var dc = new DataClassification("TAX", "1"); 68var dc = new DataClassification("TAX", "1");
RedactorProviderTests.cs (7)
20Assert.IsType<NullRedactor>(redactorProvider.GetRedactor(DataClassification.None)); 26var dc = new DataClassification("Foo", "0x2"); 36private static readonly DataClassification _dataClassification1 = new("TAX", "1"); 37private static readonly DataClassification _dataClassification2 = new("TAX", "2"); 38private static readonly DataClassification _dataClassification3 = new("TAX", "4"); 54Redactor r4 = redactorProvider.GetRedactor(DataClassification.None); 74var dc9 = new DataClassification("DummyTaxonomy", "Classification9");
Microsoft.Extensions.Compliance.Testing (2)
FakeTaxonomy.cs (2)
21public static DataClassification PrivateData => new(TaxonomyName, nameof(PrivateData)); 26public static DataClassification PublicData => new(TaxonomyName, nameof(PublicData));
Microsoft.Extensions.Compliance.Testing.Tests (15)
FakeRedactorProviderTests.cs (2)
16var dc = new DataClassification("TAX", "1"); 25var dc = new DataClassification("TAX", "1");
RedactionFakesAcceptanceTests.cs (12)
17var dc = new DataClassification("Foo", "0x1"); 37var dc = new DataClassification("TAX", "1"); 56var dc = new DataClassification("Foo", "0x1"); 76var dc = new DataClassification("TAX", "1"); 95var dc = new DataClassification("Foo", "0x1"); 115var dc = new DataClassification("TAX", "1"); 135var dc = new DataClassification("TAX", "1"); 155var dc = new DataClassification("TAX", "1"); 175var dc = new DataClassification("TAX", "1"); 207var dc = new DataClassification("TAX", "1"); 229var dc = new DataClassification("TAX", "1"); 248var dc = new DataClassification("TAX", "1");
RedactionFakesEventCollectorTests.cs (1)
54var dc = new DataClassification("TAX", "1");
Microsoft.Extensions.Http.Diagnostics (18)
Logging\Internal\HttpHeadersReader.cs (5)
18private readonly FrozenDictionary<string, DataClassification> _requestHeadersToLog; 19private readonly FrozenDictionary<string, DataClassification> _responseHeadersToLog; 73private void ReadHeaders(HttpHeaders headers, FrozenDictionary<string, DataClassification> headersToLog, List<KeyValuePair<string, string>> destination) 87if (headersToLog.TryGetValue(header.Key, out var classification)) 99var classification = kvp.Value;
Logging\Internal\HttpHeadersRedactor.cs (3)
24public string Redact(IEnumerable<string> headerValues, DataClassification classification) => 32private string RedactIEnumerable(IEnumerable<string> input, DataClassification classification) 97private string RedactList(IReadOnlyList<string> input, DataClassification classification)
Logging\Internal\HttpRequestReader.cs (1)
25private readonly FrozenDictionary<string, DataClassification> _defaultSensitiveParameters;
Logging\Internal\IHttpHeadersRedactor.cs (1)
21string Redact(IEnumerable<string> headerValues, DataClassification classification);
Logging\LoggingOptions.cs (8)
98/// If the data class is <see cref="DataClassification.None"/>, no redaction will be done. 103public IDictionary<string, DataClassification> RequestHeadersDataClasses { get; set; } = new Dictionary<string, DataClassification>(); 112/// If the data class is <see cref="DataClassification.None"/>, no redaction will be done. 118public IDictionary<string, DataClassification> ResponseHeadersDataClasses { get; set; } = new Dictionary<string, DataClassification>(); 147public IDictionary<string, DataClassification> RouteParameterDataClasses { get; set; } = new Dictionary<string, DataClassification>();
Microsoft.Extensions.Http.Diagnostics.Tests (64)
Logging\AcceptanceTests.cs (10)
453options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test1", FakeTaxonomy.PrivateData } }; 460options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test2", FakeTaxonomy.PrivateData } }; 489options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test1", FakeTaxonomy.PrivateData } }; 496options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test2", FakeTaxonomy.PrivateData } }; 523options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test1", FakeTaxonomy.PrivateData } }; 529options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test2", FakeTaxonomy.PrivateData } }; 535options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test3", FakeTaxonomy.PrivateData } }; 541options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test4", FakeTaxonomy.PrivateData } }; 547options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test5", FakeTaxonomy.PrivateData } }; 552options.ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { "test6", FakeTaxonomy.PrivateData } };
Logging\HttpClientLoggerTest.cs (21)
93mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 204ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { TestResponseHeader, FakeTaxonomy.PrivateData }, { "Header3", FakeTaxonomy.PrivateData } }, 205RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { TestRequestHeader, FakeTaxonomy.PrivateData }, { "Header3", FakeTaxonomy.PrivateData } }, 216mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 296ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { TestResponseHeader, FakeTaxonomy.PrivateData } }, 297RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { TestRequestHeader, FakeTaxonomy.PrivateData } }, 314.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 403ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { TestResponseHeader, FakeTaxonomy.PrivateData } }, 404RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { TestRequestHeader, FakeTaxonomy.PrivateData } }, 419mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 499ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { TestResponseHeader, FakeTaxonomy.PrivateData } }, 500RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { TestRequestHeader, FakeTaxonomy.PrivateData } }, 516.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 613ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { TestResponseHeader, FakeTaxonomy.PrivateData } }, 614RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { TestRequestHeader, FakeTaxonomy.PrivateData } }, 627mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 669mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 713mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 883ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { TestResponseHeader, FakeTaxonomy.PrivateData } }, 884RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { TestRequestHeader, FakeTaxonomy.PrivateData } }, 897mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>()))
Logging\HttpClientLoggingExtensionsTest.cs (3)
142options.RequestHeadersDataClasses.Should().ContainValues(new List<DataClassification> { FakeTaxonomy.PrivateData }); 157var paramToRedact = new KeyValuePair<string, DataClassification>("userId", FakeTaxonomy.PrivateData); 266var paramToRedact = new KeyValuePair<string, DataClassification>("userId", FakeTaxonomy.PrivateData);
Logging\HttpHeadersReaderTest.cs (6)
48.Returns<IEnumerable<string>, DataClassification>((x, _) => string.Join(",", x)); 52RequestHeadersDataClasses = new Dictionary<string, DataClassification> 57ResponseHeadersDataClasses = new Dictionary<string, DataClassification> 110.Returns<IEnumerable<string>, DataClassification>((x, _) => string.Join(",", x)); 114RequestHeadersDataClasses = new Dictionary<string, DataClassification> 120ResponseHeadersDataClasses = new Dictionary<string, DataClassification>
Logging\HttpRequestReaderTest.cs (21)
61RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } }, 62ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } }, 70mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 134mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 187RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 188ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 197mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 261RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 262ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 272mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 335RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 344mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 392RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 393ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 402mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 463RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 464ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 473mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>())) 530RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 531ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 540mockHeadersRedactor.Setup(r => r.Redact(It.IsAny<IEnumerable<string>>(), It.IsAny<DataClassification>()))
Logging\LoggingOptionsTest.cs (3)
73var testHeaders = new Dictionary<string, DataClassification> 87var testHeaders = new Dictionary<string, DataClassification> 122var paramsToRedacts = new Dictionary<string, DataClassification>
Microsoft.Extensions.Telemetry (25)
Http\HttpRouteFormatter.cs (14)
35public string Format(string httpRoute, string httpPath, HttpRouteParameterRedactionMode redactionMode, IReadOnlyDictionary<string, DataClassification> parametersToRedact) 45IReadOnlyDictionary<string, DataClassification> parametersToRedact) 117in ParsedRouteSegments routeSegments, HttpRouteParameterRedactionMode redactionMode, IReadOnlyDictionary<string, DataClassification> parametersToRedact) 135if ((!parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification) && 137classification != DataClassification.None) 145if (parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification) && classification != DataClassification.None) 178IReadOnlyDictionary<string, DataClassification> parametersToRedact, 198IReadOnlyDictionary<string, DataClassification> parametersToRedact, 201if (parametersToRedact.TryGetValue(httpRouteSegment.ParamName, out var classification)) 203if (classification != DataClassification.None) 240IReadOnlyDictionary<string, DataClassification> parametersToRedact, 243if (parametersToRedact.TryGetValue(httpRouteSegment.ParamName, out DataClassification classification) 244&& classification != DataClassification.None)
Http\HttpRouteParser.cs (8)
36IReadOnlyDictionary<string, DataClassification> parametersToRedact, 252IReadOnlyDictionary<string, DataClassification> parametersToRedact, 269IReadOnlyDictionary<string, DataClassification> parametersToRedact, 272if (parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification)) 274if (classification != DataClassification.None) 300IReadOnlyDictionary<string, DataClassification> parametersToRedact, 303if (parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification) 304&& classification != DataClassification.None)
Http\IHttpRouteFormatter.cs (2)
23string Format(string httpRoute, string httpPath, HttpRouteParameterRedactionMode redactionMode, IReadOnlyDictionary<string, DataClassification> parametersToRedact); 33string Format(in ParsedRouteSegments routeSegments, string httpPath, HttpRouteParameterRedactionMode redactionMode, IReadOnlyDictionary<string, DataClassification> parametersToRedact);
Http\IHttpRouteParser.cs (1)
35IReadOnlyDictionary<string, DataClassification> parametersToRedact,
Microsoft.Extensions.Telemetry.Tests (30)
Http\HttpParserTests.cs (13)
21Dictionary<string, DataClassification> parametersToRedact = new() { { "chatId", FakeTaxonomy.PrivateData } }; 38Dictionary<string, DataClassification> parametersToRedact = new() { { "chatId", FakeTaxonomy.PrivateData } }; 57Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 77Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 123Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 155Dictionary<string, DataClassification> parametersToRedact = new() { { "chatId", FakeTaxonomy.PrivateData } }; 226Dictionary<string, DataClassification> parametersToRedact = new() { { "chatId", FakeTaxonomy.PrivateData } }; 251parametersToRedact.Add("routeId", DataClassification.None); 262parametersToRedact.Add("chatId", DataClassification.None); 280Dictionary<string, DataClassification> parametersToRedact = new() { { "filter", FakeTaxonomy.PrivateData } }; 347Dictionary<string, DataClassification> parametersToRedact = new() 391Dictionary<string, DataClassification> parametersToRedact = new() 437Dictionary<string, DataClassification> parametersToRedact = new()
Http\HttpRouteFormatterTests.cs (17)
20var parametersToRedact = new Dictionary<string, DataClassification>(); 93Dictionary<string, DataClassification> parametersToRedact = new() 136Dictionary<string, DataClassification> parametersToRedact = new() 157Dictionary<string, DataClassification> parametersToRedact = new() 218Dictionary<string, DataClassification> parametersToRedact = new() 220{ "userId", DataClassification.None }, 221{ "routeId", DataClassification.None }, 222{ "chatId", DataClassification.None }, 239Dictionary<string, DataClassification> parametersToRedact = new() 242{ "routeId", DataClassification.None }, 257Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 324Dictionary<string, DataClassification> parametersToRedact = new() { { "chatId", FakeTaxonomy.PrivateData } }; 353Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 373Dictionary<string, DataClassification> parametersToRedact = new() { { "filter", FakeTaxonomy.PrivateData } }; 415Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 435Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } }; 451Dictionary<string, DataClassification> parametersToRedact = new() { { "routeId", FakeTaxonomy.PrivateData } };
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
172Assembly.GetAssembly(typeof(Extensions.Compliance.Classification.DataClassification))!,
Microsoft.Gen.Logging.Unit.Tests (4)
AttributeParserTests.cs (1)
240var dataClassificationAssembly = Assembly.GetAssembly(typeof(DataClassification));
CompilationHelper.cs (1)
35refs.Add(MetadataReference.CreateFromFile(typeof(DataClassification).Assembly.Location));
EmitterTests.cs (1)
44Assembly.GetAssembly(typeof(DataClassification))!,
ParserTests.cs (1)
726Assembly.GetAssembly(typeof(DataClassification))!,