Skip to content

feat(ibis): Snowflake key-pair authentication support #1230

Merged
goldmedal merged 2 commits intoCanner:mainfrom
douenergy:snowflake-key-pair-auth
Jun 23, 2025
Merged

feat(ibis): Snowflake key-pair authentication support #1230
goldmedal merged 2 commits intoCanner:mainfrom
douenergy:snowflake-key-pair-auth

Conversation

@douenergy
Copy link
Copy Markdown
Contributor

@douenergy douenergy commented Jun 23, 2025

Snowflake is deprecating password-based login (non mfa) in 2025. This PR adds support for key pair authentication to align with upcoming requirements.

Snowflake security mfa rollout

Summary by CodeRabbit

  • New Features

    • Updated Snowflake connection to support private key authentication and require warehouse specification.
  • Tests

    • Modified test configurations to use private key authentication and warehouse selection instead of password-based authentication.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jun 23, 2025

Walkthrough

The changes update Snowflake connection handling by removing password-based authentication in favor of required warehouse and optional private key fields. Corresponding adjustments are made in model definitions, connection logic, and test configurations to support private key authentication and warehouse specification, replacing previous password usage.

Changes

Files/Paths Change Summary
ibis-server/app/model/init.py Modified SnowflakeConnectionInfo: removed password, added required warehouse and optional private_key.
ibis-server/app/model/data_source.py Updated get_snowflake_connection to use warehouse and private_key instead of password.
ibis-server/tests/routers/v2/connector/test_snowflake.py,
ibis-server/tests/routers/v3/connector/snowflake/conftest.py
Updated test connection info: removed password, added warehouse and private_key (from env variable).

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Suite
    participant Model as SnowflakeConnectionInfo
    participant DataSource as DataSourceExtension
    participant Snowflake as Snowflake DB

    Test->>Model: Provide connection_info (warehouse, private_key)
    Model->>DataSource: Pass connection_info
    DataSource->>Snowflake: Connect using warehouse and private_key
    Snowflake-->>DataSource: Connection established
    DataSource-->>Test: Connection result
Loading

Suggested reviewers

  • goldmedal

Poem

A hop, a skip, a Snowflake leap,
Passwords gone, no secrets to keep.
Warehouses ready, keys in paw,
Rabbits code with perfect law.
Connections strong, tests now run,
Private keys—secure and fun! 🐇🔑


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2861c0f and 36ac031.

📒 Files selected for processing (1)
  • ibis-server/app/model/data_source.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • ibis-server/app/model/data_source.py
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added ibis python Pull requests that update Python code labels Jun 23, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
ibis-server/app/model/data_source.py (1)

229-229: Use {} instead of dict() for empty dictionary

Apply this diff to follow Python best practices:

-            else dict(),
+            else {},
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28bb407 and 2861c0f.

📒 Files selected for processing (4)
  • ibis-server/app/model/__init__.py (1 hunks)
  • ibis-server/app/model/data_source.py (1 hunks)
  • ibis-server/tests/routers/v2/connector/test_snowflake.py (1 hunks)
  • ibis-server/tests/routers/v3/connector/snowflake/conftest.py (1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
ibis-server/app/model/data_source.py

[refactor] 229-229: Consider using '{}' instead of a call to 'dict'.

(R1735)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci
🔇 Additional comments (3)
ibis-server/tests/routers/v3/connector/snowflake/conftest.py (1)

20-27: LGTM!

The test fixture correctly updates to use the new authentication approach with warehouse specification and private key from environment variable.

ibis-server/tests/routers/v2/connector/test_snowflake.py (1)

13-20: LGTM!

The connection info updates are consistent with the v3 test configuration and align with the new authentication approach.

ibis-server/app/model/__init__.py (1)

299-306: LGTM!

The model correctly defines the new connection schema with required warehouse and optional private key fields, properly supporting the key-pair authentication approach.

Copy link
Copy Markdown
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

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

Thanks @douenergy. 👍

@goldmedal goldmedal merged commit 2f38f11 into Canner:main Jun 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ibis python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants