Skip to content

Commit

Permalink
Iterable Erasure Integration (#4695)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Galvan <[email protected]>
  • Loading branch information
MarcGEthyca and galvana authored Apr 2, 2024
1 parent 9c5dd34 commit 479a353
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The types of changes are:
- Added language switching support to the FidesJS UI based on configured translations [#4737](https://github.com/ethyca/fides/pull/4737)
- Added ability to override some experience language and primary color [#4743](https://github.com/ethyca/fides/pull/4743)
- Generate FidesJS SDK Reference Docs from tsdoc comments [#4736](https://github.com/ethyca/fides/pull/4736)
- Added erasure support for Iterable [#4695](https://github.com/ethyca/fides/pull/4695)

### Changed

Expand Down
46 changes: 46 additions & 0 deletions data/saas/config/iterable_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
saas_config:
fides_key: <instance_fides_key>
name: Iterable
type: iterable
description: A sample schema representing the Iterable integration for Fides
user_guide: https://docs.ethyca.com/user-guides/integrations/saas-integrations/iterable
version: 0.1.0

connector_params:
- name: domain
label: Domain
default_value: api.iterable.com
description: The Iterable API URL
- name: api_key
label: API key
description: The server side API key
sensitive: True

client_config:
protocol: https
host: <domain>
authentication:
strategy: api_key
configuration:
headers:
- name: Api-Key
value: <api_key>

test_request:
method: GET
path: /api/users/[email protected]
# Note, we don't normally provide an email address directly, however, in this case we are going ahead as this call will return a 200 and for this use, a generic email address is okay.

endpoints:
- name: user
requests:
delete:
method: POST
path: /api/users/forget
body: |
{
"email": "<email>"
}
param_values:
- name: email
identity: email
7 changes: 7 additions & 0 deletions data/saas/dataset/iterable_dataset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dataset:
- fides_key: <instance_fides_key>
name: iterable
description: A sample dataset representing the Iterable connector for Fides
collections:
- name: user
fields: []
6 changes: 6 additions & 0 deletions data/saas/icon/iterable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions tests/fixtures/saas/iterable_fixtures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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("iterable")


@pytest.fixture(scope="session")
def iterable_secrets(saas_config) -> Dict[str, Any]:
return {
"domain": pydash.get(saas_config, "iterable.domain")
or secrets["domain"],
"api_key": pydash.get(saas_config, "iterable.api_key") or secrets["api_key"],
}


@pytest.fixture(scope="session")
def iterable_identity_email(saas_config) -> str:
return (
pydash.get(saas_config, "iterable.identity_email") or secrets["identity_email"]
)


@pytest.fixture
def iterable_erasure_identity_email() -> str:
return generate_random_email()


@pytest.fixture
def iterable_runner(
db,
cache,
iterable_secrets,
) -> ConnectorRunner:
return ConnectorRunner(
db,
cache,
"iterable",
iterable_secrets,
)
27 changes: 27 additions & 0 deletions tests/ops/integration_tests/saas/test_iterable_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pytest

from fides.api.models.policy import Policy
from tests.ops.integration_tests.saas.connector_runner import ConnectorRunner


@pytest.mark.integration_saas
class TestIterableConnector:
def test_connection(self, iterable_runner: ConnectorRunner):
iterable_runner.test_connection()

async def test_non_strict_erasure_request(
self,
iterable_runner: ConnectorRunner,
policy: Policy,
erasure_policy_string_rewrite: Policy,
iterable_erasure_identity_email: str,
):
(
_,
erasure_results,
) = await iterable_runner.non_strict_erasure_request(
access_policy=policy,
erasure_policy=erasure_policy_string_rewrite,
identities={"email": iterable_erasure_identity_email},
)
assert erasure_results == {"iterable_instance:user": 1}

0 comments on commit 479a353

Please sign in to comment.