-
Notifications
You must be signed in to change notification settings - Fork 732
/
DataClassificationAttribute.cs
44 lines (39 loc) · 1.44 KB
/
DataClassificationAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
namespace Microsoft.Extensions.Compliance.Classification;
/// <summary>
/// Base attribute for data classification.
/// </summary>
[AttributeUsage(
AttributeTargets.Field
| AttributeTargets.Property
| AttributeTargets.Parameter
| AttributeTargets.Class
| AttributeTargets.Struct
| AttributeTargets.Interface
| AttributeTargets.ReturnValue
| AttributeTargets.GenericParameter,
AllowMultiple = true)]
#pragma warning disable CA1813 // Avoid unsealed attributes
public class DataClassificationAttribute : Attribute
#pragma warning restore CA1813 // Avoid unsealed attributes
{
/// <summary>
/// Gets or sets the notes.
/// </summary>
/// <remarks>Optional free-form text to provide context during a privacy audit.</remarks>
public string Notes { get; set; } = string.Empty;
/// <summary>
/// Gets the classification represented by this attribute.
/// </summary>
public DataClassification Classification { get; }
/// <summary>
/// Initializes a new instance of the <see cref="DataClassificationAttribute"/> class.
/// </summary>
/// <param name="classification">The data classification to apply.</param>
protected DataClassificationAttribute(DataClassification classification)
{
Classification = classification;
}
}