Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
This code is extracted from one of my private projects as an example of how to implement encryption of PII in event streams using two keys: a master key for each "data subject" that is stored in Vault and never transported to the systems that process the PII, and a key unique to each event that is stored (itself encrypted) with the event.
To be clear, the key that is stored with the data is encrypted by another key that is not stored with the data. The idea is that each "data subject" has an encryption key that is stored in Vault (external). When you encrypt data, the library will:
defmodule Mix.Tasks.InspectAggregate do | |
use Mix.Task | |
alias MyApp.EventStore | |
def run(args) do | |
Application.ensure_all_started(:eventstore) | |
_ = EventStore.start_link() | |
{opts, _} = |
create or replace function delete_stream_events_of_type(target_stream_id bigint, target_event_type text) returns integer | |
language sql | |
as | |
$$ | |
-- disable triggers | |
alter table stream_events disable trigger no_update_stream_events; | |
alter table stream_events disable trigger no_delete_stream_events; | |
alter table events disable trigger no_delete_events; |