tinaselenge commented on code in PR #14995:
URL: https://github.com/apache/kafka/pull/14995#discussion_r1464770354
##########
clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:
##########
@@ -40,7 +42,13 @@ public class FileConfigProvider implements ConfigProvider {
private static final Logger log =
LoggerFactory.getLogger(FileConfigProvider.class);
+ public static final String ALLOWED_PATHS_CONFIG = "allowed.paths";
+ public static final String ALLOWED_PATHS_DOC = "A comma separated list of
paths that this config provider is " +
+ "allowed to access. If not set, all paths are allowed.";
+ private AllowedPaths allowedPaths = null;
Review Comment:
There is something else to consider if we go down the route of throwing an
exception(either NPE or IllegalStateException) when configure() is not called
first. We end up breaking tests for AbstractConfig, which is used to resolve
the config variables, by instantiating ConfigProviders with the given
configProvider configs and then calling get() method
(https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java#L536).
We would need to make changes to this class, possibly call configure() first
when instantiating the CPs which may or may not have further impact somewhere
else.
Considering this, I'm not sure what's more valuable between defaulting to
the previous behaviour of no-op and introducing an exception. What do you both
think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]