ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-8201 Fixed tests.
Date Thu, 12 Apr 2018 03:32:43 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-8201 4ba2436f6 -> 3316080a6


IGNITE-8201 Fixed tests.


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

Branch: refs/heads/ignite-8201
Commit: 3316080a67edb27a7ee6c35dcd2579be8ecc8dcb
Parents: 4ba2436
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Apr 12 10:32:31 2018 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Apr 12 10:32:31 2018 +0700

----------------------------------------------------------------------
 .../processors/rest/GridRestProcessor.java         |  9 +++------
 .../auth/AuthenticationCommandHandler.java         |  2 --
 .../protocols/http/jetty/GridJettyRestHandler.java | 17 +++++++----------
 3 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3316080a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index c7a74c5..205fb73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -344,7 +344,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
 
                 assert res != null;
 
-                if ((ctx.authentication().enabled() || ctx.security().enabled()) &&
!failed)
+                if ((authenticationEnabled || securityEnabled) && !failed)
                     res.sessionTokenBytes(req.sessionToken());
 
                 interceptResponse(res, req);
@@ -457,10 +457,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
         try {
             sesExpTime = System.getProperty(IgniteSystemProperties.IGNITE_REST_SESSION_TIMEOUT);
 
-            if (sesExpTime != null)
-                sesExpTime0 = Long.valueOf(sesExpTime) * 1000;
-            else
-                sesExpTime0 = DEFAULT_SES_TIMEOUT;
+            sesExpTime0 = sesExpTime != null ? Long.valueOf(sesExpTime) * 1000 : DEFAULT_SES_TIMEOUT;
         }
         catch (NumberFormatException ignore) {
             U.warn(log, "Failed parsing IGNITE_REST_SESSION_TIMEOUT system variable [IGNITE_REST_SESSION_TIMEOUT="
@@ -510,8 +507,8 @@ public class GridRestProcessor extends GridProcessorAdapter {
             addHandler(new QueryCommandHandler(ctx));
             addHandler(new GridLogCommandHandler(ctx));
             addHandler(new GridChangeStateCommandHandler(ctx));
-            addHandler(new UserActionCommandHandler(ctx));
             addHandler(new AuthenticationCommandHandler(ctx));
+            addHandler(new UserActionCommandHandler(ctx));
 
             // Start protocols.
             startTcpProtocol();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3316080a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java
index 0cecf3d..6016338 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java
@@ -57,8 +57,6 @@ public class AuthenticationCommandHandler extends GridRestCommandHandlerAdapter
             log.debug("Handling topology REST request: " + req);
 
         try {
-            GridRestCommand cmd = req.command();
-
             if (log.isDebugEnabled())
                 log.debug("Handled topology REST request [req=" + req + ']');
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3316080a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
index 7f20dca..1afdae1 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
@@ -69,7 +69,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES_MASK;
-import static org.apache.ignite.internal.processors.rest.GridRestCommand.AUTHENTICATE;
 import static org.apache.ignite.internal.processors.rest.GridRestCommand.CACHE_CONTAINS_KEYS;
 import static org.apache.ignite.internal.processors.rest.GridRestCommand.CACHE_GET_ALL;
 import static org.apache.ignite.internal.processors.rest.GridRestCommand.CACHE_PUT_ALL;
@@ -107,11 +106,11 @@ public class GridJettyRestHandler extends AbstractHandler {
     /** */
     private static final String WRITE_SYNCHRONIZATION_MODE_PARAM = "writeSynchronizationMode";
 
-    /** @deprecated Use USER_PARAM instead. */
-    private static final String IGNITE_LOGIN_PARAM = "ignite.login";
+    /**@deprecated Should be replaced with AUTHENTICATION + token in IGNITE 3.0 */
+    private static final String IGNITE_LOGIN = "ignite.login";
 
-    /** @deprecated Use PWD_PARAM instead. */
-    private static final String IGNITE_PASSWORD_PARAM = "ignite.password";
+    /**@deprecated Should be replaced with AUTHENTICATION + token in IGNITE 3.0 */
+    private static final String IGNITE_PASSWORD = "ignite.password";
 
     /** */
     private static final String  TEMPLATE_NAME_PARAM = "templateName";
@@ -853,11 +852,9 @@ public class GridJettyRestHandler extends AbstractHandler {
 
         restReq.command(cmd);
 
-        // Check credentials only for AUTHENTICATE command.
-        if (cmd == AUTHENTICATE) {
-            if (!credentials(params, USER_PARAM, PWD_PARAM, restReq))
-                credentials(params, IGNITE_LOGIN_PARAM, IGNITE_PASSWORD_PARAM, restReq);
-        }
+        // TODO: In IGNITE 3.0 we should check credentials only for AUTHENTICATE command.
+        if (!credentials(params, IGNITE_LOGIN, IGNITE_PASSWORD, restReq))
+            credentials(params, USER_PARAM, PWD_PARAM, restReq);
 
         String clientId = (String)params.get("clientId");
 


Mime
View raw message