Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4C5FF1098C for ; Fri, 13 Dec 2013 07:29:22 +0000 (UTC) Received: (qmail 55698 invoked by uid 500); 13 Dec 2013 07:29:21 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 55681 invoked by uid 500); 13 Dec 2013 07:29:21 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 55671 invoked by uid 99); 13 Dec 2013 07:29:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 07:29:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AE56E8B7A0B; Fri, 13 Dec 2013 07:29:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kishan@apache.org To: commits@cloudstack.apache.org Message-Id: <88b839ef7487465a87631c11193df382@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.3 to 24392c1 Date: Fri, 13 Dec 2013 07:29:20 +0000 (UTC) Updated Branches: refs/heads/4.3 d5c2fabb5 -> 24392c15f CLOUDSTACK-5435 enabled encryption for ldap params Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/24392c15 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/24392c15 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/24392c15 Branch: refs/heads/4.3 Commit: 24392c15f561fa07fd5f707bbfa6910d880c3a3b Parents: d5c2fab Author: Rajani Karuturi Authored: Thu Dec 12 12:36:57 2013 +0530 Committer: Kishan Kavala Committed: Fri Dec 13 12:45:37 2013 +0530 ---------------------------------------------------------------------- .../apache/cloudstack/api/command/LDAPConfigCmd.java | 6 +++--- .../api/response/LdapConfigurationResponse.java | 8 ++++---- .../apache/cloudstack/ldap/LdapConfigurationVO.java | 14 +++++++++----- .../org/apache/cloudstack/ldap/LdapManagerImpl.java | 4 ++-- setup/db/db/schema-421to430.sql | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24392c15/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java ---------------------------------------------------------------------- diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java index 3faf8b7..53d3877 100644 --- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java +++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LDAPConfigCmd.java @@ -188,7 +188,7 @@ public class LDAPConfigCmd extends BaseCmd { } else { boolean result = this.updateLDAP(); if (result) { - LDAPConfigResponse lr = this.createLDAPConfigResponse(getHostname(), getPort(), getUseSSL(), getQueryFilter(), getSearchBase(), getBindDN()); + LDAPConfigResponse lr = this.createLDAPConfigResponse(getHostname(), getPort().toString(), getUseSSL(), getQueryFilter(), getSearchBase(), getBindDN()); lr.setResponseName(getCommandName()); this.setResponseObject(lr); } @@ -196,10 +196,10 @@ public class LDAPConfigCmd extends BaseCmd { } - private LDAPConfigResponse createLDAPConfigResponse(String hostname, Integer port, Boolean useSSL, String queryFilter, String searchBase, String bindDN) { + private LDAPConfigResponse createLDAPConfigResponse(String hostname, String port, Boolean useSSL, String queryFilter, String searchBase, String bindDN) { LDAPConfigResponse lr = new LDAPConfigResponse(); lr.setHostname(hostname); - lr.setPort(port.toString()); + lr.setPort(port); lr.setUseSSL(useSSL.toString()); lr.setQueryFilter(queryFilter); lr.setBindDN(bindDN); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24392c15/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LdapConfigurationResponse.java ---------------------------------------------------------------------- diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LdapConfigurationResponse.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LdapConfigurationResponse.java index 39d5bae..caabbe7 100644 --- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LdapConfigurationResponse.java +++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LdapConfigurationResponse.java @@ -28,7 +28,7 @@ public class LdapConfigurationResponse extends BaseResponse { @SerializedName("port") @Param(description = "port") - private int port; + private String port; public LdapConfigurationResponse() { super(); @@ -39,7 +39,7 @@ public class LdapConfigurationResponse extends BaseResponse { this.hostname = hostname; } - public LdapConfigurationResponse(final String hostname, final int port) { + public LdapConfigurationResponse(final String hostname, final String port) { this.hostname = hostname; this.port = port; } @@ -48,7 +48,7 @@ public class LdapConfigurationResponse extends BaseResponse { return hostname; } - public int getPort() { + public String getPort() { return port; } @@ -56,7 +56,7 @@ public class LdapConfigurationResponse extends BaseResponse { this.hostname = hostname; } - public void setPort(final int port) { + public void setPort(final String port) { this.port = port; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24392c15/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfigurationVO.java ---------------------------------------------------------------------- diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfigurationVO.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfigurationVO.java index 98e42f8..2fb6332 100644 --- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfigurationVO.java +++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfigurationVO.java @@ -23,26 +23,30 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; +import com.cloud.utils.db.Encrypt; import org.apache.cloudstack.api.InternalIdentity; @Entity @Table(name = "ldap_configuration") public class LdapConfigurationVO implements InternalIdentity { - @Column(name = "hostname") - private String hostname; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long id; + @Encrypt + @Column(name = "hostname") + private String hostname; + + @Encrypt @Column(name = "port") - private int port; + private String port; public LdapConfigurationVO() { } - public LdapConfigurationVO(final String hostname, final int port) { + public LdapConfigurationVO(final String hostname, final String port) { this.hostname = hostname; this.port = port; } @@ -56,7 +60,7 @@ public class LdapConfigurationVO implements InternalIdentity { return id; } - public int getPort() { + public String getPort() { return port; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24392c15/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java ---------------------------------------------------------------------- diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java index 578ebce..c2158f4 100644 --- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java +++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java @@ -67,10 +67,10 @@ public class LdapManagerImpl implements LdapManager, LdapValidator { try { final String providerUrl = "ldap://" + hostname + ":" + port; _ldapContextFactory.createBindContext(providerUrl); - configuration = new LdapConfigurationVO(hostname, port); + configuration = new LdapConfigurationVO(hostname, Integer.toString(port)); _ldapConfigurationDao.persist(configuration); s_logger.info("Added new ldap server with hostname: " + hostname); - return new LdapConfigurationResponse(hostname, port); + return new LdapConfigurationResponse(hostname, Integer.toString(port)); } catch (final NamingException e) { throw new InvalidParameterValueException("Unable to bind to the given LDAP server"); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24392c15/setup/db/db/schema-421to430.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index d49c20c..bcc827b 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -618,7 +618,7 @@ INSERT INTO `cloud`.`configuration`(category, instance, component, name, value, CREATE TABLE `cloud`.`ldap_configuration` ( `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', `hostname` varchar(255) NOT NULL COMMENT 'the hostname of the ldap server', - `port` int(10) COMMENT 'port that the ldap server is listening on', + `port` varchar(255) COMMENT 'port that the ldap server is listening on', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;