Corrected fix for REST processor wrt authentication
@@ -243,7 +243,6 @@ public class GridRestProcessor extends GridProcessorAdapter {
SecurityContext secCtx0 = ses.secCtx;
- if (ctx.state().publicApiActiveState() || !isClusterActivateTaskRequest(req)) {
try {
if (secCtx0 == null)
ses.secCtx = secCtx0 = authenticate(req);
@@ -261,7 +260,6 @@ public class GridRestProcessor extends GridProcessorAdapter {
return new GridFinishedFuture<>(new GridRestResponse(STATUS_AUTH_FAILED, e.getMessage()));
}
}
- }
interceptRequest(req);
@@ -320,25 +318,6 @@ public class GridRestProcessor extends GridProcessorAdapter {
});
}
- /**
- * We skip authentication for activate cluster request.
- * It's necessary workaround to make possible cluster activation through Visor,
- * as security checks require working caches.
- *
- * @param req Request.
- */
- private boolean isClusterActivateTaskRequest(GridRestRequest req) {
- if (req instanceof GridRestTaskRequest) {
- GridRestTaskRequest taskReq = (GridRestTaskRequest)req;
-
- if (VisorGatewayTask.class.getCanonicalName().equals(taskReq.taskName()) &&
- taskReq.params().contains(VisorChangeGridActiveStateTask.class.getCanonicalName()))
- return true;
- }
-
- return false;
- }
-
/**
* @param req Request.
* @return Not null session.
