geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecr...@apache.org
Subject svn commit: r601062 - in /geronimo/sandbox/monitoring/client: ./ client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/ client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/ client-war/src/main/webapp/WEB-INF/view/
Date Tue, 04 Dec 2007 19:57:09 GMT
Author: ecraig
Date: Tue Dec  4 11:57:08 2007
New Revision: 601062

URL: http://svn.apache.org/viewvc?rev=601062&view=rev
Log:
GERONIMO-3668
Encrypt passowords stored in client database using encryptionmanager

Patch by Viet Nguyen

Modified:
    geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
    geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
    geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
    geronimo/sandbox/monitoring/client/pom.xml

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java?rev=601062&r1=601061&r2=601062&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
(original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
Tue Dec  4 11:57:08 2007
@@ -35,6 +35,8 @@
 import org.apache.geronimo.monitor.MasterRemoteControlRemote;
 import org.apache.geronimo.plugins.monitoring.client.util.DBManager;
 
+import org.apache.geronimo.util.EncryptionManager;
+
 public class MRCConnector
 {
 
@@ -58,6 +60,9 @@
     public MRCConnector(String ip, String userName, String password)
             throws Exception
     {
+        // decrypt the password
+        password = (String)EncryptionManager.decrypt(password);
+
         Properties props = new Properties();
         props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                 "org.apache.openejb.client.RemoteInitialContextFactory");

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java?rev=601062&r1=601061&r2=601062&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
(original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
Tue Dec  4 11:57:08 2007
@@ -33,6 +33,7 @@
 import javax.portlet.RenderResponse;
 
 import org.apache.geronimo.plugins.monitoring.client.util.DBManager;
+import org.apache.geronimo.util.EncryptionManager;
 
 /**
  * STATS
@@ -672,6 +673,9 @@
         String username = actionRequest.getParameter("username");
         String snapshot = actionRequest.getParameter("snapshot");
         String retention = actionRequest.getParameter("retention");
+        // encrypt the password
+        password = EncryptionManager.encrypt(password);
+
         try
         {
             // update the client side db (table = SERVERS)
@@ -731,6 +735,8 @@
         String ip = actionRequest.getParameter("ip");
         String password = actionRequest.getParameter("password");
         String username = actionRequest.getParameter("username");
+        // encrypt the password
+        password = EncryptionManager.encrypt(password);
         try
         {
             PreparedStatement pStmt = con

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java?rev=601062&r1=601061&r2=601062&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
(original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
Tue Dec  4 11:57:08 2007
@@ -27,6 +27,8 @@
 import javax.naming.NamingException;
 import javax.sql.DataSource;
 
+import org.apache.geronimo.util.EncryptionManager;
+
 public class DBManager
 {
     private static Connection con         = null;
@@ -158,8 +160,9 @@
                     + "view_id     INTEGER NOT NULL,"
                     + "graph_id     INTEGER NOT NULL)");
             pStmt.executeUpdate();
+            String password = EncryptionManager.encrypt("manager");
             pStmt = con
-                    .prepareStatement("INSERT INTO servers VALUES(DEFAULT, DEFAULT, 'Local
host', '127.0.0.1', 'system', 'manager', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)");
+                    .prepareStatement("INSERT INTO servers VALUES(DEFAULT, DEFAULT, 'Local
host', '127.0.0.1', 'system', '"+password+"', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)");
             pStmt.executeUpdate();
             pStmt = con
                     .prepareStatement("INSERT INTO graphs VALUES("

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp?rev=601062&r1=601061&r2=601062&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
(original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
Tue Dec  4 11:57:08 2007
@@ -33,6 +33,8 @@
 <%@ page import="org.apache.geronimo.plugins.monitoring.client.util.*" %>
 <%@ page import="org.apache.geronimo.console.util.PortletManager" %>
 <%@ page import="org.apache.geronimo.plugins.monitoring.client.MRCConnector" %>
+<%@ page import="org.apache.geronimo.util.EncryptionManager" %>
+
 <portlet:defineObjects/>
 
 <%
@@ -83,7 +85,7 @@
         name = rs.getString("name");
         username = rs.getString("username");
         ip = rs.getString("ip");
-        password = rs.getString("password");
+        password = (String)EncryptionManager.decrypt( rs.getString("password") );
     }
     added = rs.getString("added");
     modified = rs.getString("modified");

Modified: geronimo/sandbox/monitoring/client/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/pom.xml?rev=601062&r1=601061&r2=601062&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/pom.xml (original)
+++ geronimo/sandbox/monitoring/client/pom.xml Tue Dec  4 11:57:08 2007
@@ -135,6 +135,12 @@
                 </exclusions>
             </dependency>
 
+            <dependency>
+                <groupId>org.apache.geronimo.modules</groupId>
+                <artifactId>geronimo-utils</artifactId>
+                <version>${geronimoVersion}</version>
+                <type>jar</type>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 



Mime
View raw message