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

feat: extra headers during initialization #668

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

aderihoJD
Copy link
Contributor

@aderihoJD aderihoJD commented Sep 24, 2024

Unfortunately, this feature #568 not fully provide possibility to apply extra headers for each request to Trino. They apply only for the first one (query) and we lose them later, in next() method. If we'll add extraHeaders during client initialization, they will apply for each request.
p.s. pretty urgent, if possible

Copy link

cla-bot bot commented Sep 24, 2024

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@aderihoJD
Copy link
Contributor Author

aderihoJD commented Sep 24, 2024 via email

@nineinchnick
Copy link
Member

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Oct 14, 2024
Copy link

cla-bot bot commented Oct 14, 2024

The cla-bot has been summoned, and re-checked this pull request!

@nineinchnick
Copy link
Member

nineinchnick commented Oct 14, 2024

@aderihoJD please fill in the description of this pull request.

There's an open discussion in trinodb/trino#15826 about allowing clients to send any HTTP headers. It would be better to discuss specific use cases.

Similar changes were suggested in both the Trino Go client, and the Python client, and both were rejected, because no sufficient use case was provided.

@aderihoJD
Copy link
Contributor Author

@regadas could u review it?

@nineinchnick
Copy link
Member

Please describe your use case, per my previous comment.

@aderihoJD
Copy link
Contributor Author

Please describe your use case, per my previous comment.

yes, sure. i left a description already. and in our case - we need an extra header to allow us communicate with trino inside cluster. that's why we need a X-Forwarded-Proto: https header for each request to trino.

@nineinchnick
Copy link
Member

Can you add a test that would verify this?

@aderihoJD
Copy link
Contributor Author

aderihoJD commented Oct 14, 2024

Can you add a test that would verify this?

not sure. it's a specific case during communicate inside k8s cluster. we need to setup it to verify

@aderihoJD
Copy link
Contributor Author

@nineinchnick do we need smth from my side?

@nineinchnick
Copy link
Member

Yes, this needs any kind of tests. A unit test would suffice, but we only have integration tests here. @regadas PTAL

@regadas
Copy link
Contributor

regadas commented Nov 5, 2024

@aderihoJD @nineinchnick sorry for dropping the ball a bit on this; Added a test to ensure propagation.

@regadas regadas merged commit 66a9e9d into trinodb:main Nov 5, 2024
4 checks passed
@mosabua
Copy link
Member

mosabua commented Nov 5, 2024

@aderihoJD
Copy link
Contributor Author

@regadas could we make a release with this changes?

@regadas
Copy link
Contributor

regadas commented Nov 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants