ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-8701: JDBC thin: exception no longer thrown if client supplies credentials, but server-side auth is disabled. This closes #4137.
Date Tue, 05 Jun 2018 13:59:18 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 0eda7a290 -> d4ae653d8


IGNITE-8701: JDBC thin: exception no longer thrown if client supplies credentials, but server-side
auth is disabled. This closes #4137.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d4ae653d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d4ae653d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d4ae653d

Branch: refs/heads/master
Commit: d4ae653d8018e88847425111321e653bd558a973
Parents: 0eda7a2
Author: devozerov <vozerov@gridgain.com>
Authored: Tue Jun 5 16:59:07 2018 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Tue Jun 5 16:59:07 2018 +0300

----------------------------------------------------------------------
 .../ignite/jdbc/thin/JdbcThinConnectionSelfTest.java    | 12 ------------
 .../processors/odbc/jdbc/JdbcConnectionContext.java     | 12 +++++++-----
 2 files changed, 7 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d4ae653d/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
index d907c2b..38bcab2 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
@@ -1914,18 +1914,6 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest
{
     }
 
     /**
-     */
-    public void testAuthenticateDisableOnServerClientTryAuthenticate()  {
-        GridTestUtils.assertThrows(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/?user=test&password=test");
-
-                return null;
-            }
-        }, SQLException.class, "Can not perform the operation because the authentication
is not enabled for the cluster");
-    }
-
-    /**
      * @throws Exception If failed.
      */
     public void testMultithreadingException() throws Exception {

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4ae653d/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java
index 391d5f7..278a084 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java
@@ -142,13 +142,15 @@ public class JdbcConnectionContext implements ClientListenerConnectionContext
{
                 String user = reader.readString();
                 String passwd = reader.readString();
 
-                if (F.isEmpty(user) && ctx.authentication().enabled())
-                    throw new IgniteCheckedException("Unauthenticated sessions are prohibited");
+                if (ctx.authentication().enabled()) {
+                    if (F.isEmpty(user))
+                        throw new IgniteCheckedException("Unauthenticated sessions are prohibited");
 
-                actx = ctx.authentication().authenticate(user, passwd);
+                    actx = ctx.authentication().authenticate(user, passwd);
 
-                if (actx == null)
-                    throw new IgniteCheckedException("Unknown authentication error");
+                    if (actx == null)
+                        throw new IgniteCheckedException("Unknown authentication error");
+                }
             }
             else {
                 if (ctx.authentication().enabled())


Mime
View raw message