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

Remove SaaS type enum #1197

Merged
merged 6 commits into from
Oct 4, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ The types of changes are:
* Changed behavior of `load_default_taxonomy` to append instead of upsert [#1040](https://github.com/ethyca/fides/pull/1040)
* Changed behavior of adding privacy declarations to decouple the actions of the "add" and "next" buttons [#1086](https://github.com/ethyca/fides/pull/1086)
* Moved system related UI components from the `config-wizard` directory to the `system` directory [#1097](https://github.com/ethyca/fides/pull/1097)
* Updated "type" on SaaS config to be a simple string type, not an enum [#1197](https://github.com/ethyca/fides/pull/1197)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we updating CHANGELOG's for now, while we are still merging over? i assume so...


### Developer Experience

Expand Down
11 changes: 5 additions & 6 deletions src/fides/api/ops/api/v1/endpoints/connection_type_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ConnectionSystemTypeMap,
SystemType,
)
from fides.api.ops.schemas.saas.saas_config import SaaSConfig, SaaSType
from fides.api.ops.schemas.saas.saas_config import SaaSConfig
from fides.api.ops.service.connectors.saas.connector_registry_service import (
ConnectorRegistry,
load_registry,
Expand Down Expand Up @@ -71,14 +71,14 @@ def is_match(elem: str) -> bool:
]
)
if system_type == SystemType.saas or system_type is None:
registry: ConnectorRegistry = load_registry(registry_file)
saas_types: List[str] = sorted(
[
saas_type.value
for saas_type in SaaSType
if saas_type != SaaSType.custom and is_match(saas_type.value)
saas_type
for saas_type in registry.connector_types()
if is_match(saas_type)
]
)
registry: ConnectorRegistry = load_registry(registry_file)

for item in saas_types:
human_readable_name: str = item
Expand Down Expand Up @@ -114,7 +114,6 @@ def is_match(elem: str) -> bool:
for item in manual_types
]
)

return connection_system_types


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from fides.api.ops.schemas.api import BulkResponse, BulkUpdateFailed
from fides.api.ops.schemas.connection_configuration import connection_secrets_schemas
from fides.api.ops.schemas.dataset import FidesopsDataset
from fides.api.ops.schemas.saas.saas_config import SaaSConfigBase, SaaSType
from fides.api.ops.schemas.saas.saas_config import SaaSConfigBase
from fides.api.ops.schemas.shared_schemas import FidesOpsKey


Expand Down Expand Up @@ -60,7 +60,7 @@ class ConnectionSystemTypeMap(BaseModel):
Describes the returned schema for connection types
"""

identifier: Union[ConnectionType, SaaSType]
identifier: Union[ConnectionType, str]
type: SystemType
human_readable: str

Expand Down
28 changes: 1 addition & 27 deletions src/fides/api/ops/schemas/saas/saas_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from enum import Enum
from typing import Any, Dict, List, Literal, Optional, Set, Union

from pydantic import BaseModel, Extra, root_validator, validator
Expand Down Expand Up @@ -243,39 +242,14 @@ def validate_connector_param(cls, values: Dict[str, Any]) -> Dict[str, Any]:
return values


class SaaSType(Enum):
"""
Enum to store saas connection type in Fidesops
"""

adobe_campaign = "adobe_campaign"
auth0 = "auth0"
braze = "braze"
custom = "custom"
datadog = "datadog"
firebase_auth = "firebase_auth"
hubspot = "hubspot"
mailchimp = "mailchimp"
outreach = "outreach"
rollbar = "rollbar"
salesforce = "salesforce"
segment = "segment"
sendgrid = "sendgrid"
sentry = "sentry"
shopify = "shopify"
square = "square"
stripe = "stripe"
zendesk = "zendesk"


class SaaSConfigBase(BaseModel):
"""
Used to store base info for a saas config
"""

fides_key: FidesOpsKey
name: str
type: SaaSType
type: str

@property
def fides_key_prop(self) -> FidesOpsKey:
Expand Down
Loading