Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Revert "SaaS Connector Template Creation Fix: Integer fides_key (#1166)…
Browse files Browse the repository at this point in the history
…" (#1171)

This reverts commit 28b6317.
  • Loading branch information
Sean Preston authored Aug 26, 2022
1 parent 2415e78 commit 26bcb80
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 49 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ The types of changes are:
* Foundations for a new email connector type [#1142](https://github.com/ethyca/fidesops/pull/1142)


### Fixed
* Accounts for integer "instance_fides_keys" when creating a saas connector from a template [#1166](https://github.com/ethyca/fidesops/pull/1166)


## [1.7.1](https://github.com/ethyca/fidesops/compare/1.7.0...1.7.1)

### Added
Expand Down
4 changes: 2 additions & 2 deletions src/fidesops/ops/util/saas_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def load_config_with_replacement(
) -> Dict:
"""Loads the saas config from the yaml file and replaces any string with the given value"""
yaml_str: str = load_yaml_as_string(filename).replace(
string_to_replace, f'"{replacement}"'
string_to_replace, replacement
)
return yaml.safe_load(yaml_str).get("saas_config", [])

Expand All @@ -55,7 +55,7 @@ def load_dataset_with_replacement(
) -> Dict:
"""Loads the dataset from the yaml file and replaces any string with the given value"""
yaml_str: str = load_yaml_as_string(filename).replace(
string_to_replace, f'"{replacement}"'
string_to_replace, replacement
)
return yaml.safe_load(yaml_str).get("dataset", [])

Expand Down
43 changes: 0 additions & 43 deletions tests/ops/api/v1/endpoints/test_connection_template_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,43 +503,6 @@ def test_dataset_config_saving_fails(
).first()
assert dataset_config is None

def test_instantiate_connection_from_template_integer_key(
self, db, generate_auth_header, api_client, base_url
):
auth_header = generate_auth_header(scopes=[SAAS_CONNECTION_INSTANTIATE])
request_body = {
"instance_key": "111",
"secrets": {
"domain": "test_mailchimp_domain",
"username": "test_mailchimp_username",
"api_key": "test_mailchimp_api_key",
},
"name": "Mailchimp Connector",
"description": "Mailchimp ConnectionConfig description",
"key": "mailchimp_connection_config",
}
resp = api_client.post(
base_url.format(saas_connector_type="mailchimp"),
headers=auth_header,
json=request_body,
)

connection_config = ConnectionConfig.filter(
db=db, conditions=(ConnectionConfig.key == "mailchimp_connection_config")
).first()
dataset_config = DatasetConfig.filter(
db=db,
conditions=(DatasetConfig.fides_key == "111"),
).first()

saas_config_fides_key = connection_config.saas_config["fides_key"]
dataset_fides_key = dataset_config.fides_key
embedded_dataset_fides_key = dataset_config.dataset["fides_key"]

assert saas_config_fides_key == dataset_fides_key == embedded_dataset_fides_key
dataset_config.delete(db)
connection_config.delete(db)

def test_instantiate_connection_from_template(
self, db, generate_auth_header, api_client, base_url
):
Expand Down Expand Up @@ -606,11 +569,5 @@ def test_instantiate_connection_from_template(
assert dataset_config.connection_config_id == connection_config.id
assert dataset_config.dataset is not None

saas_config_fides_key = connection_config.saas_config["fides_key"]
dataset_fides_key = dataset_config.fides_key
embedded_dataset_fides_key = dataset_config.dataset["fides_key"]

assert saas_config_fides_key == dataset_fides_key == embedded_dataset_fides_key

dataset_config.delete(db)
connection_config.delete(db)

0 comments on commit 26bcb80

Please sign in to comment.