-
Notifications
You must be signed in to change notification settings - Fork 8
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
MINOR : Refactor service principal configuration #688
MINOR : Refactor service principal configuration #688
Conversation
@@ -94,23 +94,24 @@ public void run(RegistryConfiguration registryConfiguration, Environment environ | |||
} | |||
|
|||
private void initializeUGI(RegistryConfiguration conf) throws IOException { | |||
LOG.debug("Initialization of User Group ininformation..."); | |||
LOG.debug("Initialization of User Group information..."); | |||
if (UserGroupInformation.isSecurityEnabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check i believe requires core-site.xml. Can we not use the conf.getServiceAuthenticationConfiguration() itself?
String keyTab = authMethodConf.getServerPrincipleKeytab(); | ||
Map<String,String> serviceAuthenticationProperties = authMethodConf.getProperties(); | ||
String principal = serviceAuthenticationProperties.get("principal"); | ||
String keytab = serviceAuthenticationProperties.get("keytab"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should validate the principal and keytab for null and empty.
You should also catch exception from below, log it as error and then fallback to simple.
UserGroupInformation.loginUserFromKeytab(principal, keytab);
@guruchai: Addressed your review comments, can you have another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small comment. Please fix it.
Lgtm otherwise....
UserGroupInformation.loginUserFromKeytab(principal, keytab); | ||
LOG.debug("Successfully logged in"); | ||
} catch (Exception e) { | ||
LOG.error("Failed to log in"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please log the exception.
Thanks @guruchai , addressed your comments. |
No description provided.