Oved Ourfali has posted comments on this change.
Change subject: tools: Adding Setting ldap servers for domain
......................................................................
Patch Set 3: (9 inline comments)
minor comments.
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ipa/SimpleAuthenticationCheck.java
Line 41: String password,
Line 42: StringBuffer userGuid, LdapProviderType ldapProviderType,
List<String> ldapServers) {
Line 43:
Line 44: Pair<ReturnStatus,String> status = null;
Line 45: for (String ldapServerUrl:ldapServers) {
spaces.
Line 46: status = checkSimpleLdapServer(domain, username, password,
userGuid, ldapProviderType, ldapServerUrl);
Line 47: if (status.getFirst().getExitCode() ==
ReturnStatus.OK.getExitCode()) {
Line 48: return status;
Line 49: }
Line 87: try {
Line 88: List searchResult =
Line 89: ldapTemplate.search("", query, contextMapper);
Line 90: if (searchResult == null) {
Line 91: return new
Pair(ReturnStatus.CANNOT_QUERY_USER,ERROR_PREFIX + "Cannot query user " +
username + " from domain " + domain);
spaces
Line 92: } else {
Line 93: userGuid.append((String) searchResult.get(0));
Line 94: System.out.println("User guid is: " +
userGuid.toString());
Line 95: }
Line 95: }
Line 96: } catch (org.springframework.ldap.AuthenticationException
authEx) {
Line 97: return authenticationReturnStatus(authEx, username,
domain);
Line 98: } catch (Exception ex) {
Line 99: return new
Pair(ReturnStatus.CANNOT_QUERY_USER,ERROR_PREFIX + "Cannot query user " +
username + " from domain " + domain
spaces
Line 100: + ", details: " + ex.getMessage());
Line 101: }
Line 102:
Line 103: return new Pair(ReturnStatus.OK,"");
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/kerberos/ConfigurationProvider.java
Line 40: configVals.put(LDAPSecurityAuthentication,
ldapSecurityAuthentication);
Line 41: configVals.put(LdapServers, ldapServers);
Line 42: configVals.put(AdUserId, adUserId);
Line 43: configVals.put(LDAPProviderTypes, ldapProviderTypes);
Line 44: configVals.put(ConfigValues.LDAPServerPort, ldapServerPort);
import that one as well, to make the code more readable, or prefix all with
ConfigValues
Line 45: this.engineConfigExecutable = engineConfigExecutable;
Line 46: this.engineConfigProperties = engineConfigProperties;
Line 47: }
Line 48:
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/kerberos/JndiAction.java
Line 40: this.userName = userName;
Line 41: this.domainName = domainName;
Line 42: this.ldapProviderType = ldapProviderType;
Line 43: this.userGuid = userGuid;
Line 44: this.ldapServers= ldapServers;
space
Line 45: this.defaultLdapServerPort = defaultLdapServerPort;
Line 46: }
Line 47:
Line 48: @Override
Line 71: return
AuthenticationResult.CANNOT_FIND_LDAP_SERVER_FOR_DOMAIN;
Line 72: }
Line 73:
Line 74: // Goes over all the retrieved LDAP servers
Line 75: for (String address:ldapServers) {
spaces
Line 76: try {
Line 77: // Constructs an LDAP url in a format of
ldap://hostname:port (based on the data in the SRV record
Line 78: // This URL is not enough in order to query for user -
as for querying users, we should also provide a
Line 79: // base dn, for example:
ldap://hostname:389/DC=abc,DC=com . However, this URL (ldap:hostname:port)
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/kerberos/KerberosConfigCheck.java
Line 42: this.defaultLdapServerPort = defaultLdapServerPort;
Line 43: }
Line 44:
Line 45: public KerberosConfigCheck() {
Line 46: this(null,null);
space
Line 47: }
Line 48:
Line 49: // This function gets the username and adjusts it doing the
following:
Line 50: // 1. If the username contains @, for example:
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/kerberos/ManageDomains.java
Line 462: String domainName =
parser.getArg(Arguments.domain.toString()).toLowerCase();
Line 463: if (domainNameEntry.doesDomainExist(domainName)) {
Line 464: throw new
ManageDomainsResult(ManageDomainsResultEnum.DOMAIN_ALREADY_EXISTS_IN_CONFIGURATION,
domainName);
Line 465: }
Line 466: ldapServers = getLdapServers(parser,domainName);
space
Line 467: validateKdcServers(authMode,domainName);
Line 468: domainNameEntry.setValueForDomain(domainName, null);
Line 469:
Line 470: String currentAdUserNameEntry =
configurationProvider.getConfigValue(ConfigValues.AdUserName);
Line 825: Map<String,List<String>> ldapServersPerGSSAPIDomains = new
HashMap<String, List<String>>();
Line 826:
Line 827:
Line 828: for (Entry<String,String> currLdapServerEntry:
ldapServersEntry.getValues()) {
Line 829: System.out.println("current ldap server entry. domain " +
currLdapServerEntry.getKey() + " server " + currLdapServerEntry.getValue());
s/ldap/LDAP
Line 830: if (gssapiDomains.contains(currLdapServerEntry.getKey()))
{
Line 831:
ldapServersPerGSSAPIDomains.put(currLdapServerEntry.getKey(),
Line 832: new
ArrayList<String>(Arrays.asList(currLdapServerEntry.getValue().split(","))));
Line 833: } else
--
To view, visit http://gerrit.ovirt.org/11065
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic0904f9f6d9432ecac1cebee2790dae902a1329c
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches