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

AMBARI-24907. Updated service metainfo to declare LDAP integration support #2621

Merged
merged 2 commits into from Nov 16, 2018

Conversation

smolnar82
Copy link
Contributor

@smolnar82 smolnar82 commented Nov 16, 2018

What changes were proposed in this pull request?

Update service metainfo to declare LDAP integration support. The following tag may be optionally set in a service's metainfo.xml file:

<ldap>
 <supported>true</supported>
 <ldapEnabledTest>
    {
      "equals": [
        "ranger-admin-site/ranger.authentication.method",
        "LDAP"
      ]
    }
 <ldapEnabledTest>
</ldap>

How was this patch tested?

Executing JUnit tests in ambari-server:

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:22 min
[INFO] Finished at: 2018-11-16T07:37:57+01:00
[INFO] Final Memory: 163M/917M
[INFO] ------------------------------------------------------------------------

In addition to unit testing the following E2E tests have been done locally:

  1. had a cluster with Ranger, Zookeeper and AMS installed
  2. modified Ranger's metainfo.xml and added the above ldap XML elements
  3. built the new JAR, replaced the old one with the new and restarted the server
  4. Checked the service response for Ranger using Ambari's API
    4.1. authentication method was set to UNIX (the default one):

screen shot 2018-11-16 at 9 03 15 am

4.2. updated Ranger's authentication method to LDAP:
screen shot 2018-11-16 at 9 02 24 am

  1. Checked the service response for Ranger using Ambari's API (there was no <ldap> setting here):

screen shot 2018-11-16 at 9 03 29 am

@asfgit
Copy link

asfgit commented Nov 16, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4562/
Test FAILed.
Test FAILured.

@benyoka
Copy link
Contributor

benyoka commented Nov 16, 2018

LGTM wtr the checkstyle fix.

@asfgit
Copy link

asfgit commented Nov 16, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4563/
Test PASSed.

@smolnar82 smolnar82 merged commit 9419944 into apache:trunk Nov 16, 2018
@smolnar82 smolnar82 deleted the AMBARI-24907 branch November 16, 2018 08:56
@@ -226,6 +231,9 @@
"Automated SSO integration will not be allowed for this service.",
serviceName);
}

ldapIntegrationSupported = sInfo.isLdapSupported();
ldapEnabledTest = StringUtils.isNotBlank(sInfo.getLdapEnabledTest()) ? PredicateUtils.fromJSON(sInfo.getLdapEnabledTest()) : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe for code reuse, make compileKerberosEnabledPredicate generic?

  private Predicate compilePredicate(String json) {
    if (StringUtils.isNotBlank(json)) {
      return PredicateUtils.fromJSON(json);
    }
    return null;
  }

Copy link
Contributor

Choose a reason for hiding this comment

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

oops.. already merged... :|

vishalsuvagia pushed a commit to vishalsuvagia/ambari that referenced this pull request Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants