Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterable Erasure Integration #4695

Merged
merged 17 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The types of changes are:
- `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fides/compare/2.33.0...main)
- Added erasure support for Iterable [#4695](https://github.com/ethyca/fides/pull/4695)
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved

## [2.33.0](https://github.com/ethyca/fides/compare/2.32.0...2.33.0)

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
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved

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
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved
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,
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved
)
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}
Loading