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

[Fix] Exclude localhost from hitting proxies for metadata service requests #877

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

ilia-db
Copy link
Contributor

@ilia-db ilia-db commented Jan 29, 2025

What changes are proposed in this pull request?

Exclude localhost from hitting proxies for metadata service requests

requests package doesn't do it by default.

Relevant issue: databricks/databricks-vscode#916 (comment)

How is this tested?

Tested manually by running this code against real metadata service of the logged in databricks vscode extension:

import requests
import os

os.environ["HTTP_PROXY"] = "http://test.com"

resp = requests.get("http://127.0.0.1:53468/redacted",
                    timeout=10000,
                    headers={
                        "X-Databricks-Metadata-Version": "1",
                        "X-Databricks-Host": "https://redacted.databricks.com/"
                    }, proxies={"no_proxy": "localhost,127.0.0.1"})

print(resp.text)

The code fails without the no_proxy option

@ilia-db ilia-db temporarily deployed to test-trigger-is January 29, 2025 09:55 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to test-trigger-is January 29, 2025 09:55 — with GitHub Actions Inactive
@ilia-db ilia-db changed the title Metadata service no proxy Exclude localhost from hitting proxies for metadata service requests Jan 29, 2025
@ilia-db ilia-db force-pushed the metadata-service-no-proxy branch from fd66727 to 3ba03e4 Compare January 29, 2025 10:00
@ilia-db ilia-db temporarily deployed to test-trigger-is January 29, 2025 10:00 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to test-trigger-is January 29, 2025 10:01 — with GitHub Actions Inactive
@ilia-db ilia-db force-pushed the metadata-service-no-proxy branch from 3ba03e4 to a6763ee Compare January 29, 2025 10:04
@ilia-db ilia-db temporarily deployed to test-trigger-is January 29, 2025 10:04 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to test-trigger-is January 29, 2025 10:04 — with GitHub Actions Inactive
@ilia-db ilia-db changed the title Exclude localhost from hitting proxies for metadata service requests [Fix] Exclude localhost from hitting proxies for metadata service requests Jan 29, 2025
databricks/sdk/credentials_provider.py Outdated Show resolved Hide resolved
@ilia-db ilia-db force-pushed the metadata-service-no-proxy branch from 1f8492c to efcf9ae Compare January 30, 2025 13:16
@ilia-db ilia-db temporarily deployed to test-trigger-is January 30, 2025 13:16 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to test-trigger-is January 30, 2025 13:16 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to test-trigger-is January 30, 2025 13:19 — with GitHub Actions Inactive
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 877
  • Commit SHA: 12e2d5d797f69263d42f18b9416885137ad8e718

Checks will be approved automatically on success.

@ilia-db ilia-db temporarily deployed to test-trigger-is January 30, 2025 13:19 — with GitHub Actions Inactive
@ilia-db ilia-db added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit aa4f0f3 Jan 30, 2025
17 of 18 checks passed
@ilia-db ilia-db deleted the metadata-service-no-proxy branch January 30, 2025 14:06
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.

2 participants