extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Warn when non-instance members are annotated with data classification attributes

Open xakep139 opened this issue 2 years ago • 0 comments

Originally raised in the PR: https://github.com/dotnet/extensions/pull/4658/files/10aaa0f1ff678707dd3dcc24556f52e6e83c6d5d#diff-34c8e3af3817fab6821f66bbb4341255c5413079bc94560de0a77e973412701f

TL;DR: we should add an analyzer (or emit a warning in our logging source-gen) when someone applies a data classification attribute on a non-instance member (e.g. const or static field):

class MyClass
{
    [PrivateData] public const string ConstFieldBase = "Sensitive information...";
}

xakep139 avatar Nov 04 '23 15:11 xakep139