diff --git a/CHANGELOG.md b/CHANGELOG.md index 488fb394f66..01544fd4a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ The types of changes are: ## [Unreleased](https://github.com/ethyca/fides/compare/2.31.1...main) +### Added +- Erasure support for Simon Data [#4552](https://github.com/ethyca/fides/pull/4552) + ### Changed - Removed location and regulation beta flag [#4660](https://github.com/ethyca/fides/pull/4660) - Modify `fides user login` to not store plaintext password in `~/.fides-credentials` [#4661](https://github.com/ethyca/fides/pull/4661) diff --git a/data/saas/config/simon_data_config.yml b/data/saas/config/simon_data_config.yml new file mode 100644 index 00000000000..92c21abd303 --- /dev/null +++ b/data/saas/config/simon_data_config.yml @@ -0,0 +1,40 @@ +saas_config: + fides_key: + name: Simon Data + type: simon_data + description: A sample schema representing the Simondata connector for Fides + version: 0.1.0 + + connector_params: + - name: domain + default_value: api.simondata.com + - name: api_token + label: API token + sensitive: True + + client_config: + protocol: https + host: + authentication: + strategy: bearer + configuration: + token: + + test_request: + method: GET + path: /v1/privacy/export + + endpoints: + - name: contact + requests: + delete: + method: POST + path: /v1/privacy/delete/ + body: | + { + "description": "Generated by Fides", + "email_address": "" + } + param_values: + - name: email + identity: email diff --git a/data/saas/dataset/simon_data_dataset.yml b/data/saas/dataset/simon_data_dataset.yml new file mode 100644 index 00000000000..c63c4cd1370 --- /dev/null +++ b/data/saas/dataset/simon_data_dataset.yml @@ -0,0 +1,7 @@ +dataset: + - fides_key: + name: Simon Data + description: A sample dataset representing the Simon Data connector for Fides + collections: + - name: contact + fields: [] diff --git a/data/saas/icon/simon_data.svg b/data/saas/icon/simon_data.svg new file mode 100644 index 00000000000..5982c1c0294 --- /dev/null +++ b/data/saas/icon/simon_data.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/fixtures/saas/simon_data_fixtures.py b/tests/fixtures/saas/simon_data_fixtures.py new file mode 100644 index 00000000000..dfb2f65a95d --- /dev/null +++ b/tests/fixtures/saas/simon_data_fixtures.py @@ -0,0 +1,56 @@ +from typing import Any, Dict, Generator + +import pydash +import pytest + +from tests.ops.integration_tests.saas.connector_runner import ( + ConnectorRunner, + generate_random_email, +) +from tests.ops.test_helpers.vault_client import get_secrets + +secrets = get_secrets("simon_data") + + +@pytest.fixture(scope="session") +def simon_data_secrets(saas_config) -> Dict[str, Any]: + return { + "domain": pydash.get(saas_config, "simon_data.domain") or secrets["domain"], + "api_token": pydash.get(saas_config, "simon_data.api_token") + or secrets["api_token"], + } + + +@pytest.fixture(scope="session") +def simon_data_identity_email(saas_config) -> str: + return ( + pydash.get(saas_config, "simon_data.identity_email") + or secrets["identity_email"] + ) + + +@pytest.fixture +def simon_data_erasure_identity_email() -> str: + return generate_random_email() + + +@pytest.fixture +def simon_data_erasure_data( + simon_data_erasure_identity_email: str, +) -> Generator: + # create the data needed for erasure tests here + yield {} + + +@pytest.fixture +def simon_data_runner( + db, + cache, + simon_data_secrets, +) -> ConnectorRunner: + return ConnectorRunner( + db, + cache, + "simon_data", + simon_data_secrets, + ) diff --git a/tests/ops/integration_tests/saas/test_simon_data_task.py b/tests/ops/integration_tests/saas/test_simon_data_task.py new file mode 100644 index 00000000000..01124dd6891 --- /dev/null +++ b/tests/ops/integration_tests/saas/test_simon_data_task.py @@ -0,0 +1,28 @@ +import pytest + +from fides.api.models.policy import Policy +from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner + + +@pytest.mark.integration_saas +class TestSimonDataConnector: + def test_connection(self, simon_data_runner: ConnectorRunner): + simon_data_runner.test_connection() + + async def test_non_strict_erasure_request( + self, + simon_data_runner: ConnectorRunner, + policy: Policy, + erasure_policy_string_rewrite: Policy, + simon_data_erasure_identity_email: str, + simon_data_erasure_data, + ): + ( + access_results, + erasure_results, + ) = await simon_data_runner.non_strict_erasure_request( + access_policy=policy, + erasure_policy=erasure_policy_string_rewrite, + identities={"email": simon_data_erasure_identity_email}, + ) + assert erasure_results == {"simon_data_instance:contact": 1}