#gg-9809: Remove secureSession from GridRestProcessor.

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

Branch: refs/heads/sprint-2
Commit: 2131929e314985c95aaadc4ac92feb2688b81e61
Parents: 6289eae
Author: ivasilinets <ivasilin...@gridgain.com>
Authored: Wed Feb 18 12:11:42 2015 +0300
Committer: ivasilinets <ivasilin...@gridgain.com>
Committed: Wed Feb 18 12:11:42 2015 +0300

----------------------------------------------------------------------
 .../processors/rest/GridRestProcessor.java      | 53 --------------------
 1 file changed, 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2131929e/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 fe7a760..47a3ecb 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
@@ -174,15 +174,6 @@ public class GridRestProcessor extends 
GridProcessorAdapter {
 
             GridRestResponse res = new 
GridRestResponse(STATUS_SECURITY_CHECK_FAILED, e.getMessage());
 
-            if (ctx.secureSession().enabled()) {
-                try {
-                    res.sessionTokenBytes(updateSessionToken(req, subjCtx));
-                }
-                catch (IgniteCheckedException e1) {
-                    U.warn(log, "Cannot update response session token: " + 
e1.getMessage());
-                }
-            }
-
             return new GridFinishedFuture<>(ctx, res);
         }
         catch (IgniteCheckedException e) {
@@ -199,8 +190,6 @@ public class GridRestProcessor extends GridProcessorAdapter 
{
             return new GridFinishedFuture<>(ctx,
                 new IgniteCheckedException("Failed to find registered handler 
for command: " + req.command()));
 
-        final GridSecurityContext subjCtx0 = subjCtx;
-
         return res.chain(new C1<IgniteInternalFuture<GridRestResponse>, 
GridRestResponse>() {
             @Override public GridRestResponse 
apply(IgniteInternalFuture<GridRestResponse> f) {
                 GridRestResponse res;
@@ -219,15 +208,6 @@ public class GridRestProcessor extends 
GridProcessorAdapter {
 
                 assert res != null;
 
-                if (ctx.secureSession().enabled()) {
-                    try {
-                        res.sessionTokenBytes(updateSessionToken(req, 
subjCtx0));
-                    }
-                    catch (IgniteCheckedException e) {
-                        U.warn(log, "Cannot update response session token: " + 
e.getMessage());
-                    }
-                }
-
                 interceptResponse(res, req);
 
                 return res;
@@ -458,20 +438,6 @@ public class GridRestProcessor extends 
GridProcessorAdapter {
      * @throws IgniteCheckedException If authentication failed.
      */
     private GridSecurityContext authenticate(GridRestRequest req) throws 
IgniteCheckedException {
-        UUID clientId = req.clientId();
-
-        byte[] sesTok = req.sessionToken();
-
-        // Validate session.
-        if (sesTok != null) {
-            // Session is still valid.
-            GridSecureSession ses = 
ctx.secureSession().validateSession(REMOTE_CLIENT, clientId, sesTok, null);
-
-            if (ses != null)
-                // Session is still valid.
-                return ses.authenticationSubjectContext();
-        }
-
         // Authenticate client if invalid session.
         AuthenticationContext authCtx = new AuthenticationContext();
 
@@ -514,25 +480,6 @@ public class GridRestProcessor extends 
GridProcessorAdapter {
     }
 
     /**
-     * Update session token to actual state.
-     *
-     * @param req Grid est request.
-     * @param subjCtx Authentication subject context.
-     * @return Valid session token.
-     * @throws IgniteCheckedException If session token update process failed.
-     */
-    private byte[] updateSessionToken(GridRestRequest req, GridSecurityContext 
subjCtx) throws IgniteCheckedException {
-        // Update token from request to actual state.
-        byte[] sesTok = ctx.secureSession().updateSession(REMOTE_CLIENT, 
req.clientId(), subjCtx, null);
-
-        // Validate token has been created.
-        if (sesTok == null)
-            throw new IgniteCheckedException("Cannot create session token (is 
secure session SPI set?).");
-
-        return sesTok;
-    }
-
-    /**
      * @param req REST request.
      * @param sCtx Security context.
      * @throws GridSecurityException If authorization failed.

Reply via email to