Skip to content

Enable data masking #113

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

Merged
merged 1 commit into from
Mar 12, 2025
Merged

Enable data masking #113

merged 1 commit into from
Mar 12, 2025

Conversation

tpflueger
Copy link
Contributor

@tpflueger tpflueger commented Apr 10, 2024

Adds a method that would enable masking row values on export.

@adriancs2 adriancs2 merged commit 62548cb into MySqlBackupNET:master Mar 12, 2025
@adriancs2
Copy link
Member

Thank you very much

@adriancs2
Copy link
Member

this code changes has integrated into release version of v2.3.9
all nuget packages have already updated to this version.
Thank you

@adriancs2
Copy link
Member

@tpflueger I have written a documentation/wiki page attempting to explain this feature.

Uncyclo: https://github.com/MySqlBackupNET/MySqlBackup.Net/wiki/Adjust-Column-Value

As you are the original code contributor of this feature, I would like to invite you to review the wiki page and determine if any meaningful points have been omitted. Thank you again.

And my apologies for the "late" response to this pull request :)

@adriancs2
Copy link
Member

adriancs2 commented Mar 13, 2025

@tpflueger Hi tpflueger, can you share some code snippet of how you use this feature on masking data? I would like to share your idea at the wiki page. thank you very much.

@tpflueger
Copy link
Contributor Author

@adriancs2 The documentation looks great! Our use case was for masking data for privacy in environments other than production. An example below utilizing Faker to generate fake data.

private object MaskUserTable(ColumnWithValue columnInfo)
{
    switch (columnInfo.ColumnName)
    {
        case "EmailAddress":
            {
                var username = Faker.Internet.UserName(name);
                return username;
            }
        default:
            return columnInfo.Value;
    }
}

private object MaskColumnValue(ColumnWithValue columnInfo)
{
    switch (columnInfo.TableName)
    {
        case "users":
            return MaskUserTable(columnInfo);
        default:
            return columnInfo.Value;
    }
}

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.

2 participants