Currently, the only way to add a new variable to the `jaas.conf` template file 
is to directly edit the path the config is constructed by adding new keyword 
arguments.
This wasn't necessarily a big problem, since you'd only need edit the 
`security_config.py` file as JAAS settings should come from the security 
settings.

Now, with the addition of 
[KIP-342](https://cwiki.apache.org/confluence/display/KAFKA/KIP-342%3A+Add+support+for+Custom+SASL+extensions+in+OAuthBearer+authentication),
 the OAuthBearer JAAS config supports arbitrary values in the form of SASL 
extensions.

I thought it would be nice if we could make adding arbitrary values to the JAAS 
config in tests as painless as possible for future tests.

# Future work
The same problem to a lesser extent exists in the `.properties` template files 
for consumer/producer.  That one can easily be worked around, since ducktape 
attaches a class' variables to the template file 
(https://github.com/confluentinc/ducktape/blob/d7226d83aa11538765d352f69bbf75e0c27e6304/ducktape/template.py#L34)
We can see this being used in multiple tests:
* 
https://github.com/apache/kafka/blob/trunk/tests/kafkatest/services/mirror_maker.py#L81
 - variables used in `mirror_maker_consumer.properties`
* 
https://github.com/apache/kafka/blob/3511e904effbfb74fa54c26467477863b7f730c0/tests/kafkatest/services/mirror_maker.py#L78
 - variable used in `mirror_maker_producer.properties`

I find it would be better if config variables were set explicitly and would not 
require the developer to read through the framework code to understand how 
they're populated. So future work might make all sorts of config variables 
passable through constructors. (Maybe we could have a single class 
encapsulating all variables, then, as having producer/consumer constructors 
accept `jaas_override_variables` is a bit non-ideal)


[ Full content available at: https://github.com/apache/kafka/pull/5554 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to