ethyca / fides

The Privacy Engineering & Compliance Framework
https://ethyca.com/docs
Apache License 2.0
360 stars 72 forks source link

Adding namespace support for Snowflake #5486

Closed galvana closed 1 week ago

galvana commented 1 week ago

Closes LA-120

Description Of Changes

Updates the SnowflakeConnector to use a namespaced query config. This allows queries to specify the correct database name and schema without relying on these values from the connectionconfig.

Code Changes

Steps to Confirm

Load datasets

  1. Start the Fides webserver, Admin UI, and Privacy Center.
  2. Navigate to Data inventory > Manage datasets and click on Add dataset. Upload these datasets snowflake_example_test_dataset.txt and snowflake_example_test_dataset_with_namespace.txt.

Configure integration

  1. Navigate to Data inventory > Add systems and click on Add a system.
  2. Name it Snowflake and hit Save.
  3. Navigate to the Integrations tab and select Snowflake from the drop down. Add the credentials from 1password (it's ok to skip Private key, Passphrase, and Role).
  4. Test the integration.
  5. Link the snowflake_example_test_dataset to the integration.

Run tests

  1. Submit an access request via the Privacy Center for identity customer-1@example.com. Approve the request and verify it is successful. This is the existing functionality.
  2. Navigate back to the Snowflake integration and delete Database and Schema, hit Save. Submit another privacy request, it should fail this time.
  3. Unlink the snowflake_example_test_dataset and link snowflake_example_test_dataset_with_namespace, hit Save. Submit another request, the request should use the namespace values and succeed.

Pre-Merge Checklist

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **fides-plus-nightly** | ⬜️ Ignored ([Inspect](https://vercel.com/ethyca/fides-plus-nightly/Exe3rW2TzAZDZ4YqeyVZUKsKTvWq)) | [Visit Preview](https://fides-plus-nightly-git-la-120-add-namespace-suppo-5641cb-ethyca.vercel.app) | | Nov 14, 2024 7:32pm |
cypress[bot] commented 1 week ago

fides    Run #11008

Run Properties:  status check passed Passed #11008  •  git commit 0f77bdd5a8 ℹ️: Merge 649e6f0f047418813371c37e2b8604517bd5fdda into 52ac3301bef835ab4671d258eb80...
Project fides
Branch Review refs/pull/5486/merge
Run status status check passed Passed #11008
Run duration 00m 37s
Commit git commit 0f77bdd5a8 ℹ️: Merge 649e6f0f047418813371c37e2b8604517bd5fdda into 52ac3301bef835ab4671d258eb80...
Committer Adrian Galvan
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 52.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 85.18%. Comparing base (d14d031) to head (48b63eb). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/fides/api/service/connectors/query_config.py 23.07% 10 Missing :warning:
src/fides/api/service/connectors/sql_connector.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5486 +/- ## ========================================== - Coverage 85.20% 85.18% -0.03% ========================================== Files 386 387 +1 Lines 24247 24265 +18 Branches 2644 2646 +2 ========================================== + Hits 20660 20669 +9 - Misses 3033 3042 +9 Partials 554 554 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

eastandwestwind commented 1 week ago

Can you add a Changelog row as well @galvana?

cypress[bot] commented 1 week ago

fides    Run #11009

Run Properties:  status check passed Passed #11009  •  git commit 77e87be5fe: Adding namespace support for Snowflake (#5486)
Project fides
Branch Review main
Run status status check passed Passed #11009
Run duration 00m 38s
Commit git commit 77e87be5fe: Adding namespace support for Snowflake (#5486)
Committer Adrian Galvan
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎