Skip to content

Commit

Permalink
Remove DatasetConfig.dataset field + New Get DatasetConfig Endpoints [#…
Browse files Browse the repository at this point in the history
…1763] (#2096)

- Remove the DatasetConfig.dataset column
- Throw a 404 if the ctl_dataset_id does not existing when creating a DatasetConfig through the new patch_dataset_configs endpoint
- Add new GET datasetconfig list and detail endpoints that include both the fides_key and nested ctl_dataset in the response.  The DatasetConfig and CTLDataset are different resources and their fides_keys can differ, so both keys need to be in the response.
-  Add a fix to prevent existing upsert from attempting to update the id of an existing resource. Datasets are referenced by DatasetConfigs now, we need them to stay the same.
- Add more validation before linking an existing CTL Dataset to a DatasetConfig
- Update the Ops DatasetConfig Admin UI for parity with existing UI

Co-authored-by: Allison King <[email protected]>
  • Loading branch information
pattisdr and allisonking authored Dec 23, 2022
1 parent 21c46f4 commit e6ad6b3
Show file tree
Hide file tree
Showing 80 changed files with 1,934 additions and 229 deletions.
3 changes: 0 additions & 3 deletions .fides/db_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,6 @@ dataset:
- name: created_at
data_categories: [system.operations]
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: dataset
data_categories: [system.operations]
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: fides_key
data_categories: [system.operations]
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
Expand Down
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ The types of changes are:

* Include a pre-check workflow that collects the pytest suite [#2098](https://github.com/ethyca/fides/pull/2098)

### Changed

* Move the `fides.ctl.core.` and `fides.ctl.connectors` modules into `fides.core` and `fides.connectors` respectively [#2097](https://github.com/ethyca/fides/pull/2097)
* Fides: Skip cypress tests due to nav bar 2.0 [#2102](https://github.com/ethyca/fides/pull/2103)

### Added
* Adds new erasure policy for complete user data masking [#1839](https://github.com/ethyca/fides/pull/1839)
* New Fides Home page [#1864](https://github.com/ethyca/fides/pull/2050)
Expand All @@ -34,8 +29,11 @@ The types of changes are:
* Added ability to use Mailgun templates when sending emails. [#2039](https://github.com/ethyca/fides/pull/2039)

### Changed
* Move the `fides.ctl.core.` and `fides.ctl.connectors` modules into `fides.core` and `fides.connectors` respectively [#2097](https://github.com/ethyca/fides/pull/2097)
* Fides: Skip cypress tests due to nav bar 2.0 [#2102](https://github.com/ethyca/fides/pull/2103)
* Remove several fidesops schemas for DSR's in favor of updated Fideslang schemas [#2009](https://github.com/ethyca/fides/pull/2009)
* New datasetconfig.ctl_dataset_id field to unify fides dataset resources [#2046](https://github.com/ethyca/fides/pull/2046)
* Update UI dataset config routes to use new unified routes [#2113](https://github.com/ethyca/fides/pull/2113)


## [2.3.1](https://github.com/ethyca/fides/compare/2.3.0...2.3.1)
Expand Down
74 changes: 74 additions & 0 deletions clients/admin-ui/cypress/e2e/connectors.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
describe("Connectors", () => {
beforeEach(() => {
cy.login();
});
describe("Configuring connectors", () => {
beforeEach(() => {
cy.intercept("GET", "/api/v1/connection*", {
fixture: "connectors/list.json",
}).as("getConnectors");
cy.intercept("GET", "/api/v1/connection_type*", {
fixture: "connectors/connection_types.json",
}).as("getConnectionTypes");
cy.intercept("GET", "/api/v1/connection/postgres_connector", {
fixture: "connectors/postgres_connector.json",
}).as("getPostgresConnector");
cy.intercept("GET", "/api/v1/connection_type/postgres/secret", {
fixture: "connectors/postgres_secret.json",
}).as("getPostgresConnectorSecret");
cy.intercept(
"GET",
"/api/v1/connection/postgres_connector/datasetconfig",
{
fixture: "connectors/datasetconfig.json",
}
).as("getPostgresConnectorDatasetconfig");

cy.intercept("POST", "/api/v1/dataset/upsert", { body: {} }).as(
"upsertDataset"
);
cy.intercept(
"PATCH",
"/api/v1/connection/postgres_connector/datasetconfig",
{ body: {} }
).as("patchDatasetconfig");
});

it("Should show data store connections and view configuration", () => {
cy.visit("/datastore-connection");
cy.getByTestId("connection-grid-item-mongodb_connector");
cy.getByTestId("connection-grid-item-postgres_connector").within(() => {
cy.getByTestId("connection-menu-btn").click();
});
cy.getByTestId("connection-menu-postgres_connector").within(() => {
cy.getByTestId("configure-btn").click();
});
cy.getByTestId("input-name").should("have.value", "postgres_connector");
});

it("Should allow saving a dataset configuration", () => {
cy.visit("/datastore-connection/postgres_connector");
cy.getByTestId("tab-Dataset configuration").click();
cy.wait("@getPostgresConnectorDatasetconfig");
// The monaco yaml editor takes a bit to load. Since this is likely going away,
// just wait for now and remove this once the yaml editor is no longer available
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.getByTestId("save-btn").click();
cy.wait("@upsertDataset").then((interception) => {
expect(interception.request.body.length).to.eql(1);
expect(interception.request.body[0].fides_key).to.eql(
"postgres_example_test_dataset"
);
});
cy.wait("@patchDatasetconfig").then((interception) => {
expect(interception.request.body).to.eql([
{
fides_key: "postgres_example_test_dataset",
ctl_dataset_fides_key: "postgres_example_test_dataset",
},
]);
});
});
});
});
67 changes: 67 additions & 0 deletions clients/admin-ui/cypress/fixtures/connectors/connection_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"items": [
{
"identifier": "bigquery",
"type": "database",
"human_readable": "BigQuery",
"encoded_icon": null
},
{
"identifier": "mariadb",
"type": "database",
"human_readable": "MariaDB",
"encoded_icon": null
},
{
"identifier": "mongodb",
"type": "database",
"human_readable": "MongoDB",
"encoded_icon": null
},
{
"identifier": "mssql",
"type": "database",
"human_readable": "Microsoft SQL Server",
"encoded_icon": null
},
{
"identifier": "mysql",
"type": "database",
"human_readable": "MySQL",
"encoded_icon": null
},
{
"identifier": "postgres",
"type": "database",
"human_readable": "PostgreSQL",
"encoded_icon": null
},
{
"identifier": "redshift",
"type": "database",
"human_readable": "Amazon Redshift",
"encoded_icon": null
},
{
"identifier": "snowflake",
"type": "database",
"human_readable": "Snowflake",
"encoded_icon": null
},
{
"identifier": "timescale",
"type": "database",
"human_readable": "TimescaleDB",
"encoded_icon": null
},
{
"identifier": "manual_webhook",
"type": "manual",
"human_readable": "Manual Webhook",
"encoded_icon": null
}
],
"total": 10,
"page": 1,
"size": 50
}
Loading

0 comments on commit e6ad6b3

Please sign in to comment.