-
Notifications
You must be signed in to change notification settings - Fork 22
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 to provide a custom http agent and disable the auth header #284
Conversation
|
ca: ca_cert, | ||
}) | ||
const client = createClient({ | ||
url: 'https://server.clickhouseconnect.test:8443', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we run the test against Cloud?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but this is slightly more annoying - it will have to choose between HTTP and HTTPS agent, plus I wanted to test the auth with a CA cert (so I'll need to add that to the repo as well).
/** Enable or disable the `Authorization` header with basic auth for the outgoing HTTP(s) requests. | ||
* @experimental - unstable API, might be a subject to change in the future; please provide your feedback in the repository. | ||
* @default true (enabled) */ | ||
set_basic_auth_header?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we change the client signature
/** The name of the user on whose behalf requests are made.
* @default default */
username?: string | null
/** The user password.
* @default empty string */
password?: string | null
if null
is provided, no defaults are applied, and no auth header is set?
New features
Added an option to provide a custom HTTP Agent in the client configuration via the
http_agent
option (#283, related: #278). The following conditions apply if a custom HTTP Agent is provided:max_open_connections
andtls
options will have no effect and will be ignored by the client, as it is a part of the underlying (default) HTTP Agent configuration.keep_alive.enabled
will only regulate the default value of theConnection
header (true
->Connection: keep-alive
,false
->Connection: close
).keep_alive.idle_socket_ttl
value to0
.Added a new client configuration option:
set_basic_auth_header
which disables theAuthorization
header that is set by the client by default for every outgoing HTTP request. One of the possible scenarios when it is necessary to disable this header is when a custom HTTPS agent is used, and the server requires TLS authorization with certificates. For example:NB: It is currently not possible to set the
set_basic_auth_header
option via the URL params.Checklist