Skip to content

Conversation

@mansfieldj3
Copy link
Contributor

This change enables users to configure proxy settings directly in Snowflake connections via extra parameters instead of relying solely on system environment variables, providing better isolation and control.

What changes:

  • Add proxy_host, proxy_port, proxy_user, and proxy_password fields to SnowflakeHook connection configuration
  • Proxy parameters are extracted from connection extras and passed to snowflake.connector.connect()
  • UI fields added for proxy configuration in connection form
  • Support for both modern field names and backcompat prefixes

Why:

  • Enables team-specific proxy configurations without affecting system-wide settings
  • Prevents unintended proxy usage from environment variables
  • Provides more granular control over network routing per connection

Tests:

  • test_get_conn_params_with_proxy_host_only
  • test_get_conn_params_with_proxy_host_and_port
  • test_get_conn_params_with_proxy_port_as_int
  • test_get_conn_params_with_proxy_full_config
  • test_get_conn_params_with_proxy_backcompat_prefix
  • test_get_conn_with_proxy_should_call_connect

Closes: #59078

@mansfieldj3 mansfieldj3 requested a review from potiuk as a code owner January 12, 2026 21:40
@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels Jan 12, 2026
@mansfieldj3
Copy link
Contributor Author

mansfieldj3 commented Jan 12, 2026

Reformatting of previous merge which was closed without being added

@mansfieldj3
Copy link
Contributor Author

New merge request should resolve previous static errors and issue with using conn_params = hook._get_conn_params not conn_params = hook._get_conn_params()

@mansfieldj3
Copy link
Contributor Author

somehow managed to only delete one of two trailing spaces on line 439 :|

@mansfieldj3
Copy link
Contributor Author

@potiuk can you review out this request when you get the chance? Reasonably simple change to add proxy support to the snowflake hook but if you have any suggestions let me know

@potiuk
Copy link
Member

potiuk commented Jan 21, 2026

You should make sure if proxy_password is masked automaticall when logging connection - look at our secrets masker - I am not sure if "proxy_password" will be redacted automatically by password substring in the name, or whether you need to update the default fields to contain proxy_password or maybe implement partial match when masking values.

@mansfieldj3
Copy link
Contributor Author

I've added proxy_password to the default DEFAULT_SENSITIVE_FIELDS variables in secret masker, I think because it had both proxy and password in the name it probably would have been masked but given how complex the logic is I'd rather play it safe and remove if not needed.

@potiuk
Copy link
Member

potiuk commented Jan 21, 2026

given how complex the logic is I'd rather play it safe and remove if not needed.

Yeah

@potiuk potiuk merged commit a47b69e into apache:main Jan 21, 2026
89 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 21, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

suii2210 pushed a commit to suii2210/airflow that referenced this pull request Jan 26, 2026
* reformat add proxy support commit

* static errors fix, fixes get_conn_params() causing method is not subscriptable error

* static

* add proxy_password as default sensitive field
shreyas-dev pushed a commit to shreyas-dev/airflow that referenced this pull request Jan 29, 2026
* reformat add proxy support commit

* static errors fix, fixes get_conn_params() causing method is not subscriptable error

* static

* add proxy_password as default sensitive field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add proxy support for Snowflake Connections

2 participants