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

Fides con 122 simon data erasure connector #4552

Merged
merged 20 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved

### 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)
Expand Down
40 changes: 40 additions & 0 deletions data/saas/config/simon_data_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
saas_config:
fides_key: <instance_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
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved
label: API token
sensitive: True

client_config:
protocol: https
host: <domain>
authentication:
strategy: bearer
configuration:
token: <api_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": "<email>"
}
param_values:
- name: email
identity: email
7 changes: 7 additions & 0 deletions data/saas/dataset/simon_data_dataset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dataset:
- fides_key: <instance_fides_key>
name: Simon Data
description: A sample dataset representing the Simon Data connector for Fides
collections:
- name: contact
fields: []
14 changes: 14 additions & 0 deletions data/saas/icon/simon_data.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions tests/fixtures/saas/simon_data_fixtures.py
Original file line number Diff line number Diff line change
@@ -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 {}
MarcGEthyca marked this conversation as resolved.
Show resolved Hide resolved


@pytest.fixture
def simon_data_runner(
db,
cache,
simon_data_secrets,
) -> ConnectorRunner:
return ConnectorRunner(
db,
cache,
"simon_data",
simon_data_secrets,
)
28 changes: 28 additions & 0 deletions tests/ops/integration_tests/saas/test_simon_data_task.py
Original file line number Diff line number Diff line change
@@ -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}
Loading