Skip to content

Add support for HTTP header for Trino - #1774

Merged
jschoedl merged 3 commits into
datacontract:mainfrom
starhel:trino-http-headers
Nov 6, 2026
Merged

jschoedl merged 3 commits into
datacontract:mainfrom
starhel:trino-http-headers

Conversation

@starhel

@starhel starhel commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Adds support for custom Trino HTTP headers via DATACONTRACT_TRINO_HTTP_HEADERS, Python Config, and YAML configuration files, for both testing and importing data contracts.

Our organisation requires specific HTTP headers to be sent to Trino for queries to execute successfully. This change allows those headers to be configured without modifying the connector.

  • Tests pass (uv run pytest)
  • Code formatted (uv run ruff check --fix && uv run ruff format)
  • Docs updated (if relevant)
  • CHANGELOG.md entry added

@starhel
starhel force-pushed the trino-http-headers branch from e39586a to 5a8c23f Compare October 26, 2026 11:43
@starhel

starhel commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

trino_http_headers is now stored as a SecretStr and parsed into a dictionary using the same logic as iceberg_properties.

`datacontract api` now answers 422 when DATACONTRACT_TRINO_JWT_TOKEN or
DATACONTRACT_TRINO_HTTP_HEADERS is set in the server's environment and the
posted contract picks the host, unless DATACONTRACT_TRINO_HOST pins it.
Before, only DATACONTRACT_TRINO_PASSWORD was protected this way.
@jschoedl

jschoedl commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the PR!

I added two commits on top. trino_http_headers and trino_jwt_token now count as secrets in the API server's credential guard, so the server no longer sends them to a host picked by a posted contract. I also dropped three tests that repeated existing coverage.

Apart from that, LGTM :)

@jschoedl
jschoedl merged commit 189dcf3 into datacontract:main Nov 6, 2026
18 checks passed
@starhel

starhel commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the merge and the improvements!

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.

Support custom HTTP headers for Trino connections

2 participants