Add "redactors" API to enable easy redacting of (possibly sensitive) data #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Building on #12, this adds a set of helpful "modifiers" that are specifically designed to redact data from events. These objects are configurable and easy to extend.
An immediate use-case for these redactors is to redact sensitive data. As Jupyter applications begin to emit events, it's critical that we provide easy configuration to handle sensitive data under different deployment requirements. This API becomes the foundation for these applications or deployers to easily redact sensitive data in ways that suit their requirements.
The API is quite simple. To redact events, either configure or extend one of the provided
Redactor
classes. Redactors can act on whole schemas, individual properties within schemas, or all properties that match a certain (regex) pattern. They can be appended to theEventLogger
through the.add_modifier
API and chained with other modifiers to mutate events.Over time, we can offer different types of Redactors as the need arises. In this PR, I've provided a
MaskRedactor
(just replaced redacted values with a configurable string) and aRemovalRedactor
(deletes key/values from a schema).Todo: