Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enriching OracleParameterInfo with flag for PII data #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

opejanovic
Copy link
Contributor

Added a new flag, MaskValueWhenLogging, to the OracleParameterInfo class. This flag is used to identify Oracle parameters containing Personally Identifiable Information (PII).

When set to true, the parameter values can be masked in logs to enhance data security and compliance with privacy standards.

Added a new flag, MaskValueWhenLogging, to the OracleParameterInfo class. This flag is used to identify Oracle parameters containing Personally Identifiable Information (PII). When set to true, the parameter values can be masked in logs to enhance data security and compliance with privacy standards.
@opejanovic
Copy link
Contributor Author

opejanovic commented Dec 21, 2024

I find this flag very useful, take a look into example

var paramDic = new Dictionary<string, string>();
foreach (var name in parameters?.ParameterNames)
{
    var paramInfo = parameters.GetParameter(name);

    string paramValue;

    if (paramInfo.MaskValueWhenLogging)
    {
        paramValue = "***MASKED***";
    }
    else
    {
        paramValue = GetParameterValue<dynamic>(parameters, name);
    }
	paramDic.Add(name, paramValue);
}
logger.LogInformation("SQL executed wiht {@parameters}", paramDic);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant