-
Notifications
You must be signed in to change notification settings - Fork 3
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
GDPR redaction support #247
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ot enforce nullability
…ddition to the built-in ones. Added analyzer to ensure the extended type is annotated correctly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This adds support for retroactively redacting personal data details from previously committed events. Redactions are scoped to a single EventSourceId, and a single event type, and allow you to overwrite or remove specific fields.
How to use it
Events that should be redacted must be annotated to target the fields that should be updated or removed
They can then be redacted by committing a targeted redaction event on the same eventsourceId as the redacted events.
It can either be done with the built-in event
or a user-created event
Applied like this
What about read models and aggregate state ?
Aggregates and read models should handle the redactions as normal events, and update state accordingly.
Ex
Read models are not automagically updated, but should handle the redaction events themselves. Redaction events after being committed behave exactly as any other event, and can be processed by both eventhandlers and projections.
Since you would want the eventhandlers to only handle as few events as needed, user defined redaction events are the suggested way to perform redactions.
How does it work?
The runtime will recognize the redaction event type with the redaction prefix
"de1e7e17-bad5-da7a"
, and if the events have the correctly formatted structure, it will perform the redactions in the same transaction as the new events are being added.It will replace overridden properties as specified in
RedactedProperties
, and remove properties that are defined with null values.Redaction events themselves cannot be redacted, to ensure auditability of the system.
Added
Dolittle.SDK.Events.Redaction.PersonalDataRedactedForEvent
- Built in event that can redact any event typeDolittle.SDK.Events.Redaction.PersonalDataRedactedForEvent<TEvent>
- Class to extend in order to create redactions for specific eventsDolittle.SDK.Events.Redaction
- Use this to simplify creation of redaction eventsUpdated