@@ -38,8 +38,6 @@ pub enum KafkaListenerProtocol {
3838pub enum KafkaListenerName {
3939 #[ strum( serialize = "CLIENT" ) ]
4040 Client ,
41- #[ strum( serialize = "CLIENT_AUTH" ) ]
42- ClientAuth ,
4341 #[ strum( serialize = "INTERNAL" ) ]
4442 Internal ,
4543 #[ strum( serialize = "BOOTSTRAP" ) ]
@@ -179,28 +177,7 @@ pub fn get_kafka_listener_config(
179177 BTreeMap :: new ( ) ;
180178
181179 // CLIENT
182- if kafka_security. tls_client_authentication_class ( ) . is_some ( ) {
183- // 1) If client authentication required, we expose only CLIENT_AUTH connection with SSL
184- listeners. push ( KafkaListener {
185- name : KafkaListenerName :: ClientAuth ,
186- host : LISTENER_LOCAL_ADDRESS . to_string ( ) ,
187- port : kafka_security. client_port ( ) . to_string ( ) ,
188- } ) ;
189- advertised_listeners. push ( KafkaListener {
190- name : KafkaListenerName :: ClientAuth ,
191- host : node_address_cmd ( STACKABLE_LISTENER_BROKER_DIR ) ,
192- port : node_port_cmd (
193- STACKABLE_LISTENER_BROKER_DIR ,
194- kafka_security. client_port_name ( ) ,
195- ) ,
196- } ) ;
197- listener_security_protocol_map
198- . insert ( KafkaListenerName :: ClientAuth , KafkaListenerProtocol :: Ssl ) ;
199- listener_security_protocol_map. insert (
200- KafkaListenerName :: ControllerAuth ,
201- KafkaListenerProtocol :: Ssl ,
202- ) ;
203- } else if kafka_security. has_kerberos_enabled ( ) {
180+ if kafka_security. has_kerberos_enabled ( ) {
204181 // 2) Kerberos and TLS authentication classes are mutually exclusive
205182 listeners. push ( KafkaListener {
206183 name : KafkaListenerName :: Client ,
@@ -217,12 +194,10 @@ pub fn get_kafka_listener_config(
217194 } ) ;
218195 listener_security_protocol_map
219196 . insert ( KafkaListenerName :: Client , KafkaListenerProtocol :: SaslSsl ) ;
220- listener_security_protocol_map. insert (
221- KafkaListenerName :: Controller ,
222- KafkaListenerProtocol :: SaslSsl ,
223- ) ;
224- } else if kafka_security. tls_server_secret_class ( ) . is_some ( ) {
225- // 3) If no client authentication but tls is required we expose CLIENT with SSL
197+ } else if kafka_security. tls_client_authentication_class ( ) . is_some ( )
198+ || kafka_security. tls_server_secret_class ( ) . is_some ( )
199+ {
200+ // 1) Client listener uses TLS (possibly with authentication)
226201 listeners. push ( KafkaListener {
227202 name : KafkaListenerName :: Client ,
228203 host : LISTENER_LOCAL_ADDRESS . to_string ( ) ,
@@ -239,7 +214,8 @@ pub fn get_kafka_listener_config(
239214 listener_security_protocol_map
240215 . insert ( KafkaListenerName :: Client , KafkaListenerProtocol :: Ssl ) ;
241216 } else {
242- // 4) If no client auth or tls is required we expose CLIENT with PLAINTEXT
217+ // 3) If no client auth or tls is required we expose CLIENT with PLAINTEXT
218+ // This is actually never the case because
243219 listeners. push ( KafkaListener {
244220 name : KafkaListenerName :: Client ,
245221 host : LISTENER_LOCAL_ADDRESS . to_string ( ) ,
@@ -414,7 +390,7 @@ mod tests {
414390 config. listeners( ) ,
415391 format!(
416392 "{name}://{host}:{port},{internal_name}://{internal_host}:{internal_port}" ,
417- name = KafkaListenerName :: ClientAuth ,
393+ name = KafkaListenerName :: Client ,
418394 host = LISTENER_LOCAL_ADDRESS ,
419395 port = kafka_security. client_port( ) ,
420396 internal_name = KafkaListenerName :: Internal ,
@@ -427,7 +403,7 @@ mod tests {
427403 config. advertised_listeners( ) ,
428404 format!(
429405 "{name}://{host}:{port},{internal_name}://{internal_host}:{internal_port}" ,
430- name = KafkaListenerName :: ClientAuth ,
406+ name = KafkaListenerName :: Client ,
431407 host = node_address_cmd( STACKABLE_LISTENER_BROKER_DIR ) ,
432408 port = node_port_cmd(
433409 STACKABLE_LISTENER_BROKER_DIR ,
@@ -447,15 +423,13 @@ mod tests {
447423 assert_eq ! (
448424 config. listener_security_protocol_map( ) ,
449425 format!(
450- "{name}:{protocol},{internal_name}:{internal_protocol},{controller_name}:{controller_protocol},{controller_auth_name}:{controller_auth_protocol} " ,
451- name = KafkaListenerName :: ClientAuth ,
426+ "{name}:{protocol},{internal_name}:{internal_protocol},{controller_name}:{controller_protocol}" ,
427+ name = KafkaListenerName :: Client ,
452428 protocol = KafkaListenerProtocol :: Ssl ,
453429 internal_name = KafkaListenerName :: Internal ,
454430 internal_protocol = KafkaListenerProtocol :: Ssl ,
455431 controller_name = KafkaListenerName :: Controller ,
456432 controller_protocol = KafkaListenerProtocol :: Ssl ,
457- controller_auth_name = KafkaListenerName :: ControllerAuth ,
458- controller_auth_protocol = KafkaListenerProtocol :: Ssl ,
459433 )
460434 ) ;
461435
0 commit comments