-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PROD-2486 Add Dynamic Erasure Email Integration (#5226)
Co-authored-by: Adrian Galvan <adrian@ethyca.com>
- Loading branch information
Showing
40 changed files
with
3,647 additions
and
202 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
data/dataset/postgres_example_custom_request_field_dataset.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dataset: | ||
- fides_key: postgres_example_custom_request_field_dataset | ||
data_categories: [] | ||
description: Postgres example dataset with a custom request field | ||
name: Postgrex Example Custom Request Field Dataset | ||
collections: | ||
- name: dynamic_email_address_config | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fides_meta: | ||
data_type: string | ||
primary_key: True | ||
- name: email_address | ||
data_categories: [system.operations] | ||
fides_meta: | ||
data_type: string | ||
- name: vendor_name | ||
data_categories: [system.operations] | ||
fides_meta: | ||
data_type: string | ||
- name: site_id | ||
data_categories: [system.operations] | ||
fides_meta: | ||
data_type: string | ||
custom_request_field: tenant_id |
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
102 changes: 102 additions & 0 deletions
102
.../api/alembic/migrations/versions/9de4bb76307a_add_dynamic_erasure_email_connector_type.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
"""Add dynamic erasure email connector type | ||
Revision ID: 9de4bb76307a | ||
Revises: a249a089f23b | ||
Create Date: 2024-09-10 11:36:35.020140 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "9de4bb76307a" | ||
down_revision = "a249a089f23b" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Add 'dynamic_erasure_email' to ConnectionType enum | ||
op.execute("ALTER TYPE connectiontype RENAME TO connectiontype_old") | ||
op.execute( | ||
""" | ||
CREATE TYPE connectiontype AS ENUM ( | ||
'mongodb', | ||
'mysql', | ||
'https', | ||
'snowflake', | ||
'redshift', | ||
'mssql', | ||
'mariadb', | ||
'bigquery', | ||
'saas', | ||
'manual', | ||
'manual_webhook', | ||
'timescale', | ||
'fides', | ||
'sovrn', | ||
'attentive', | ||
'dynamodb', | ||
'postgres', | ||
'generic_consent_email', | ||
'generic_erasure_email', | ||
'scylla', | ||
's3', | ||
'google_cloud_sql_mysql', | ||
'google_cloud_sql_postgres', | ||
'dynamic_erasure_email' | ||
) | ||
""" | ||
) | ||
op.execute( | ||
""" | ||
ALTER TABLE connectionconfig ALTER COLUMN connection_type TYPE connectiontype USING | ||
connection_type::text::connectiontype | ||
""" | ||
) | ||
op.execute("DROP TYPE connectiontype_old") | ||
|
||
|
||
def downgrade(): | ||
# Remove 'dynamic_erasure_email' from ConnectionType enum | ||
op.execute( | ||
"DELETE FROM connectionconfig WHERE connection_type IN ('dynamic_erasure_email')" | ||
) | ||
op.execute("ALTER TYPE connectiontype RENAME TO connectiontype_old") | ||
op.execute( | ||
""" | ||
CREATE TYPE connectiontype AS ENUM ( | ||
'mongodb', | ||
'mysql', | ||
'https', | ||
'snowflake', | ||
'redshift', | ||
'mssql', | ||
'mariadb', | ||
'bigquery', | ||
'saas', | ||
'manual', | ||
'manual_webhook', | ||
'timescale', | ||
'fides', | ||
'sovrn', | ||
'attentive', | ||
'dynamodb', | ||
'postgres', | ||
'generic_consent_email', | ||
'generic_erasure_email', | ||
'scylla', | ||
's3', | ||
'google_cloud_sql_mysql', | ||
'google_cloud_sql_postgres' | ||
) | ||
""" | ||
) | ||
op.execute( | ||
""" | ||
ALTER TABLE connectionconfig ALTER COLUMN connection_type TYPE connectiontype USING | ||
connection_type::text::connectiontype | ||
""" | ||
) | ||
op.execute("DROP TYPE connectiontype_old") |
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
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
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
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
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
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
Oops, something went wrong.