-
Notifications
You must be signed in to change notification settings - Fork 177
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
Allow authentication over HTTP #530
base: master
Are you sure you want to change the base?
Conversation
550cadd
to
84ceec7
Compare
84ceec7
to
0e8b860
Compare
I think we should simply remove the check. After all the server does reject auth over HTTP unless:
What does the JDBC driver do right now? |
0e8b860
to
de652a1
Compare
@hashhar , this needs to be tested, but removing it without introducing a new flag could lead to breaking changes. The SQLAlchemy dialect automatically sets Would this mean that clients not explicitly specifying |
I'm saying to only remove these two lines trino-python-client/trino/client.py Lines 492 to 493 in 1e95bbf
It's server's job to disallow or allow whatever combination it wants. The |
removing those two lines only doesn’t help unfortunately because the |
I think the SQLAlchemy dialect code is being too smart for no reason. It should not be automatically setting http_scheme in any case. Same as how the db-api doesn't do it. We can remove the code from there too. The DB-API code (client.py |
de652a1
to
731a0cc
Compare
731a0cc
to
f6cb973
Compare
f6cb973
to
47ba278
Compare
@hashhar I've updated the PR as per your recommendations. The SQLAlchemy dialect no longer sets the |
Description
The Trino Python client currently rejects all authentication attempts over HTTP. While this seems like is a sensible security measure on the part of the Trino client, using an HTTP URL to access the Trino server does not inherently indicate an insecure environment.
This could be useful for testing purposes or in modern service meshes, such as those using SPIFFE authentication where injection of the spiffe headers and adding TLS are handled by spire and envoy separately in sidecars. Furthermore the trino server also has the option of
http-server.authentication.allow-insecure-over-http=true
(doc here) so it might be reasonable to not rejecting non-https authentication attempts in the client side.This pull request includes the following improvements:
http_scheme
tohttps
when authentication is detected in the connection URL.http_scheme="http"
connection argument is now respected. Ifhttp_scheme
is not specified, the scheme defaults tohttps
when the port is 443; otherwise, it defaults tohttp
.Example auth over HTTP:
Non-technical explanation
This PR adds functionality to optionally authenticate over HTTP.
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text: