You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ze...@apache.org on 2017/11/28 06:48:13 UTC

directory-kerby git commit: Replace mysql JDBC driver with Drizzle JDBC for license compatible problem.

Repository: directory-kerby
Updated Branches:
  refs/heads/has-project a8b1c28fa -> 31860e083


Replace mysql JDBC driver with Drizzle JDBC for license compatible problem.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/31860e08
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/31860e08
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/31860e08

Branch: refs/heads/has-project
Commit: 31860e083e335fad9517f13f99ae9bb3014eeedb
Parents: a8b1c28
Author: zenglinx <fr...@intel.com>
Authored: Tue Nov 28 14:48:03 2017 +0800
Committer: zenglinx <fr...@intel.com>
Committed: Tue Nov 28 14:48:03 2017 +0800

----------------------------------------------------------------------
 has/doc/mysql-backend.md                                      | 2 +-
 has/has-dist/conf/has-server.conf                             | 2 +-
 has/has-server/pom.xml                                        | 6 +++---
 .../java/org/apache/kerby/has/server/kdc/MySQLConfKey.java    | 4 ++--
 .../org/apache/kerby/has/server/kdc/MySQLIdentityBackend.java | 5 +++--
 .../java/org/apache/kerby/has/server/web/rest/ConfApi.java    | 7 ++++---
 6 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31860e08/has/doc/mysql-backend.md
----------------------------------------------------------------------
diff --git a/has/doc/mysql-backend.md b/has/doc/mysql-backend.md
index 4a06be3..4bf2815 100644
--- a/has/doc/mysql-backend.md
+++ b/has/doc/mysql-backend.md
@@ -10,7 +10,7 @@ Please refer to [install mysql](https://dev.mysql.com/doc/refman/5.7/en/linux-in
 // Url: jdbc url of mysql database; mysqlbackend: name of has mysql backend database; username: mysql user name; password: mysql password
 cd HAS/has-dist
 sh bin/kdcinit.sh conf
-KdcInitTool: config_kdcBackend mysql jdbc:mysql://127.0.0.1:3306/mysqlbackend?createDatabaseIfNotExist=true root passwd
+KdcInitTool: config_kdcBackend mysql jdbc:mysql://127.0.0.1:3306/mysqlbackend?createDB=true root passwd
 KdcInitTool: exit
 ```
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31860e08/has/has-dist/conf/has-server.conf
----------------------------------------------------------------------
diff --git a/has/has-dist/conf/has-server.conf b/has/has-dist/conf/has-server.conf
index 5fb801e..436520a 100644
--- a/has/has-dist/conf/has-server.conf
+++ b/has/has-dist/conf/has-server.conf
@@ -17,7 +17,7 @@
 #
 
 [HAS]
-  https_host = plusplus-desktop
+  https_host = localhost
   https_port = 8092
   filter_auth_type = kerberos
   enable_conf = false

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31860e08/has/has-server/pom.xml
----------------------------------------------------------------------
diff --git a/has/has-server/pom.xml b/has/has-server/pom.xml
index 4771741..15ab9ab 100644
--- a/has/has-server/pom.xml
+++ b/has/has-server/pom.xml
@@ -32,9 +32,9 @@
       <version>1.6</version>
     </dependency>
     <dependency>
-      <groupId>mysql</groupId>
-      <artifactId>mysql-connector-java</artifactId>
-      <version>5.1.42</version>
+      <groupId>org.drizzle.jdbc</groupId>
+      <artifactId>drizzle-jdbc</artifactId>
+      <version>1.4</version>
     </dependency>
     <dependency>
       <groupId>com.h2database</groupId>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31860e08/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLConfKey.java
----------------------------------------------------------------------
diff --git a/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLConfKey.java b/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLConfKey.java
index 0bf294a..04f21d7 100644
--- a/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLConfKey.java
+++ b/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLConfKey.java
@@ -25,8 +25,8 @@ import org.apache.kerby.config.ConfigKey;
  * Define all the MySQL backend related configuration items with default values.
  */
 public enum MySQLConfKey implements ConfigKey {
-    MYSQL_DRIVER("com.mysql.jdbc.Driver"),
-    MYSQL_URL("jdbc:mysql://127.0.0.1:3306/mysqlbackend"),
+    MYSQL_DRIVER("org.drizzle.jdbc.DrizzleDriver"),
+    MYSQL_URL("jdbc:mysql:thin://127.0.0.1:3306/mysqlbackend"),
     MYSQL_USER("root"),
     MYSQL_PASSWORD("passwd");
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31860e08/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLIdentityBackend.java
----------------------------------------------------------------------
diff --git a/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLIdentityBackend.java b/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLIdentityBackend.java
index c3784c8..46c0e59 100644
--- a/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLIdentityBackend.java
+++ b/has/has-server/src/main/java/org/apache/kerby/has/server/kdc/MySQLIdentityBackend.java
@@ -130,7 +130,8 @@ public class MySQLIdentityBackend extends AbstractIdentityBackend {
                 + "DEFAULT 1, kdc_flags INTEGER DEFAULT 0, disabled bool "
                 + "DEFAULT NULL, locked bool DEFAULT NULL, expire_time "
                 + "VARCHAR(255) DEFAULT NULL, created_time VARCHAR(255) "
-                + "DEFAULT NULL, PRIMARY KEY (principal) ) ENGINE=INNODB;";
+                + "DEFAULT NULL, PRIMARY KEY (principal) ) ENGINE=INNODB "
+                + "DEFAULT CHARSET=utf8;";
             preIdentity = connection.prepareStatement(stmIdentity);
             preIdentity.executeUpdate();
 
@@ -141,7 +142,7 @@ public class MySQLIdentityBackend extends AbstractIdentityBackend {
                 + "key_value BLOB DEFAULT NULL, principal VARCHAR(255) NOT NULL,"
                 + "PRIMARY KEY (key_id), INDEX (principal), FOREIGN KEY "
                 + "(principal) REFERENCES " + identityTable + "(principal) "
-                + ") ENGINE=INNODB;";
+                + ") ENGINE=INNODB DEFAULT CHARSET=utf8;";
             preKey = connection.prepareStatement(stmKey);
             preKey.executeUpdate();
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31860e08/has/has-server/src/main/java/org/apache/kerby/has/server/web/rest/ConfApi.java
----------------------------------------------------------------------
diff --git a/has/has-server/src/main/java/org/apache/kerby/has/server/web/rest/ConfApi.java b/has/has-server/src/main/java/org/apache/kerby/has/server/web/rest/ConfApi.java
index d113746..10ed7bd 100644
--- a/has/has-server/src/main/java/org/apache/kerby/has/server/web/rest/ConfApi.java
+++ b/has/has-server/src/main/java/org/apache/kerby/has/server/web/rest/ConfApi.java
@@ -107,8 +107,8 @@ public class ConfApi {
     public Response configKdcBackend(
         @QueryParam("backendType") final String backendType,
         @QueryParam("dir") @DefaultValue("/tmp/has/jsonbackend") final String dir,
-        @QueryParam("driver") @DefaultValue("com.mysql.jdbc.Driver") final String driver,
-        @QueryParam("url") @DefaultValue("jdbc:mysql://127.0.0.1:3306/mysqlbackend") final String url,
+        @QueryParam("driver") @DefaultValue("org.drizzle.jdbc.DrizzleDriver") final String driver,
+        @QueryParam("url") @DefaultValue("jdbc:mysql:thin://127.0.0.1:3306/mysqlbackend") final String url,
         @QueryParam("user") @DefaultValue("root") final String user,
         @QueryParam("password") @DefaultValue("passwd") final String password) {
 
@@ -131,7 +131,8 @@ public class ConfApi {
             } else if ("mysql".equals(backendType)) {
                 WebServer.LOG.info("Set MySQL backend...");
                 try {
-                    String mysqlConfig = "mysql_driver = " + driver + "\nmysql_url = " + url
+                    String drizzleUrl = url.replace("jdbc:mysql:", "jdbc:mysql:thin:");
+                    String mysqlConfig = "mysql_driver = " + driver + "\nmysql_url = " + drizzleUrl
                         + "\nmysql_user = " + user + "\nmysql_password = " + password;
                     Map<String, String> values = new HashMap<>();
                     values.put("_JAR_", "org.apache.kerby.has.server.kdc.MySQLIdentityBackend");