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

Add support for "Key-pair" authentication to Snowflake integration #5079

Conversation

andres-torres-marroquin
Copy link
Contributor

@andres-torres-marroquin andres-torres-marroquin commented Jul 11, 2024

Closes #PROD-2140

Description Of Changes

Add support for Key-Pair authentication to the SnowflakeConnector, so it now allows a couple fields to the SnowflakeSchema: private_key and private_key_passphrase.

Code Changes

  • Added a couple fields to the SnowflakeSchema: private_key and private_key_passphrase.
  • Added some logic to the SQLConnector so now connect_args can be passed down to SQLConnector.create_client through the new SQLConnector.get_connect_args() method.
  • Added SnowflakeSchema.get_connect_args() so it now takes the private_key and decrypts it if private_key_passphrase was defined as well.
  • Updated tests so they are ran in password mode and private_key mode.

Steps to Confirm

  • Add a Snowflake Integration with private_key.

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation:
    • documentation complete, PR opened in fidesdocs
    • documentation issue created in fidesdocs
    • if there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md
  • For API changes, the Postman collection has been updated
  • If there are any database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!

Copy link

vercel bot commented Jul 11, 2024

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) Visit Preview Jul 18, 2024 7:29pm

Copy link

cypress bot commented Jul 11, 2024

Passing run #9002 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge a154ff5 into 2c99458...
Project: fides Commit: 1eab4eb436 ℹ️
Status: Passed Duration: 00:36 💡
Started: Jul 18, 2024 7:40 PM Ended: Jul 18, 2024 7:41 PM

Review all test suite changes for PR #5079 ↗︎

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 40.54054% with 22 lines in your changes missing coverage. Please review.

Project coverage is 86.43%. Comparing base (51d7b88) to head (65a5741).

Files Patch % Lines
...tion_configuration/connection_secrets_snowflake.py 42.85% 9 Missing and 3 partials ⚠️
src/fides/api/service/connectors/sql_connector.py 37.50% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5079      +/-   ##
==========================================
- Coverage   86.51%   86.43%   -0.08%     
==========================================
  Files         357      357              
  Lines       22310    22344      +34     
  Branches     2947     2952       +5     
==========================================
+ Hits        19301    19313      +12     
- Misses       2495     2514      +19     
- Partials      514      517       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

thanks for getting a solid starting approach in place! here's a few initial comments, haven't had a chance to fully review yet.

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

@andres-torres-marroquin generally looking good to me, I'd just like to get the key parsing bit sorted and removed ideally - it feels like it shouldn't be necessary, but maybe there's a nuance there I'm not aware of.

also - have you done any manual testing? we'd like to be extra sure here that this is working as we expect end to end. if you have, pasting some steps and/or screenshots would be helpful - if the screenshots are at all sensitive, feel free to paste it to the jira ticket.

Co-authored-by: Adam Sachs <adam@ethyca.com>
…ey-pair-authentication-to-snowflake-integration
Comment on lines +158 to +163
@pytest.fixture(
params=[
"snowflake_connection_config",
"snowflake_connection_config_with_keypair",
]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Clever!

Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

@andres-torres-marroquin and I verified both authentication methods from the Admin UI. I just called out the need for error handling around missing passphrases for encrypted private keys but we're following up with that in a separate ticket.

@andres-torres-marroquin andres-torres-marroquin merged commit 09289b2 into main Jul 18, 2024
43 checks passed
@andres-torres-marroquin andres-torres-marroquin deleted the PROD-2140-grange-insurance-add-support-for-key-pair-authentication-to-snowflake-integration branch July 18, 2024 19:45
andres-torres-marroquin added a commit that referenced this pull request Jul 18, 2024
Copy link

cypress bot commented Jul 18, 2024

Passing run #9003 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Add support for "Key-pair" authentication to Snowflake integration (#5079)
Project: fides Commit: 09289b2b3b
Status: Passed Duration: 00:34 💡
Started: Jul 18, 2024 7:56 PM Ended: Jul 18, 2024 7:56 PM

Review all test suite changes for PR #5079 ↗︎

@cypress cypress bot mentioned this pull request Jul 18, 2024
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants