Aiven-Open / Aiven-Open/karapace
Improve handling of authentication configuration
- Linguagem predominante
- Python
- Estrelas
- 634
- Forks
- 110
- Merge médio
- 4d 7h
- PRs com merge (30d)
- 4
Descrição
# What is currently missing?
When configuring Karapace to connect to a Kafka with some authentication method, e.g. SSL, we need to set the configuration keys for the auth itself *and* the `security_protocol`. In the case of SSL, in *addition* to `security_protocol`, the keys `ssl_cafile`, `ssl_certfile`, and `ssl_keyfile` must be set too. I usually find myself setting the certificates, and forgetting to set the `security_protocol`, in this case Karapace keeps failing with a `UnrecognizedBrokerVersion` error, which at first sight is unrelated to the authentication method. This probably happens because the connect *is open*, but the Kafka client tries to decode the data without decrypting it, which fails as if the data is corrupted.
The result is that the client thinks the server's api_version is old, while in reality the communication channel is improperly configured.
# How could this be improved?
- Change how the configuration is defined. Since we are not falling back to different authentication methods we should only allow a single authentication method to be configured
- Improve the errors messages on the Kafka client
- Try to detect in the Kafka client if the server is using a SSL connection instead of a raw connection to give a more precise error message.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.