-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Iterable Erasure Integration (#4695)
Co-authored-by: Adrian Galvan <[email protected]>
- Loading branch information
1 parent
9c5dd34
commit 479a353
Showing
6 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
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,7 @@ | ||
dataset: | ||
- fides_key: <instance_fides_key> | ||
name: iterable | ||
description: A sample dataset representing the Iterable connector for Fides | ||
collections: | ||
- name: user | ||
fields: [] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,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, | ||
) |
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,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} |