ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/5] incubator-ignite git commit: #ignite-189: move GridAllowAllPermissionSet to org.gridgain.grid.kernal.processors.security.
Date Fri, 13 Feb 2015 08:50:23 GMT
#ignite-189: move GridAllowAllPermissionSet to org.gridgain.grid.kernal.processors.security.


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

Branch: refs/heads/ignite-189
Commit: 85c5b69a142406355ef447ed9133a3a7a8d4f8c6
Parents: f9f7134
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 13 10:51:20 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 13 10:51:20 2015 +0300

----------------------------------------------------------------------
 .../security/GridAllowAllPermissionSet.java     | 55 --------------------
 .../security/os/GridOsSecurityProcessor.java    | 25 ++++++++-
 .../discovery/AbstractDiscoverySelfTest.java    |  2 +-
 .../tcp/TcpDiscoverySpiStartStopSelfTest.java   |  2 +-
 .../junits/spi/GridSpiAbstractTest.java         | 32 +++++++++++-
 5 files changed, 57 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/85c5b69a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridAllowAllPermissionSet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridAllowAllPermissionSet.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridAllowAllPermissionSet.java
deleted file mode 100644
index e4059d1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridAllowAllPermissionSet.java
+++ /dev/null
@@ -1,55 +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.processors.security;
-
-import org.apache.ignite.plugin.security.*;
-
-import java.util.*;
-
-/**
-* Allow all permission set.
-*/
-public class GridAllowAllPermissionSet implements GridSecurityPermissionSet {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public boolean defaultAllowAll() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Map<String, Collection<GridSecurityPermission>> taskPermissions()
{
-        return Collections.emptyMap();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Map<String, Collection<GridSecurityPermission>> cachePermissions()
{
-        return Collections.emptyMap();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<GridSecurityPermission> systemPermissions() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    public String toString() {
-        return getClass().getSimpleName();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/85c5b69a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
index 0a6f21c..dafe907 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
@@ -41,7 +41,30 @@ public class GridOsSecurityProcessor extends GridNoopProcessorAdapter implements
     }
 
     /** Allow all permissions. */
-    private static final GridSecurityPermissionSet ALLOW_ALL = new GridAllowAllPermissionSet();
+    private static final GridSecurityPermissionSet ALLOW_ALL = new GridSecurityPermissionSet()
{
+        /** Serial version uid. */
+        private static final long serialVersionUID = 0L;
+
+        /** {@inheritDoc} */
+        @Override public boolean defaultAllowAll() {
+            return true;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<String, Collection<GridSecurityPermission>> taskPermissions()
{
+            return Collections.emptyMap();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<String, Collection<GridSecurityPermission>> cachePermissions()
{
+            return Collections.emptyMap();
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public Collection<GridSecurityPermission> systemPermissions()
{
+            return null;
+        }
+    };
 
     /** {@inheritDoc} */
     @Override public GridSecurityContext authenticateNode(ClusterNode node, GridSecurityCredentials
cred)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/85c5b69a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
index b7c507b..45faeaf 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
@@ -394,7 +394,7 @@ public abstract class AbstractDiscoverySelfTest<T extends IgniteSpi>
extends Gri
                         GridSecuritySubjectAdapter subj = new GridSecuritySubjectAdapter(
                             GridSecuritySubjectType.REMOTE_NODE, n.id());
 
-                        subj.permissions(new GridAllowAllPermissionSet());
+                        subj.permissions(getAllPermissionSet());
 
                         return new GridSecurityContext(subj);
                     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/85c5b69a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
index 63d9f25..4a06c10 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
@@ -69,7 +69,7 @@ public class TcpDiscoverySpiStartStopSelfTest extends GridSpiStartStopAbstractTe
                 GridSecuritySubjectAdapter subj = new GridSecuritySubjectAdapter(
                     GridSecuritySubjectType.REMOTE_NODE, n.id());
 
-                subj.permissions(new GridAllowAllPermissionSet());
+                subj.permissions(getAllPermissionSet());
 
                 return new GridSecurityContext(subj);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/85c5b69a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
index 50a39e0..55917ea 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
@@ -96,6 +96,36 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends
GridAbstr
     }
 
     /**
+     * @return Allow all permission security set.
+     */
+    protected GridSecurityPermissionSet getAllPermissionSet() {
+        return new GridSecurityPermissionSet() {
+            /** Serial version uid. */
+            private static final long serialVersionUID = 0L;
+
+            /** {@inheritDoc} */
+            @Override public boolean defaultAllowAll() {
+                return true;
+            }
+
+            /** {@inheritDoc} */
+            @Override public Map<String, Collection<GridSecurityPermission>>
taskPermissions() {
+                return Collections.emptyMap();
+            }
+
+            /** {@inheritDoc} */
+            @Override public Map<String, Collection<GridSecurityPermission>>
cachePermissions() {
+                return Collections.emptyMap();
+            }
+
+            /** {@inheritDoc} */
+            @Nullable @Override public Collection<GridSecurityPermission> systemPermissions()
{
+                return null;
+            }
+        };
+    }
+
+    /**
      * @throws Exception If failed.
      */
     private void resetTestData() throws Exception {
@@ -322,7 +352,7 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends
GridAbstr
                 GridSecuritySubjectAdapter subj = new GridSecuritySubjectAdapter(
                     GridSecuritySubjectType.REMOTE_NODE, n.id());
 
-                subj.permissions(new GridAllowAllPermissionSet());
+                subj.permissions(getAllPermissionSet());
 
                 return new GridSecurityContext(subj);
             }


Mime
View raw message