Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-3279: Remove checks for JAAS system property #967

Closed
wants to merge 2 commits into from

Conversation

rajinisivaram
Copy link
Contributor

JAAS configuration may be set using other methods and hence the check for System property doesn't always match where the actual configuration used by Kafka is loaded from.

@ijuma
Copy link
Contributor

ijuma commented Feb 24, 2016

You mean, one could set it via Configuration.setConfiguration for example?

@ijuma
Copy link
Contributor

ijuma commented Feb 24, 2016

cc @fpj

@rajinisivaram
Copy link
Contributor Author

@ijuma Yes, exactly.
And JEE servers can support JAAS configuration for apps to be set in the application configuration - at the moment, we need to set the System property to some non-null value that never gets used, but without the setting, Kafka throws an exception.

@ijuma
Copy link
Contributor

ijuma commented Feb 24, 2016

Makes sense.

@harshach
Copy link

+1

Configuration loginConf = Configuration.getConfiguration();
isSecurityEnabled = loginConf.getAppConfigurationEntry(zkLoginContextName) != null;
} catch (Exception e) {
throw new KafkaException(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should provide some context on the exception here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rajinisivaram
Copy link
Contributor Author

@harshach @ijuma Thank you for the review. I have made the updates suggested.

@ijuma
Copy link
Contributor

ijuma commented Feb 24, 2016

LGTM but it would be good to get a second review from @fpj as he worked on this code.

@rajinisivaram
Copy link
Contributor Author

@fpj Do you have time to review this? Thank you.

@@ -88,25 +87,17 @@ public static boolean isZkSecurityEnabled() {
boolean zkSaslEnabled = Boolean.parseBoolean(System.getProperty(ZK_SASL_CLIENT, "true"));
String zkLoginContextName = System.getProperty(ZK_LOGIN_CONTEXT_NAME_KEY, "Client");

String loginConfigFile = System.getProperty(JAVA_LOGIN_CONFIG_PARAM);
if (loginConfigFile != null && loginConfigFile.length() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajinisivaram It sounds ok to remove this verification, if the configuration isn't right, then isSecurityEnabled below will be false, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fpj Yes, that is correct. If the configuration is not set using the property or using some other mechanism, then isSecurityEnabled below will be false.

@fpj
Copy link
Contributor

fpj commented Mar 8, 2016

+1, LGTM

@ijuma
Copy link
Contributor

ijuma commented Mar 8, 2016

@harshach, that's 3 reviews including your own. Would you like to merge this?

@ewencp
Copy link
Contributor

ewencp commented Mar 9, 2016

LGTM, and validated w/ some of the system tests as well. Thanks @rajinisivaram!

@asfgit asfgit closed this in 324b0c8 Mar 9, 2016
wcarlson5 pushed a commit to wcarlson5/kafka that referenced this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants