The sample demonstrates how you can override the default Json Converter to encrypt/decrypt payloads using jackson-json-crypto.
- Start Temporal Server with "default" namespace enabled. For example using local Docker:
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose up
- Run the following command to start the sample:
./gradlew -q execute -PmainClass=io.temporal.samples.payloadconverter.crypto.Starter
- View the history in Temporal Web UI You will see your workflow inputs fields that were set to be encrypted in the MyCustomer model class are indeed encrypted, for example:
[
{
"name": {
"salt": "uZnKfjmFzwYsH6ncZBVgvvmAPTw=",
"iv": "0nK++kg8IgtOJFs+gQ/U0A==",
"value": "cvXFWXfU8RFKdlWgjrHaog=="
},
"age": {
"salt": "uZnKfjmFzwYsH6ncZBVgvvmAPTw=",
"iv": "0nK++kg8IgtOJFs+gQ/U0A==",
"value": "OFA/XDiwep153xZHOECqJA=="
},
"approved": {
"salt": "uZnKfjmFzwYsH6ncZBVgvvmAPTw=",
"iv": "0nK++kg8IgtOJFs+gQ/U0A==",
"value": "Tm23RaHHKz2wM56G2Bn6Vw=="
}
}
]