Skip to content

Commit

Permalink
Removing saas_config.toml (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
galvana authored Aug 8, 2022
1 parent 9d7326b commit b550c8c
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 142 deletions.
80 changes: 0 additions & 80 deletions saas_config.toml

This file was deleted.

6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/adobe_campaign_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pydash
import pytest
import requests
from fideslib.core.config import load_toml
from fideslib.cryptography import cryptographic_util
from sqlalchemy.orm import Session

Expand All @@ -17,12 +16,11 @@
from tests.ops.fixtures.application_fixtures import load_dataset
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("adobe_campaign")


@pytest.fixture(scope="function")
def adobe_campaign_secrets():
def adobe_campaign_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "adobe_campaign.domain") or secrets["domain"],
"organization_id": pydash.get(saas_config, "adobe_campaign.organization_id")
Expand All @@ -39,7 +37,7 @@ def adobe_campaign_secrets():


@pytest.fixture(scope="function")
def adobe_campaign_identity_email():
def adobe_campaign_identity_email(saas_config):
return (
pydash.get(saas_config, "adobe_campaign.identity_email")
or secrets["identity_email"]
Expand Down
16 changes: 7 additions & 9 deletions tests/ops/fixtures/saas/auth0_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pydash
import pytest
import requests
from fideslib.core.config import load_toml
from fideslib.cryptography import cryptographic_util
from fideslib.db import session
from sqlalchemy.orm import Session
Expand All @@ -20,17 +19,11 @@
from tests.ops.test_helpers.saas_test_utils import poll_for_existence
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("auth0")


@pytest.fixture(scope="session")
def auth0_erasure_identity_email():
return f"{cryptographic_util.generate_secure_random_string(13)}@email.com"


@pytest.fixture(scope="function")
def auth0_secrets():
def auth0_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "auth0.domain") or secrets["domain"],
"access_token": pydash.get(saas_config, "auth0.access_token")
Expand All @@ -39,10 +32,15 @@ def auth0_secrets():


@pytest.fixture(scope="function")
def auth0_identity_email():
def auth0_identity_email(saas_config):
return pydash.get(saas_config, "auth0.identity_email") or secrets["identity_email"]


@pytest.fixture(scope="session")
def auth0_erasure_identity_email():
return f"{cryptographic_util.generate_secure_random_string(13)}@email.com"


@pytest.fixture
def auth0_config() -> Dict[str, Any]:
return load_config("data/saas/config/auth0_config.yml")
Expand Down
6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/hubspot_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pydash
import pytest
from fideslib.core.config import load_toml
from fideslib.cryptography import cryptographic_util
from sqlalchemy.orm import Session

Expand All @@ -20,22 +19,21 @@
from tests.ops.test_helpers.saas_test_utils import poll_for_existence
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("hubspot")

HUBSPOT_FIRSTNAME = "SomeoneFirstname"


@pytest.fixture(scope="session")
def hubspot_secrets():
def hubspot_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "hubspot.domain") or secrets["domain"],
"hapikey": pydash.get(saas_config, "hubspot.hapikey") or secrets["hapikey"],
}


@pytest.fixture(scope="function")
def hubspot_identity_email():
def hubspot_identity_email(saas_config):
return (
pydash.get(saas_config, "hubspot.identity_email") or secrets["identity_email"]
)
Expand Down
6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/mailchimp_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pydash
import pytest
from fideslib.core.config import load_toml
from fideslib.db import session
from sqlalchemy.orm import Session

Expand All @@ -19,12 +18,11 @@
from tests.ops.fixtures.application_fixtures import load_dataset
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("mailchimp")


@pytest.fixture(scope="session")
def mailchimp_secrets():
def mailchimp_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "mailchimp.domain") or secrets["domain"],
"username": pydash.get(saas_config, "mailchimp.username")
Expand All @@ -34,7 +32,7 @@ def mailchimp_secrets():


@pytest.fixture(scope="session")
def mailchimp_identity_email():
def mailchimp_identity_email(saas_config):
return (
pydash.get(saas_config, "mailchimp.identity_email") or secrets["identity_email"]
)
Expand Down
6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/outreach_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pydash
import pytest
import requests
from fideslib.core.config import load_toml
from fideslib.cryptography import cryptographic_util
from fideslib.db import session
from sqlalchemy.orm import Session
Expand All @@ -18,12 +17,11 @@
from tests.ops.fixtures.application_fixtures import load_dataset
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("outreach")


@pytest.fixture(scope="session")
def outreach_secrets():
def outreach_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "outreach.domain") or secrets["domain"],
"requester_email": pydash.get(saas_config, "outreach.requester_email")
Expand All @@ -40,7 +38,7 @@ def outreach_secrets():


@pytest.fixture(scope="session")
def outreach_identity_email():
def outreach_identity_email(saas_config):
return (
pydash.get(saas_config, "outreach.identity_email") or secrets["identity_email"]
)
Expand Down
6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/salesforce_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pydash
import pytest
import requests
from fideslib.core.config import load_toml
from fideslib.cryptography import cryptographic_util
from fideslib.db import session
from sqlalchemy.orm import Session
Expand All @@ -19,12 +18,11 @@
from tests.ops.fixtures.application_fixtures import load_dataset
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("salesforce")


@pytest.fixture(scope="session")
def salesforce_secrets():
def salesforce_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "salesforce.domain") or secrets["domain"],
"username": pydash.get(saas_config, "salesforce.username")
Expand All @@ -41,7 +39,7 @@ def salesforce_secrets():


@pytest.fixture(scope="session")
def salesforce_identity_email():
def salesforce_identity_email(saas_config):
return (
pydash.get(saas_config, "salesforce.identity_email")
or secrets["identity_email"]
Expand Down
6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/segment_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest
import requests
from faker import Faker
from fideslib.core.config import load_toml
from fideslib.db import session
from sqlalchemy.orm import Session

Expand All @@ -21,12 +20,11 @@
from tests.ops.test_helpers.saas_test_utils import poll_for_existence
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("segment")


@pytest.fixture(scope="session")
def segment_secrets():
def segment_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "segment.domain") or secrets["domain"],
"personas_domain": pydash.get(saas_config, "segment.personas_domain")
Expand All @@ -47,7 +45,7 @@ def segment_secrets():


@pytest.fixture(scope="session")
def segment_identity_email():
def segment_identity_email(saas_config):
return (
pydash.get(saas_config, "segment.identity_email") or secrets["identity_email"]
)
Expand Down
16 changes: 7 additions & 9 deletions tests/ops/fixtures/saas/sendgrid_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pydash
import pytest
import requests
from fideslib.core.config import load_toml
from fideslib.cryptography import cryptographic_util
from fideslib.db import session
from sqlalchemy.orm import Session
Expand All @@ -20,32 +19,31 @@
from tests.ops.test_helpers.saas_test_utils import poll_for_existence
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("sendgrid")

SENDGRID_ERASURE_FIRSTNAME = "Erasurefirstname"


@pytest.fixture(scope="session")
def sendgrid_erasure_identity_email():
return f"{cryptographic_util.generate_secure_random_string(13)}@email.com"


@pytest.fixture(scope="function")
def sendgrid_secrets():
def sendgrid_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "sendgrid.domain") or secrets["domain"],
"api_key": pydash.get(saas_config, "sendgrid.api_key") or secrets["api_key"],
}


@pytest.fixture(scope="function")
def sendgrid_identity_email():
def sendgrid_identity_email(saas_config):
return (
pydash.get(saas_config, "sendgrid.identity_email") or secrets["identity_email"]
)


@pytest.fixture(scope="session")
def sendgrid_erasure_identity_email():
return f"{cryptographic_util.generate_secure_random_string(13)}@email.com"


@pytest.fixture
def sendgrid_config() -> Dict[str, Any]:
return load_config("data/saas/config/sendgrid_config.yml")
Expand Down
6 changes: 2 additions & 4 deletions tests/ops/fixtures/saas/sentry_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pydash
import pytest
from fideslib.core.config import load_toml
from fideslib.db import session
from sqlalchemy.orm import Session

Expand All @@ -16,12 +15,11 @@
from tests.ops.fixtures.application_fixtures import load_dataset
from tests.ops.test_helpers.vault_client import get_secrets

saas_config = load_toml(["saas_config.toml"])
secrets = get_secrets("sentry")


@pytest.fixture(scope="session")
def sentry_secrets():
def sentry_secrets(saas_config):
return {
"domain": pydash.get(saas_config, "sentry.domain") or secrets["sentry.domain"],
"access_token": pydash.get(saas_config, "sentry.access_token")
Expand All @@ -40,7 +38,7 @@ def sentry_secrets():


@pytest.fixture(scope="session")
def sentry_identity_email():
def sentry_identity_email(saas_config):
return pydash.get(saas_config, "sentry.identity_email") or secrets["identity_email"]


Expand Down
Loading

0 comments on commit b550c8c

Please sign in to comment.