Vamsi-klu opened a new pull request, #68527:
URL: https://github.com/apache/airflow/pull/68527
Add explicit proxy support for Databricks connections.
## What changed
This adds a documented `proxies` connection extra for the Databricks
provider. The extra is intentionally allowlisted and only accepts `http` and
`https` keys, for example:
```json
{
"proxies": {
"http": "http://proxy.example.com:8080",
"https": "http://proxy.example.com:8443"
}
}
```
The configured proxy is applied to:
- Databricks REST API calls
- Databricks OAuth token exchanges
- Azure Identity token acquisition for AAD service principal and default
Azure credential authentication
- Sync and async Databricks hook paths
## Why
Users running Airflow behind a corporate proxy could not authenticate to
Azure Databricks because token acquisition to Azure/Databricks endpoints did
not receive proxy configuration.
This fixes #32576 while keeping connection extras explicit and safe. The
implementation does not pass arbitrary connection extras through to client
libraries; it validates and forwards only the reviewed `proxies` extra.
## Testing
I added coverage for:
- Valid `proxies` parsing from Databricks connection extras
- Rejection of invalid proxy shapes and unsupported keys
- Sync Databricks REST API calls using proxies
- Async Databricks REST API calls using the matching `aiohttp` proxy
- AAD service principal token paths passing proxies to Azure Identity
- Databricks service-principal OAuth token exchange using proxies
- Sync and async token/API combinations
Commands run:
- `uv run ruff format
providers/databricks/src/airflow/providers/databricks/hooks/databricks_base.py
providers/databricks/tests/unit/databricks/hooks/test_databricks.py
providers/databricks/tests/unit/databricks/hooks/test_databricks_base.py`
- `uv run ruff check --fix
providers/databricks/src/airflow/providers/databricks/hooks/databricks_base.py
providers/databricks/tests/unit/databricks/hooks/test_databricks.py
providers/databricks/tests/unit/databricks/hooks/test_databricks_base.py`
- `uv run --project providers/databricks pytest
providers/databricks/tests/unit/databricks/hooks/test_databricks_base.py
providers/databricks/tests/unit/databricks/hooks/test_databricks.py -q`
Result: `228 passed`
closes: #32576
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Codex (GPT-5)
Generated-by: Codex (GPT-5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
Drafted-by: Codex (GPT-5) (no human review before posting)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]