ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] incubator-ignite git commit: #ignite-189: GridSecurityManager from GridManager to GridProcessor.
Date Tue, 10 Feb 2015 17:09:25 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-189 [created] 98e41f155


#ignite-189: GridSecurityManager from GridManager to GridProcessor.


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

Branch: refs/heads/ignite-189
Commit: d42453e9260c701b14edf7e3538efeb9820d3edc
Parents: 4e60207
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Feb 10 15:15:58 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Feb 10 15:15:58 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/GridKernalContext.java      |   4 +-
 .../ignite/internal/GridKernalContextImpl.java  |  18 ++--
 .../apache/ignite/internal/IgniteKernal.java    |   5 +-
 .../managers/GridNoopManagerAdapter.java        |  10 +-
 .../securesession/GridSecureSessionManager.java |  54 ----------
 .../GridSecureSessionProcessor.java             |  60 +++++++++++
 .../os/GridOsSecureSessionManager.java          |  56 ----------
 .../os/GridOsSecureSessionProcessor.java        |  61 +++++++++++
 .../managers/security/GridSecurityImpl.java     |   8 +-
 .../managers/security/GridSecurityManager.java  |  93 -----------------
 .../security/GridSecurityProcessor.java         |  99 ++++++++++++++++++
 .../security/os/GridOsSecurityManager.java      |  97 ------------------
 .../security/os/GridOsSecurityProcessor.java    | 102 +++++++++++++++++++
 13 files changed, 343 insertions(+), 324 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index 152cfa6..02b036a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -394,14 +394,14 @@ public interface GridKernalContext extends Iterable<GridComponent>
{
      *
      * @return Authentication manager.
      */
-    public GridSecurityManager security();
+    public GridSecurityProcessor security();
 
     /**
      * Gets secure session manager.
      *
      * @return Secure session manager.
      */
-    public GridSecureSessionManager secureSession();
+    public GridSecureSessionProcessor secureSession();
 
     /**
      * Gets load balancing manager.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 3bd3f7c..8e5b65c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -127,11 +127,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
-    private GridSecurityManager authMgr;
+    private GridSecurityProcessor authProc;
 
     /** */
     @GridToStringExclude
-    private GridSecureSessionManager sesMgr;
+    private GridSecureSessionProcessor sesMgr;
 
     /** */
     @GridToStringExclude
@@ -416,10 +416,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
             failoverMgr = (GridFailoverManager)comp;
         else if (comp instanceof GridCollisionManager)
             colMgr = (GridCollisionManager)comp;
-        else if (comp instanceof GridSecurityManager)
-            authMgr = (GridSecurityManager)comp;
-        else if (comp instanceof GridSecureSessionManager)
-            sesMgr = (GridSecureSessionManager)comp;
+        else if (comp instanceof GridSecurityProcessor)
+            authProc = (GridSecurityProcessor)comp;
+        else if (comp instanceof GridSecureSessionProcessor)
+            sesMgr = (GridSecureSessionProcessor)comp;
         else if (comp instanceof GridLoadBalancerManager)
             loadMgr = (GridLoadBalancerManager)comp;
         else if (comp instanceof GridSwapSpaceManager)
@@ -652,12 +652,12 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     }
 
     /** {@inheritDoc} */
-    @Override public GridSecurityManager security() {
-        return authMgr;
+    @Override public GridSecurityProcessor security() {
+        return authProc;
     }
 
     /** {@inheritDoc} */
-    @Override public GridSecureSessionManager secureSession() {
+    @Override public GridSecureSessionProcessor secureSession() {
         return sesMgr;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index d2dced1..5616806 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -725,8 +725,9 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
 
             // Start SPI managers.
             // NOTE: that order matters as there are dependencies between managers.
-            startManager(ctx, createComponent(GridSecurityManager.class, ctx), attrs);
-            startManager(ctx, createComponent(GridSecureSessionManager.class, ctx), attrs);
+            startProcessor(ctx, createComponent(GridSecurityProcessor.class, ctx), attrs);
+            startProcessor(ctx, createComponent(GridSecureSessionProcessor.class, ctx), attrs);
+
             startManager(ctx, new GridIoManager(ctx), attrs);
             startManager(ctx, new GridCheckpointManager(ctx), attrs);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/GridNoopManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridNoopManagerAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridNoopManagerAdapter.java
index c933c60..9d8c270 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridNoopManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridNoopManagerAdapter.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.managers;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.spi.*;
 import org.jetbrains.annotations.*;
 
@@ -28,7 +29,7 @@ import java.util.*;
 /**
  * No-op {@link GridManager} adapter.
  */
-public class GridNoopManagerAdapter implements GridManager {
+public class GridNoopManagerAdapter implements GridProcessor {
     /**
      * @param ctx Kernal context.
      */
@@ -37,16 +38,11 @@ public class GridNoopManagerAdapter implements GridManager {
     }
 
     /** {@inheritDoc} */
-    @Override public void addSpiAttributes(Map<String, Object> attrs) throws IgniteCheckedException
{
+    @Override public void addAttributes(Map<String, Object> attrs) throws IgniteCheckedException
{
         // No-op.
     }
 
     /** {@inheritDoc} */
-    @Override public boolean enabled() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
     @Override public void start() throws IgniteCheckedException {
         // No-op.
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionManager.java
deleted file mode 100644
index 86016b1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionManager.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.managers.securesession;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.managers.*;
-import org.apache.ignite.internal.managers.security.*;
-import org.apache.ignite.plugin.security.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * This interface defines a grid secure session manager.
- */
-public interface GridSecureSessionManager extends GridManager {
-    /**
-     * @param subjType Subject type.
-     * @param subjId Subject ID.
-     * @param tok Token.
-     * @param params Parameters.
-     * @return Validated secure session or {@code null} if session is not valid.
-     * @throws IgniteCheckedException If error occurred.
-     */
-    public GridSecureSession validateSession(GridSecuritySubjectType subjType, UUID subjId,
@Nullable byte[] tok,
-        @Nullable Object params) throws IgniteCheckedException;
-
-    /**
-     * Generates secure session token.
-     *
-     * @param subjType Subject type.
-     * @param subjId Subject ID.
-     * @param subjCtx Authentication subject context.
-     * @param params Params.
-     * @return Generated session token.
-     */
-    public byte[] updateSession(GridSecuritySubjectType subjType, UUID subjId, GridSecurityContext
subjCtx,
-        @Nullable Object params) throws IgniteCheckedException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionProcessor.java
new file mode 100644
index 0000000..5921c70
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/GridSecureSessionProcessor.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.managers.securesession;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.managers.security.*;
+import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.plugin.security.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * This interface defines a grid secure session manager.
+ */
+public interface GridSecureSessionProcessor extends GridProcessor {
+    /**
+     * @param subjType Subject type.
+     * @param subjId Subject ID.
+     * @param tok Token.
+     * @param params Parameters.
+     * @return Validated secure session or {@code null} if session is not valid.
+     * @throws IgniteCheckedException If error occurred.
+     */
+    public GridSecureSession validateSession(GridSecuritySubjectType subjType, UUID subjId,
@Nullable byte[] tok,
+        @Nullable Object params) throws IgniteCheckedException;
+
+    /**
+     * Generates secure session token.
+     *
+     * @param subjType Subject type.
+     * @param subjId Subject ID.
+     * @param subjCtx Authentication subject context.
+     * @param params Params.
+     * @return Generated session token.
+     */
+    public byte[] updateSession(GridSecuritySubjectType subjType, UUID subjId, GridSecurityContext
subjCtx,
+        @Nullable Object params) throws IgniteCheckedException;
+
+    /**
+     * @return Returns {@code true} if at least one SPI does not have a {@code NO-OP}
+     *      implementation, {@code false} otherwise.
+     */
+    public boolean enabled();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionManager.java
deleted file mode 100644
index d8b562a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionManager.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.managers.securesession.os;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.*;
-import org.apache.ignite.internal.managers.securesession.*;
-import org.apache.ignite.internal.managers.security.*;
-import org.apache.ignite.plugin.security.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * No-op implementation for {@link GridSecureSessionManager}.
- */
-public class GridOsSecureSessionManager extends GridNoopManagerAdapter implements GridSecureSessionManager
{
-    /** Empty bytes. */
-    private static final byte[] EMPTY_BYTES = new byte[0];
-
-    /**
-     * @param ctx Kernal context.
-     */
-    public GridOsSecureSessionManager(GridKernalContext ctx) {
-        super(ctx);
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridSecureSession validateSession(GridSecuritySubjectType subjType,
UUID subjId,
-        @Nullable byte[] tok,
-        @Nullable Object params) throws IgniteCheckedException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] updateSession(GridSecuritySubjectType subjType, UUID subjId,
GridSecurityContext subjCtx,
-        @Nullable Object params) {
-        return EMPTY_BYTES;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionProcessor.java
new file mode 100644
index 0000000..187316e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/securesession/os/GridOsSecureSessionProcessor.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.managers.securesession.os;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.managers.*;
+import org.apache.ignite.internal.managers.securesession.*;
+import org.apache.ignite.internal.managers.security.*;
+import org.apache.ignite.plugin.security.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * No-op implementation for {@link org.apache.ignite.internal.managers.securesession.GridSecureSessionProcessor}.
+ */
+public class GridOsSecureSessionProcessor extends GridNoopManagerAdapter implements GridSecureSessionProcessor
{
+    /** Empty bytes. */
+    private static final byte[] EMPTY_BYTES = new byte[0];
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public GridOsSecureSessionProcessor(GridKernalContext ctx) {
+        super(ctx);
+    }
+
+    /** {@inheritDoc} */
+    @Override public GridSecureSession validateSession(GridSecuritySubjectType subjType,
UUID subjId,
+        @Nullable byte[] tok,
+        @Nullable Object params) throws IgniteCheckedException {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] updateSession(GridSecuritySubjectType subjType, UUID subjId,
GridSecurityContext subjCtx,
+        @Nullable Object params) {
+        return EMPTY_BYTES;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean enabled() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityImpl.java
index 8b1edf7..1aa4e9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityImpl.java
@@ -33,7 +33,7 @@ public class GridSecurityImpl implements GridSecurity, Externalizable {
     private static final long serialVersionUID = 0L;
 
     /** Security manager. */
-    private GridSecurityManager secMgr;
+    private GridSecurityProcessor secProc;
 
     /** Context. */
     private GridKernalContext ctx;
@@ -49,14 +49,14 @@ public class GridSecurityImpl implements GridSecurity, Externalizable
{
      * @param ctx Context.
      */
     public GridSecurityImpl(GridKernalContext ctx) {
-        this.secMgr = ctx.security();
+        this.secProc = ctx.security();
         this.ctx = ctx;
     }
 
     /** {@inheritDoc} */
     @Override public Collection<GridSecuritySubject> authenticatedSubjects() throws
IgniteException {
         try {
-            return secMgr.authenticatedSubjects();
+            return secProc.authenticatedSubjects();
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -66,7 +66,7 @@ public class GridSecurityImpl implements GridSecurity, Externalizable {
     /** {@inheritDoc} */
     @Override public GridSecuritySubject authenticatedSubject(UUID subjId) throws IgniteException
{
         try {
-            return secMgr.authenticatedSubject(subjId);
+            return secProc.authenticatedSubject(subjId);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityManager.java
deleted file mode 100644
index e743dc4..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityManager.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.managers.security;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.managers.*;
-import org.apache.ignite.plugin.security.*;
-import org.apache.ignite.spi.authentication.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * This interface defines a grid authentication manager.
- */
-public interface GridSecurityManager extends GridManager {
-    /**
-     * Authenticates grid node with it's attributes via underlying {@link org.apache.ignite.spi.authentication.AuthenticationSpi}s.
-     *
-     * @param node Node id to authenticate.
-     * @param cred Security credentials.
-     * @return {@code True} if succeeded, {@code false} otherwise.
-     * @throws IgniteCheckedException If error occurred.
-     */
-    public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials
cred) throws IgniteCheckedException;
-
-    /**
-     * Gets flag indicating whether all nodes or coordinator only should run the authentication
for joining node.
-     *
-     * @return {@code True} if all nodes should run authentication process, {@code false}
otherwise.
-     */
-    public boolean isGlobalNodeAuthentication();
-
-    /**
-     * Authenticates subject via underlying {@link org.apache.ignite.spi.authentication.AuthenticationSpi}s.
-     *
-     * @param ctx Authentication context.
-     * @return {@code True} if succeeded, {@code false} otherwise.
-     * @throws IgniteCheckedException If error occurred.
-     */
-    public GridSecurityContext authenticate(AuthenticationContext ctx) throws IgniteCheckedException;
-
-    /**
-     * Gets collection of authenticated nodes.
-     *
-     * @return Collection of authenticated nodes.
-     * @throws IgniteCheckedException If error occurred.
-     */
-    public Collection<GridSecuritySubject> authenticatedSubjects() throws IgniteCheckedException;
-
-    /**
-     * Gets authenticated node subject.
-     *
-     * @param subjId Subject ID.
-     * @return Security subject.
-     * @throws IgniteCheckedException If error occurred.
-     */
-    public GridSecuritySubject authenticatedSubject(UUID subjId) throws IgniteCheckedException;
-
-    /**
-     * Authorizes grid operation.
-     *
-     * @param name Cache name or task class name.
-     * @param perm Permission to authorize.
-     * @param securityCtx Optional security context.
-     * @throws GridSecurityException If security check failed.
-     */
-    public void authorize(String name, GridSecurityPermission perm, @Nullable GridSecurityContext
securityCtx)
-        throws GridSecurityException;
-
-    /**
-     * Callback invoked when subject session got expired.
-     *
-     * @param subjId Subject ID.
-     */
-    public void onSessionExpired(UUID subjId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
new file mode 100644
index 0000000..8a91c05
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.managers.security;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.spi.authentication.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * This interface defines a grid authentication manager.
+ */
+public interface GridSecurityProcessor extends GridProcessor {
+    /**
+     * Authenticates grid node with it's attributes via underlying {@link org.apache.ignite.spi.authentication.AuthenticationSpi}s.
+     *
+     * @param node Node id to authenticate.
+     * @param cred Security credentials.
+     * @return {@code True} if succeeded, {@code false} otherwise.
+     * @throws IgniteCheckedException If error occurred.
+     */
+    public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials
cred) throws IgniteCheckedException;
+
+    /**
+     * Gets flag indicating whether all nodes or coordinator only should run the authentication
for joining node.
+     *
+     * @return {@code True} if all nodes should run authentication process, {@code false}
otherwise.
+     */
+    public boolean isGlobalNodeAuthentication();
+
+    /**
+     * Authenticates subject via underlying {@link org.apache.ignite.spi.authentication.AuthenticationSpi}s.
+     *
+     * @param ctx Authentication context.
+     * @return {@code True} if succeeded, {@code false} otherwise.
+     * @throws IgniteCheckedException If error occurred.
+     */
+    public GridSecurityContext authenticate(AuthenticationContext ctx) throws IgniteCheckedException;
+
+    /**
+     * Gets collection of authenticated nodes.
+     *
+     * @return Collection of authenticated nodes.
+     * @throws IgniteCheckedException If error occurred.
+     */
+    public Collection<GridSecuritySubject> authenticatedSubjects() throws IgniteCheckedException;
+
+    /**
+     * Gets authenticated node subject.
+     *
+     * @param subjId Subject ID.
+     * @return Security subject.
+     * @throws IgniteCheckedException If error occurred.
+     */
+    public GridSecuritySubject authenticatedSubject(UUID subjId) throws IgniteCheckedException;
+
+    /**
+     * Authorizes grid operation.
+     *
+     * @param name Cache name or task class name.
+     * @param perm Permission to authorize.
+     * @param securityCtx Optional security context.
+     * @throws GridSecurityException If security check failed.
+     */
+    public void authorize(String name, GridSecurityPermission perm, @Nullable GridSecurityContext
securityCtx)
+        throws GridSecurityException;
+
+    /**
+     * Callback invoked when subject session got expired.
+     *
+     * @param subjId Subject ID.
+     */
+    public void onSessionExpired(UUID subjId);
+
+    /**
+     * @return Returns {@code true} if at least one SPI does not have a {@code NO-OP}
+     *      implementation, {@code false} otherwise.
+     */
+    public boolean enabled();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityManager.java
deleted file mode 100644
index 7cbc1d2..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityManager.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.managers.security.os;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.*;
-import org.apache.ignite.internal.managers.security.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.plugin.security.*;
-import org.apache.ignite.spi.authentication.*;
-import org.jetbrains.annotations.*;
-
-import java.net.*;
-import java.util.*;
-
-/**
- * No-op implementation for {@link GridSecurityManager}.
- */
-public class GridOsSecurityManager extends GridNoopManagerAdapter implements GridSecurityManager
{
-    /**
-     * @param ctx Kernal context.
-     */
-    public GridOsSecurityManager(GridKernalContext ctx) {
-        super(ctx);
-    }
-
-    /** Allow all permissions. */
-    private static final GridSecurityPermissionSet ALLOW_ALL = new GridAllowAllPermissionSet();
-
-    /** {@inheritDoc} */
-    @Override public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials
cred)
-        throws IgniteCheckedException {
-        GridSecuritySubjectAdapter s = new GridSecuritySubjectAdapter(GridSecuritySubjectType.REMOTE_NODE,
node.id());
-
-        s.address(new InetSocketAddress(F.first(node.addresses()), 0));
-
-        s.permissions(ALLOW_ALL);
-
-        return new GridSecurityContext(s);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isGlobalNodeAuthentication() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridSecurityContext authenticate(AuthenticationContext authCtx) throws
IgniteCheckedException {
-        GridSecuritySubjectAdapter s = new GridSecuritySubjectAdapter(authCtx.subjectType(),
authCtx.subjectId());
-
-        s.permissions(ALLOW_ALL);
-        s.address(authCtx.address());
-
-        if (authCtx.credentials() != null)
-            s.login(authCtx.credentials().getLogin());
-
-        return new GridSecurityContext(s);
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<GridSecuritySubject> authenticatedSubjects() {
-        return Collections.emptyList();
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridSecuritySubject authenticatedSubject(UUID nodeId) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void authorize(String name, GridSecurityPermission perm, @Nullable GridSecurityContext
securityCtx)
-        throws GridSecurityException {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
-    @Override public void onSessionExpired(UUID subjId) {
-        // No-op.
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d42453e9/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityProcessor.java
new file mode 100644
index 0000000..62ebd67
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/os/GridOsSecurityProcessor.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.managers.security.os;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.managers.*;
+import org.apache.ignite.internal.managers.security.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.spi.authentication.*;
+import org.jetbrains.annotations.*;
+
+import java.net.*;
+import java.util.*;
+
+/**
+ * No-op implementation for {@link GridSecurityProcessor}.
+ */
+public class GridOsSecurityProcessor extends GridNoopManagerAdapter implements GridSecurityProcessor
{
+    /**
+     * @param ctx Kernal context.
+     */
+    public GridOsSecurityProcessor(GridKernalContext ctx) {
+        super(ctx);
+    }
+
+    /** Allow all permissions. */
+    private static final GridSecurityPermissionSet ALLOW_ALL = new GridAllowAllPermissionSet();
+
+    /** {@inheritDoc} */
+    @Override public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials
cred)
+        throws IgniteCheckedException {
+        GridSecuritySubjectAdapter s = new GridSecuritySubjectAdapter(GridSecuritySubjectType.REMOTE_NODE,
node.id());
+
+        s.address(new InetSocketAddress(F.first(node.addresses()), 0));
+
+        s.permissions(ALLOW_ALL);
+
+        return new GridSecurityContext(s);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isGlobalNodeAuthentication() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public GridSecurityContext authenticate(AuthenticationContext authCtx) throws
IgniteCheckedException {
+        GridSecuritySubjectAdapter s = new GridSecuritySubjectAdapter(authCtx.subjectType(),
authCtx.subjectId());
+
+        s.permissions(ALLOW_ALL);
+        s.address(authCtx.address());
+
+        if (authCtx.credentials() != null)
+            s.login(authCtx.credentials().getLogin());
+
+        return new GridSecurityContext(s);
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<GridSecuritySubject> authenticatedSubjects() {
+        return Collections.emptyList();
+    }
+
+    /** {@inheritDoc} */
+    @Override public GridSecuritySubject authenticatedSubject(UUID nodeId) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void authorize(String name, GridSecurityPermission perm, @Nullable GridSecurityContext
securityCtx)
+        throws GridSecurityException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onSessionExpired(UUID subjId) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean enabled() {
+        return false;
+    }
+}


Mime
View raw message