https://github.com/matiux/broadway-sensitive-serializer
Broadway serializer implementation with data sensitization support
https://github.com/matiux/broadway-sensitive-serializer
broadway cqrs cqrs-es gdpr php sensitive
Last synced: 6 months ago
JSON representation
Broadway serializer implementation with data sensitization support
- Host: GitHub
- URL: https://github.com/matiux/broadway-sensitive-serializer
- Owner: matiux
- Created: 2021-09-12T23:37:03.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-29T11:19:29.000Z (over 1 year ago)
- Last Synced: 2025-03-23T22:24:48.474Z (7 months ago)
- Topics: broadway, cqrs, cqrs-es, gdpr, php, sensitive
- Language: PHP
- Homepage: https://broadway-sensitive-serializer.readthedocs.io/en/latest/
- Size: 1.92 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sensitization support for [broadway/broadway](https://github.com/broadway/broadway)
===

[](https://codecov.io/gh/matiux/broadway-sensitive-serializer)
[](https://shepherd.dev/github/matiux/broadway-sensitive-serializer)
[](https://shepherd.dev/github/matiux/broadway-sensitive-serializer)



The idea behind this project is to make a CQRS+ES system compliant, specifically implemented through
the [Broadway](https://github.com/broadway/broadway) library, with the General Data Protection Regulation (GDPR),
in particular with the right to be forgotten.Normal Broadway event payload
```json
{
"class": "SensitiveUser\\User\\Domain\\Event\\UserRegistered",
"payload": {
"id": "b0fce205-d816-46ac-886f-06de19236750",
"name": "Matteo",
"surname": "Galacci",
"email": "m.galacci@gmail.com",
"occurred_at": "2022-01-08T14:22:38.065+00:00"
}
}
```Example of a payload with the extension active
```json
{
"class": "SensitiveUser\\User\\Domain\\Event\\UserRegistered",
"payload": {
"id": "b0fce205-d816-46ac-886f-06de19236750",
"name": "Matteo",
"surname": "#-#2Iuofg4NKKPLAG2kdJrbmQ==:bxQo+zXfjUgrD0jHuht0mQ==",
"email": "#-#OFLfN9XDKtWrmCmUb6mhY0Iz2V6wtam0pcqs6vDJFRU=:bxQo+zXfjUgrD0jHuht0mQ==",
"occurred_at": "2022-01-08T14:22:38.065+00:00"
}
}
```The symfony bundle exists to simplify integration with the framework [here](https://github.com/matiux/broadway-sensitive-serializer-bundle)
Read the [doc](https://broadway-sensitive-serializer.readthedocs.io/en/latest/) for more information.
## Install
```shell
composer require matiux/broadway-sensitive-serializer
```
## Setup for development```shell
git clone https://github.com/matiux/broadway-sensitive-serializer.git && cd broadway-sensitive-serializer
cp docker/docker-compose.override.dist.yml docker/docker-compose.override.yml
rm -rf .git/hooks && ln -s ../scripts/git-hooks .git/hooks
```This repository uses GitHub actions to perform some checks. If you want to test the actions locally you can use [act](https://github.com/nektos/act).
For example if you want to check the action for static analysis
```
act -P ubuntu-latest=shivammathur/node:latest --job static-analysis
```### Interact with the PHP container
You can interact with the PHP container through the [makefile](./makefile)Some uses:
```shell
make upd
make enter
make phpunit
make psalm
make coding-standard-fix-staged
make build-php ARG="--no-cache"
make build-docs
```
Check out [here](./makefile) for all the options.### Install dependencies to run test or execute examples
```shell
make build-php ARG="--no-cache"
make upd
make composer ARG="install"
```### Run test
```shell
make build-php ARG="--no-cache"
make upd
make phpunit
```## Example code
Read the [examples section](https://broadway-sensitive-serializer.readthedocs.io/en/latest/examples.html)