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

Expose Binlog reader API needed for sensitive data redacting #9132

Merged
merged 5 commits into from Aug 24, 2023

Conversation

JanKrivanek
Copy link
Member

@JanKrivanek JanKrivanek commented Aug 16, 2023

Contributes to #9089

Context

The simpliest way of redacting specific strings from binlogs is by replaying it via reader, while altering strings and immediately writing to new binlog via writer. To allow this scenario - the string manipulation during reading is exposed.
Based on team decision - the actual leveraging of the exposed functionality will currently live outside of this repo

Changes Made

  • Added interfaces with events
  • Added EventArgs allowing manipulation of the read strings (return value or ref argument of an event is an antipattern. Alternative we could use a Span<char> as an event arg - allowing in-place changes - but that would mean we'd need to create the span [which involves copying of the internal string buffer], for each read string, even those we wouldn't need to alter)
  • Made reader code nullable compatible

Copy link
Member

@Forgind Forgind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in saying this PR doesn't actually do anything, just sets us up to be able to redact logs more easily in the future as they're produced?

Copy link
Member

@Forgind Forgind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'm excited to see this getting used!

@JanKrivanek
Copy link
Member Author

rekicking CLA bot

@JanKrivanek JanKrivanek reopened this Aug 23, 2023
@JanKrivanek
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JaynieBai JaynieBai merged commit 0686210 into dotnet:main Aug 24, 2023
8 checks passed
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.

None yet

5 participants