Add Kerberos Auth (#128) - #887
Conversation
Adds use_kerberos and kerberos_hostname_override connection parameters for both existing clients. Requires the new `kerberos` extra.
Stands up a real KDC and Kerberos-configured ClickHouse instance via docker-compose (behind a `kerberos` profile) for end-to-end testing of use_kerberos, plus a dedicated CI job.
bf4412e to
4092a75
Compare
|
Hi @pferate thanks for this PR as well. Before we commit to reviewing and maintaining this long term, could you share more about the environment driving it? Kerberos is excluded from ClickHouse Cloud, so this'll be a self-managed-only feature. Some of the other client maintainers are looking at the same question so your answers could help inform that broader decision. Specifically:
If you're more comfortable answering these outside of a public channel, let me know. |
|
Hi @joe-clickhouse Personally, I don't have a dog in this race, so I can't give you any useful answers to those questions. I was just looking through open issues and seeing where I can help contribute. I saw that #128 was open and stale, so I picked it. |
|
@pferate understood! Thanks so much for the context. |
Summary
This adds a Kerberos connection options that generates a SPNEGO ("Negotiate") token from the Kerberos credential cache for each HTTP request.
Adds use_kerberos and kerberos_hostname_override parameters to both the sync (http) and async clients, backed by a new kerberos.py module built on pyspnego/gssapi/krb5 (new kerberos extra). Because ClickHouse authenticates each HTTP request independently rather than caching auth for a session, a fresh token is generated per request rather than once at connect time.
Issue: #128
Checklist