Encrypted
Field annotation for marking event fields that should be encrypted.
This annotation is used in combination with DataSubject to implement crypto-shredding, allowing for GDPR-compliant data removal in event-sourced systems.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask_value
|
Any
|
Value to display when the data is shredded (deleted). Must match the field type. |
required |
subject_field
|
str | None
|
Optional. Name of the field containing the subject ID for this encrypted field. If not provided, the field marked with DataSubject will be used. |
None
|
Example
Note
- Every event with encrypted fields must have exactly one DataSubject field.
- The mask_value type must match the field type.
- After shredding, the field will always return its mask_value.