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

MINOR : Refactor service principal configuration #688

Merged

Conversation

raju-saravanan
Copy link
Collaborator

No description provided.

@raju-saravanan raju-saravanan requested a review from guruchai March 16, 2020 19:58
@@ -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()) {
Copy link
Contributor

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");
Copy link
Contributor

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);

@raju-saravanan
Copy link
Collaborator Author

@guruchai: Addressed your review comments, can you have another look?

Copy link
Contributor

@guruchai guruchai left a 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");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please log the exception.

@raju-saravanan
Copy link
Collaborator Author

Thanks @guruchai , addressed your comments.

@raju-saravanan raju-saravanan merged commit e2d8d6b into hortonworks:master Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants