diff --git a/pom.xml b/pom.xml
index 2ea4735bf..a4f2bcc14 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,7 +55,6 @@ limitations under the License.
1.7
1.0b3
- 0.7.1.RELEASE
1.8
2.2
1.2
@@ -75,6 +74,7 @@ limitations under the License.
1.8.8
3.0.1
8.1.19.v20160209
+ 7.6.0.v20120127
2.5
4.10
0.9.3
@@ -120,11 +120,6 @@ limitations under the License.
commons-logging
${commons.logging.version}
-
- com.jolbox
- bonecp
- ${bonecp.version}
-
org.apache.derby
derby
@@ -423,6 +418,21 @@ limitations under the License.
sentry-binding-kafka
${project.version}
+
+ org.apache.sentry
+ sentry-service-common
+ ${project.version}
+
+
+ org.apache.sentry
+ sentry-service-server
+ ${project.version}
+
+
+ org.apache.sentry
+ sentry-service-client
+ ${project.version}
+
org.apache.sentry
sentry-provider-common
@@ -465,7 +475,7 @@ limitations under the License.
org.apache.sentry
- sentry-provider-db
+ sentry-service-server
${project.version}
test-jar
@@ -615,11 +625,17 @@ limitations under the License.
jetty-servlet
${jettyVersion}
+
+ org.eclipse.jetty.aggregate
+ jetty-all
+ ${jetty.aggregate}
+
sentry-core
+ sentry-service
sentry-binding
sentry-provider
sentry-policy
diff --git a/sentry-binding/sentry-binding-hive-common/pom.xml b/sentry-binding/sentry-binding-hive-common/pom.xml
index 18b422d5a..685df0c51 100644
--- a/sentry-binding/sentry-binding-hive-common/pom.xml
+++ b/sentry-binding/sentry-binding-hive-common/pom.xml
@@ -54,23 +54,19 @@ limitations under the License.
org.apache.sentry
- sentry-core-common
+ sentry-core-model-db
org.apache.sentry
- sentry-core-model-db
+ sentry-service-client
org.apache.sentry
- sentry-provider-common
+ sentry-policy-engine
org.apache.sentry
- sentry-provider-file
-
-
- org.apache.sentry
- sentry-provider-cache
+ sentry-provider-cache
org.apache.hadoop
diff --git a/sentry-binding/sentry-binding-hive-v2/pom.xml b/sentry-binding/sentry-binding-hive-v2/pom.xml
index b5135bf31..e6df18ab7 100644
--- a/sentry-binding/sentry-binding-hive-v2/pom.xml
+++ b/sentry-binding/sentry-binding-hive-v2/pom.xml
@@ -109,26 +109,6 @@ limitations under the License.
${hive-v2.version}
provided
-
- org.apache.sentry
- sentry-core-common
-
-
- org.apache.sentry
- sentry-core-model-db
-
-
- org.apache.sentry
- sentry-provider-common
-
-
- org.apache.sentry
- sentry-provider-file
-
-
- org.apache.sentry
- sentry-policy-db
-
org.apache.hadoop
hadoop-common
diff --git a/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryAccessController.java b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryAccessController.java
index 57de2ac5a..402d48f70 100644
--- a/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryAccessController.java
+++ b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryAccessController.java
@@ -36,7 +36,8 @@
import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject;
import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveRoleGrant;
import org.apache.hadoop.hive.ql.session.SessionState;
-import org.apache.sentry.SentryUserException;
+import org.apache.sentry.core.common.exception.SentryUserException;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.binding.hive.SentryOnFailureHookContext;
import org.apache.sentry.binding.hive.SentryOnFailureHookContextImpl;
import org.apache.sentry.binding.hive.authz.HiveAuthzBinding;
@@ -49,7 +50,6 @@
import org.apache.sentry.core.model.db.AccessConstants;
import org.apache.sentry.core.model.db.DBModelAuthorizable;
import org.apache.sentry.core.model.db.Server;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege;
import org.apache.sentry.provider.db.service.thrift.TSentryRole;
diff --git a/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/metastore/MetastoreAuthzBindingV2.java b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/metastore/MetastoreAuthzBindingV2.java
index fe629fcd0..7c1de14a4 100644
--- a/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/metastore/MetastoreAuthzBindingV2.java
+++ b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/metastore/MetastoreAuthzBindingV2.java
@@ -28,7 +28,7 @@
import org.apache.hadoop.hive.metastore.events.PreDropPartitionEvent;
import org.apache.hadoop.hive.ql.metadata.AuthorizationException;
import org.apache.hadoop.hive.ql.plan.HiveOperation;
-import org.apache.sentry.SentryUserException;
+import org.apache.sentry.core.common.exception.SentryUserException;
import org.apache.sentry.binding.hive.authz.HiveAuthzBinding;
import org.apache.sentry.binding.hive.v2.HiveAuthzPrivilegesMapV2;
import org.apache.sentry.binding.metastore.MetastoreAuthzBindingBase;
diff --git a/sentry-binding/sentry-binding-hive/pom.xml b/sentry-binding/sentry-binding-hive/pom.xml
index 07aaae3ba..fa1c44c91 100644
--- a/sentry-binding/sentry-binding-hive/pom.xml
+++ b/sentry-binding/sentry-binding-hive/pom.xml
@@ -69,31 +69,6 @@ limitations under the License.
org.apache.sentry
sentry-binding-hive-common
-
- org.apache.sentry
- sentry-core-common
-
-
- org.apache.sentry
- sentry-core-model-db
-
-
- org.apache.sentry
- sentry-provider-common
-
-
-
- org.apache.sentry
- sentry-provider-db
-
-
- org.apache.sentry
- sentry-provider-file
-
-
- org.apache.sentry
- sentry-provider-cache
-
org.apache.hadoop
hadoop-common
@@ -111,10 +86,6 @@ limitations under the License.
test
-
- org.apache.sentry
- sentry-provider-db
-
org.apache.hadoop
hadoop-minicluster
diff --git a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/MockUserToGroupMapping.java b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/MockUserToGroupMapping.java
index c095603aa..8ea8e1b73 100644
--- a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/MockUserToGroupMapping.java
+++ b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/MockUserToGroupMapping.java
@@ -19,7 +19,7 @@
import java.util.Set;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import com.google.common.collect.Sets;
diff --git a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestPolicyParsingNegative.java b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestPolicyParsingNegative.java
index 4dc8812c1..0a53088e7 100644
--- a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestPolicyParsingNegative.java
+++ b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestPolicyParsingNegative.java
@@ -24,7 +24,7 @@
import org.apache.commons.io.FileUtils;
import org.apache.sentry.core.common.ActiveRoleSet;
import org.apache.sentry.policy.common.PolicyEngine;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderGeneralCases.java b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderGeneralCases.java
index 403eb6a4f..2ace656a8 100644
--- a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderGeneralCases.java
+++ b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderGeneralCases.java
@@ -37,7 +37,7 @@
import org.apache.sentry.core.model.db.HivePrivilegeModel;
import org.apache.sentry.core.model.db.Server;
import org.apache.sentry.core.model.db.Table;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.provider.common.ResourceAuthorizationProvider;
import org.apache.sentry.provider.file.HadoopGroupResourceAuthorizationProvider;
import org.apache.sentry.provider.file.PolicyFiles;
diff --git a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderSpecialCases.java b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderSpecialCases.java
index 6fe9e6b18..040f46779 100644
--- a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderSpecialCases.java
+++ b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestResourceAuthorizationProviderSpecialCases.java
@@ -36,7 +36,7 @@
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestSimpleDBPolicyEngineDFS.java b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestSimpleDBPolicyEngineDFS.java
index 97cf61585..f86516f45 100644
--- a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestSimpleDBPolicyEngineDFS.java
+++ b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/policy/hive/TestSimpleDBPolicyEngineDFS.java
@@ -28,7 +28,7 @@
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.sentry.core.common.ActiveRoleSet;
import org.apache.sentry.policy.common.PolicyEngine;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.provider.file.PolicyFiles;
import org.junit.AfterClass;
import org.junit.BeforeClass;
diff --git a/sentry-binding/sentry-binding-kafka/pom.xml b/sentry-binding/sentry-binding-kafka/pom.xml
index f6f212bf7..f8687865a 100644
--- a/sentry-binding/sentry-binding-kafka/pom.xml
+++ b/sentry-binding/sentry-binding-kafka/pom.xml
@@ -35,29 +35,17 @@ limitations under the License.
junit
test
-
- org.apache.sentry
- sentry-core-common
-
org.apache.sentry
sentry-core-model-kafka
-
- org.apache.sentry
- sentry-provider-common
-
-
- org.apache.sentry
- sentry-provider-file
-
org.apache.sentry
sentry-provider-db
org.apache.sentry
- sentry-policy-common
+ sentry-policy-engine
org.apache.hadoop
diff --git a/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java b/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java
index cc5194be6..53e7a3c64 100644
--- a/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java
+++ b/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java
@@ -51,7 +51,7 @@
import org.apache.sentry.kafka.ConvertUtil;
import org.apache.sentry.kafka.conf.KafkaAuthConf.AuthzConfVars;
import org.apache.sentry.policy.common.PolicyEngine;
-import org.apache.sentry.provider.common.AuthorizationComponent;
+import org.apache.sentry.core.common.utils.AuthorizationComponent;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.common.ProviderBackend;
import org.apache.sentry.provider.common.ProviderBackendContext;
diff --git a/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/MockGroupMappingServiceProvider.java b/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/MockGroupMappingServiceProvider.java
index 572c74dbc..13295209a 100644
--- a/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/MockGroupMappingServiceProvider.java
+++ b/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/MockGroupMappingServiceProvider.java
@@ -20,7 +20,7 @@
import java.util.Set;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
diff --git a/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/TestKafkaAuthorizationProviderSpecialCases.java b/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/TestKafkaAuthorizationProviderSpecialCases.java
index 63d2f3071..610905985 100644
--- a/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/TestKafkaAuthorizationProviderSpecialCases.java
+++ b/sentry-binding/sentry-binding-kafka/src/test/java/org/apache/sentry/policy/kafka/TestKafkaAuthorizationProviderSpecialCases.java
@@ -38,7 +38,7 @@
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-binding/sentry-binding-solr/pom.xml b/sentry-binding/sentry-binding-solr/pom.xml
index a63a600ba..8b94c8711 100644
--- a/sentry-binding/sentry-binding-solr/pom.xml
+++ b/sentry-binding/sentry-binding-solr/pom.xml
@@ -34,18 +34,10 @@ limitations under the License.
junit
test
-
- org.apache.sentry
- sentry-core-common
-
org.apache.sentry
sentry-core-model-search
-
- org.apache.sentry
- sentry-provider-common
-
org.apache.sentry
sentry-provider-db
@@ -55,6 +47,10 @@ limitations under the License.
sentry-provider-file
test
+
+ org.apache.sentry
+ sentry-policy-engine
+
org.apache.hadoop
hadoop-common
diff --git a/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java b/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java
index 240067370..3bc5b82a7 100644
--- a/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java
+++ b/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java
@@ -42,9 +42,9 @@
import org.apache.sentry.core.model.search.SearchModelAction;
import org.apache.sentry.core.model.search.SearchPrivilegeModel;
import org.apache.sentry.policy.common.PolicyEngine;
-import org.apache.sentry.provider.common.AuthorizationComponent;
+import org.apache.sentry.core.common.utils.AuthorizationComponent;
import org.apache.sentry.provider.common.AuthorizationProvider;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.provider.common.HadoopGroupResourceAuthorizationProvider;
import org.apache.sentry.provider.common.ProviderBackend;
import org.apache.sentry.provider.common.ProviderBackendContext;
diff --git a/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderGeneralCases.java b/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderGeneralCases.java
index 6f7f07a4e..2c82dc7d8 100644
--- a/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderGeneralCases.java
+++ b/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderGeneralCases.java
@@ -34,7 +34,7 @@
import org.apache.sentry.core.model.search.Collection;
import org.apache.sentry.core.model.search.SearchModelAction;
import org.apache.sentry.core.model.search.SearchPrivilegeModel;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.provider.common.ResourceAuthorizationProvider;
import org.apache.sentry.provider.file.HadoopGroupResourceAuthorizationProvider;
import org.apache.sentry.provider.file.PolicyFiles;
diff --git a/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderSpecialCases.java b/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderSpecialCases.java
index 371f3614a..80e3f4a66 100644
--- a/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderSpecialCases.java
+++ b/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/policy/solr/TestSearchAuthorizationProviderSpecialCases.java
@@ -35,7 +35,7 @@
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-binding/sentry-binding-sqoop/pom.xml b/sentry-binding/sentry-binding-sqoop/pom.xml
index 732da26d4..e96802f02 100644
--- a/sentry-binding/sentry-binding-sqoop/pom.xml
+++ b/sentry-binding/sentry-binding-sqoop/pom.xml
@@ -34,18 +34,10 @@ limitations under the License.
junit
test
-
- org.apache.sentry
- sentry-core-common
-
org.apache.sentry
sentry-core-model-sqoop
-
- org.apache.sentry
- sentry-provider-common
-
org.apache.sentry
sentry-provider-file
@@ -56,7 +48,7 @@ limitations under the License.
org.apache.sentry
- sentry-policy-common
+ sentry-policy-engine
org.apache.hadoop
diff --git a/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java b/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java
index 84a61cc0b..0a2e0b57e 100644
--- a/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java
+++ b/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java
@@ -32,7 +32,7 @@
import org.apache.sentry.core.model.sqoop.SqoopActionFactory;
import org.apache.sentry.core.model.sqoop.SqoopPrivilegeModel;
import org.apache.sentry.policy.common.PolicyEngine;
-import org.apache.sentry.provider.common.AuthorizationComponent;
+import org.apache.sentry.core.common.utils.AuthorizationComponent;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.common.ProviderBackend;
import org.apache.sentry.provider.common.ProviderBackendContext;
diff --git a/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderGeneralCases.java b/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderGeneralCases.java
index 7ce8881d6..a3d96fec5 100644
--- a/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderGeneralCases.java
+++ b/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderGeneralCases.java
@@ -38,7 +38,7 @@
import org.apache.sentry.core.model.sqoop.SqoopActionConstant;
import org.apache.sentry.core.model.sqoop.SqoopActionFactory.SqoopAction;
import org.apache.sentry.core.model.sqoop.SqoopPrivilegeModel;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.provider.common.ResourceAuthorizationProvider;
import org.apache.sentry.provider.common.HadoopGroupResourceAuthorizationProvider;
import org.apache.sentry.provider.file.PolicyFiles;
diff --git a/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderSpecialCases.java b/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderSpecialCases.java
index 8d69402e7..4bcf3b12e 100644
--- a/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderSpecialCases.java
+++ b/sentry-binding/sentry-binding-sqoop/src/test/java/org/apache/sentry/policy/sqoop/TestSqoopAuthorizationProviderSpecialCases.java
@@ -38,7 +38,7 @@
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/GroupMappingService.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/GroupMappingService.java
similarity index 96%
rename from sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/GroupMappingService.java
rename to sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/GroupMappingService.java
index 7e8526107..6af6ac503 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/GroupMappingService.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/GroupMappingService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sentry.provider.common;
+package org.apache.sentry.core.common.service;
import java.util.Set;
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/HadoopGroupMappingService.java
similarity index 98%
rename from sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java
rename to sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/HadoopGroupMappingService.java
index bde53d5f6..2b10ae19a 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/HadoopGroupMappingService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sentry.provider.common;
+package org.apache.sentry.core.common.service;
import java.io.IOException;
import java.util.HashSet;
diff --git a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/MockGroupMappingServiceProvider.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/MockGroupMappingServiceProvider.java
similarity index 97%
rename from sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/MockGroupMappingServiceProvider.java
rename to sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/MockGroupMappingServiceProvider.java
index 1e885f4d2..55010de84 100644
--- a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/MockGroupMappingServiceProvider.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/MockGroupMappingServiceProvider.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sentry.provider.common;
+package org.apache.sentry.core.common.service;
import java.util.Collection;
import java.util.Set;
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoGroupMappingService.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/NoGroupMappingService.java
similarity index 96%
rename from sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoGroupMappingService.java
rename to sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/NoGroupMappingService.java
index e44cbc4b3..db4878884 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoGroupMappingService.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/service/NoGroupMappingService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sentry.provider.common;
+package org.apache.sentry.core.common.service;
import java.util.HashSet;
import java.util.Set;
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationComponent.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/AuthorizationComponent.java
similarity index 96%
rename from sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationComponent.java
rename to sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/AuthorizationComponent.java
index 5dc2b5592..e3f1f1560 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationComponent.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/AuthorizationComponent.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sentry.provider.common;
+package org.apache.sentry.core.common.utils;
/**
* Represent which component being authorized by Sentry
* using generic model
diff --git a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyFile.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PolicyFile.java
similarity index 99%
rename from sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyFile.java
rename to sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PolicyFile.java
index 6a77827f9..a6ef0b3c4 100644
--- a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyFile.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PolicyFile.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.sentry.provider.file;
+package org.apache.sentry.core.common.utils;
import static org.apache.sentry.core.common.utils.PolicyFileConstants.DATABASES;
import static org.apache.sentry.core.common.utils.PolicyFileConstants.GROUPS;
diff --git a/sentry-dist/pom.xml b/sentry-dist/pom.xml
index 80ec9c9d6..04645adcb 100644
--- a/sentry-dist/pom.xml
+++ b/sentry-dist/pom.xml
@@ -70,6 +70,18 @@ limitations under the License.
org.apache.sentry
solr-sentry-handlers
+
+ org.apache.sentry
+ sentry-service-common
+
+
+ org.apache.sentry
+ sentry-service-server
+
+
+ org.apache.sentry
+ sentry-service-client
+
org.apache.sentry
sentry-provider-common
diff --git a/sentry-dist/src/main/assembly/bin.xml b/sentry-dist/src/main/assembly/bin.xml
index 5727fc964..d998e98b5 100644
--- a/sentry-dist/src/main/assembly/bin.xml
+++ b/sentry-dist/src/main/assembly/bin.xml
@@ -41,7 +41,6 @@
org.slf4j:*
org.datanucleus:*
- com.jolbox:bonecp
org.apache.hive:hive-beeline
org.apache.derby:derby
@@ -66,7 +65,6 @@
true
org.datanucleus:*
- com.jolbox:bonecp
org.apache.hive:hive-beeline
org.apache.derby:derby
@@ -102,6 +100,7 @@
sentry-policy/**
sentry-tests/**
sentry-hdfs/**
+ sentry-service/**
sentry-solr/**
@@ -128,7 +127,7 @@
lib/plugins
- ${project.parent.basedir}/sentry-provider/sentry-provider-db/src/main/resources
+ ${project.parent.basedir}/sentry-service/sentry-service-server/src/main/resources
**/*
diff --git a/sentry-dist/src/main/assembly/src.xml b/sentry-dist/src/main/assembly/src.xml
index c730c584b..6801b8592 100644
--- a/sentry-dist/src/main/assembly/src.xml
+++ b/sentry-dist/src/main/assembly/src.xml
@@ -55,6 +55,7 @@
dev-support/**
sentry-binding/**
sentry-core/**
+ sentry-service/**
sentry-dist/**
sentry-provider/**
sentry-policy/**
diff --git a/sentry-hdfs/sentry-hdfs-common/pom.xml b/sentry-hdfs/sentry-hdfs-common/pom.xml
index d244edc56..281196bc2 100644
--- a/sentry-hdfs/sentry-hdfs-common/pom.xml
+++ b/sentry-hdfs/sentry-hdfs-common/pom.xml
@@ -59,27 +59,30 @@ limitations under the License.
curator-x-discovery
${curator.version}
-
- org.apache.hadoop
- hadoop-minikdc
- test
-
org.apache.sentry
sentry-provider-db
- provided
org.apache.sentry
- sentry-provider-file
+ sentry-service-server
+
+
+ org.apache.hadoop
+ hadoop-minikdc
test
org.apache.sentry
- sentry-provider-db
+ sentry-service-server
test-jar
test
+
+ org.apache.sentry
+ sentry-provider-file
+ test
+
${basedir}/src/main/java
diff --git a/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderGeneralCases.java b/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderGeneralCases.java
index 939621bd3..62942dc41 100644
--- a/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderGeneralCases.java
+++ b/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderGeneralCases.java
@@ -23,6 +23,7 @@
import java.util.List;
import java.util.Set;
+import org.apache.sentry.core.common.service.MockGroupMappingServiceProvider;
import org.junit.Assert;
import org.apache.commons.io.FileUtils;
@@ -33,7 +34,6 @@
import org.apache.sentry.core.model.indexer.Indexer;
import org.apache.sentry.core.model.indexer.IndexerModelAction;
import org.apache.sentry.core.model.indexer.IndexerPrivilegeModel;
-import org.apache.sentry.provider.common.MockGroupMappingServiceProvider;
import org.apache.sentry.provider.common.ResourceAuthorizationProvider;
import org.apache.sentry.provider.file.HadoopGroupResourceAuthorizationProvider;
import org.apache.sentry.provider.file.PolicyFiles;
diff --git a/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderSpecialCases.java b/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderSpecialCases.java
index 1717c42f8..020b7580e 100644
--- a/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderSpecialCases.java
+++ b/sentry-policy/sentry-policy-indexer/src/test/java/org/apache/sentry/policy/indexer/TestIndexerAuthorizationProviderSpecialCases.java
@@ -35,7 +35,7 @@
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.provider.common.AuthorizationProvider;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-provider/sentry-provider-cache/pom.xml b/sentry-provider/sentry-provider-cache/pom.xml
index ec7700316..694df3669 100644
--- a/sentry-provider/sentry-provider-cache/pom.xml
+++ b/sentry-provider/sentry-provider-cache/pom.xml
@@ -62,10 +62,6 @@ limitations under the License.
org.slf4j
slf4j-log4j12
-
- org.apache.sentry
- sentry-core-common
-
org.apache.sentry
sentry-core-model-db
diff --git a/sentry-provider/sentry-provider-common/pom.xml b/sentry-provider/sentry-provider-common/pom.xml
index 9af153a4e..f83f59418 100644
--- a/sentry-provider/sentry-provider-common/pom.xml
+++ b/sentry-provider/sentry-provider-common/pom.xml
@@ -36,11 +36,6 @@ limitations under the License.
org.apache.hadoop
hadoop-common
- provided
-
-
- org.apache.sentry
- sentry-core-common
org.apache.sentry
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java
index 2d82bcfcd..3d6440fd2 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java
@@ -26,6 +26,7 @@
import org.apache.sentry.core.common.Authorizable;
import org.apache.sentry.core.common.exception.SentryConfigurationException;
import org.apache.sentry.core.common.Subject;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.policy.common.PolicyEngine;
/**
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupResourceAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupResourceAuthorizationProvider.java
index e45799fd8..6e5dbc30b 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupResourceAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupResourceAuthorizationProvider.java
@@ -22,6 +22,8 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.Groups;
import org.apache.sentry.core.common.Model;
+import org.apache.sentry.core.common.service.GroupMappingService;
+import org.apache.sentry.core.common.service.HadoopGroupMappingService;
import org.apache.sentry.policy.common.PolicyEngine;
import com.google.common.annotations.VisibleForTesting;
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java
index be0830d83..11dbfb79c 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java
@@ -26,6 +26,8 @@
import org.apache.sentry.core.common.Authorizable;
import org.apache.sentry.core.common.exception.SentryConfigurationException;
import org.apache.sentry.core.common.Subject;
+import org.apache.sentry.core.common.service.GroupMappingService;
+import org.apache.sentry.core.common.service.NoGroupMappingService;
import org.apache.sentry.policy.common.PolicyEngine;
public class NoAuthorizationProvider implements AuthorizationProvider {
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
index 4e22071be..a6b2047b2 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
@@ -32,6 +32,7 @@
import org.apache.sentry.core.common.Model;
import org.apache.sentry.core.common.exception.SentryConfigurationException;
import org.apache.sentry.core.common.Subject;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.policy.common.Privilege;
import org.apache.sentry.policy.common.PrivilegeFactory;
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/file/HadoopGroupResourceAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/file/HadoopGroupResourceAuthorizationProvider.java
index 2214867e8..bf2c5a19a 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/file/HadoopGroupResourceAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/file/HadoopGroupResourceAuthorizationProvider.java
@@ -22,7 +22,7 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.sentry.core.common.Model;
import org.apache.sentry.policy.common.PolicyEngine;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import com.google.common.annotations.VisibleForTesting;
diff --git a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java b/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java
index ccc505fd5..f6d8c05ea 100644
--- a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java
+++ b/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java
@@ -23,6 +23,7 @@
import org.apache.sentry.core.common.ActiveRoleSet;
import org.apache.sentry.core.common.Authorizable;
import org.apache.sentry.core.common.exception.SentryConfigurationException;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.policy.common.PolicyEngine;
import org.apache.sentry.policy.common.PrivilegeFactory;
import org.junit.Test;
diff --git a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestNoAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestNoAuthorizationProvider.java
index fe01b062c..7ca8bfc7a 100644
--- a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestNoAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestNoAuthorizationProvider.java
@@ -19,6 +19,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.junit.Test;
/**
diff --git a/sentry-provider/sentry-provider-db/pom.xml b/sentry-provider/sentry-provider-db/pom.xml
index b8143ffa3..bf43e0b2e 100644
--- a/sentry-provider/sentry-provider-db/pom.xml
+++ b/sentry-provider/sentry-provider-db/pom.xml
@@ -28,44 +28,10 @@ limitations under the License.
Sentry Provider DB
-
- commons-cli
- commons-cli
-
-
- com.jolbox
- bonecp
-
-
- org.apache.hadoop
- hadoop-common
- provided
-
-
- org.apache.hadoop
- hadoop-mapreduce-client-jobclient
-
-
- junit
- junit
- test
-
-
- org.apache.derby
- derby
-
log4j
log4j
-
- org.apache.shiro
- shiro-core
-
-
- com.google.guava
- guava
-
org.slf4j
slf4j-api
@@ -74,331 +40,13 @@ limitations under the License.
org.slf4j
slf4j-log4j12
-
- org.apache.sentry
- sentry-core-common
-
-
- org.apache.sentry
- sentry-core-model-db
-
-
- org.apache.sentry
- sentry-core-model-search
-
-
- org.apache.sentry
- sentry-core-model-sqoop
-
-
- org.apache.sentry
- sentry-core-model-kafka
-
org.apache.sentry
sentry-provider-common
org.apache.sentry
- sentry-provider-file
-
-
- org.apache.sentry
- sentry-policy-engine
-
-
- org.apache.hive
- hive-shims
- provided
-
-
- org.apache.hive
- hive-beeline
-
-
- org.apache.thrift
- libfb303
-
-
- org.apache.thrift
- libthrift
-
-
- ant-contrib
- ant-contrib
-
-
- org.apache.hadoop
- hadoop-minikdc
- test
-
-
- javax.jdo
- jdo-api
-
-
- com.codahale.metrics
- metrics-core
-
-
- com.codahale.metrics
- metrics-servlets
-
-
- com.codahale.metrics
- metrics-jvm
-
-
- org.eclipse.jetty
- jetty-server
-
-
- org.eclipse.jetty
- jetty-servlet
-
-
- org.mockito
- mockito-all
- test
-
-
- org.apache.curator
- curator-recipes
-
-
- org.apache.curator
- curator-x-discovery
-
-
- org.apache.curator
- curator-test
-
-
- org.apache.commons
- commons-pool2
+ sentry-service-client
-
-
- ${basedir}/src/main/java
- ${basedir}/src/test/java
-
-
- ${basedir}/src/main/java/org/apache/sentry/provider/db/service/model
-
- package.jdo
-
-
-
- ${basedir}/src/main
-
- webapp/*
- webapp/css/*
-
-
-
-
-
- com.google.code.maven-replacer-plugin
- replacer
- 1.5.2
-
-
- replaceTokens
- clean
-
- replace
-
-
-
-
- ${basedir}/src/main/webapp/SentryService.html
-
-
- %PROJECT_VERSION%
- ${version}
-
-
-
-
-
- org.codehaus.mojo
- build-helper-maven-plugin
-
-
- add-source
- generate-sources
-
- add-source
-
-
-
- src/gen/thrift/gen-javabean
-
-
-
-
-
-
- org.datanucleus
- datanucleus-maven-plugin
-
- JDO
- **/*.jdo
- true
-
-
-
- process-classes
-
- enhance
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- test-jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- false
-
-
-
-
-
-
- datanucleus3
-
- true
-
-
- 3.2.6
- 3.2.12
- 3.2.12
-
-
-
- org.datanucleus
- datanucleus-core
- ${datanucleus-core.version}
-
-
- org.datanucleus
- datanucleus-api-jdo
- ${datanucleus-api-jdo.version}
-
-
- org.datanucleus
- datanucleus-rdbms
- ${datanucleus-rdbms.version}
-
-
-
-
- datanucleus4
-
- false
-
-
- 4.2.1
- 4.1.6
- 4.1.7
- 3.2.0-m3
-
-
-
- org.datanucleus
- datanucleus-core
- ${datanucleus-core.version}
-
-
- org.datanucleus
- datanucleus-api-jdo
- ${datanucleus-api-jdo.version}
-
-
- org.datanucleus
- datanucleus-rdbms
- ${datanucleus-rdbms.version}
-
-
- org.datanucleus
- javax.jdo
- ${datanucleus-jdo.version}
-
-
-
-
- thriftif
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
- generate-thrift-sources
- generate-sources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- run
-
-
-
-
-
- org.apache.maven.plugins
- maven-enforcer-plugin
-
-
- enforce-property
-
- enforce
-
-
-
-
- thrift.home
-
-
- true
-
-
-
-
-
-
-
-
diff --git a/sentry-provider/sentry-provider-file/pom.xml b/sentry-provider/sentry-provider-file/pom.xml
index 04f38d875..25db03675 100644
--- a/sentry-provider/sentry-provider-file/pom.xml
+++ b/sentry-provider/sentry-provider-file/pom.xml
@@ -28,11 +28,6 @@ limitations under the License.
Sentry Provider File
-
- org.apache.hadoop
- hadoop-common
- provided
-
junit
junit
@@ -42,14 +37,6 @@ limitations under the License.
log4j
log4j
-
- org.apache.shiro
- shiro-core
-
-
- com.google.guava
- guava
-
org.slf4j
slf4j-api
@@ -58,10 +45,6 @@ limitations under the License.
org.slf4j
slf4j-log4j12
-
- org.apache.sentry
- sentry-core-common
-
org.apache.sentry
sentry-provider-common
diff --git a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/LocalGroupMappingService.java b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/LocalGroupMappingService.java
index dec47c2d4..eb23ff10a 100644
--- a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/LocalGroupMappingService.java
+++ b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/LocalGroupMappingService.java
@@ -26,8 +26,8 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.core.common.utils.SentryConstants;
-import org.apache.sentry.provider.common.GroupMappingService;
import org.apache.sentry.core.common.utils.PolicyFileConstants;
import org.apache.sentry.core.common.exception.SentryGroupNotFoundException;
import org.apache.shiro.config.Ini;
diff --git a/sentry-service/pom.xml b/sentry-service/pom.xml
new file mode 100644
index 000000000..4bcb7f1cb
--- /dev/null
+++ b/sentry-service/pom.xml
@@ -0,0 +1,38 @@
+
+
+
+
+ 4.0.0
+
+
+ org.apache.sentry
+ sentry
+ 1.8.0-SNAPSHOT
+
+
+ sentry-service
+ Sentry Service
+ pom
+
+
+ sentry-service-common
+ sentry-service-server
+ sentry-service-client
+
+
+
diff --git a/sentry-service/sentry-service-client/pom.xml b/sentry-service/sentry-service-client/pom.xml
new file mode 100644
index 000000000..fc37c5e44
--- /dev/null
+++ b/sentry-service/sentry-service-client/pom.xml
@@ -0,0 +1,57 @@
+
+
+
+ 4.0.0
+
+ org.apache.sentry
+ sentry-service
+ 1.8.0-SNAPSHOT
+
+
+ sentry-service-client
+ Sentry Service Client
+
+
+
+ org.apache.sentry
+ sentry-service-common
+
+
+ org.apache.sentry
+ sentry-core-model-kafka
+
+
+ org.apache.sentry
+ sentry-core-model-db
+
+
+ org.apache.sentry
+ sentry-core-model-search
+
+
+ org.apache.sentry
+ sentry-provider-file
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+
\ No newline at end of file
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClient.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClient.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClient.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClient.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientDefaultImpl.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientDefaultImpl.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientDefaultImpl.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientDefaultImpl.java
index ee6cdf79f..d129c3531 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientDefaultImpl.java
+++ b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientDefaultImpl.java
@@ -25,7 +25,7 @@
import javax.security.auth.callback.CallbackHandler;
import org.apache.hadoop.conf.Configuration;
-import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION;
+import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.security.SaslRpcServer;
import org.apache.hadoop.security.SaslRpcServer.AuthMethod;
@@ -34,7 +34,7 @@
import org.apache.sentry.core.common.exception.SentryUserException;
import org.apache.sentry.core.common.ActiveRoleSet;
import org.apache.sentry.core.common.Authorizable;
-import org.apache.sentry.core.model.db.AccessConstants;
+import org.apache.sentry.core.common.utils.SentryConstants;
import org.apache.sentry.service.thrift.ServiceConstants;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
@@ -134,7 +134,7 @@ public SentryGenericServiceClientDefaultImpl(Configuration conf) throws IOExcept
String serverPrincipal = Preconditions.checkNotNull(conf.get(ServerConfig.PRINCIPAL), ServerConfig.PRINCIPAL + " is required");
// since the client uses hadoop-auth, we need to set kerberos in
// hadoop-auth if we plan to use kerberos
- conf.set(HADOOP_SECURITY_AUTHENTICATION, ServerConfig.SECURITY_MODE_KERBEROS);
+ conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, ServerConfig.SECURITY_MODE_KERBEROS);
// Resolve server host in the same way as we are doing on server side
serverPrincipal = SecurityUtil.getServerPrincipal(serverPrincipal, serverAddress.getAddress());
@@ -161,7 +161,7 @@ public SentryGenericServiceClientDefaultImpl(Configuration conf) throws IOExcept
ServiceConstants.ClientConfig.SENTRY_POLICY_CLIENT_THRIFT_MAX_MESSAGE_SIZE_DEFAULT);
TMultiplexedProtocol protocol = new TMultiplexedProtocol(
new TBinaryProtocol(transport, maxMessageSize, maxMessageSize, true, true),
- SentryGenericPolicyProcessor.SENTRY_GENERIC_SERVICE_NAME);
+ ServiceConstants.SENTRY_GENERIC_SERVICE_NAME);
client = new SentryGenericPolicyService.Client(protocol);
LOGGER.debug("Successfully created client");
}
@@ -442,7 +442,7 @@ public synchronized Set listRolesByGroupName(
public Set listUserRoles(String requestorUserName, String component)
throws SentryUserException {
- return listRolesByGroupName(requestorUserName, AccessConstants.ALL, component);
+ return listRolesByGroupName(requestorUserName, SentryConstants.RESOURCE_WILDCARD_VALUE, component);
}
public Set listAllRoles(String requestorUserName, String component)
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientFactory.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientFactory.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientFactory.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceClientFactory.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/KafkaTSentryPrivilegeConverter.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/KafkaTSentryPrivilegeConverter.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/KafkaTSentryPrivilegeConverter.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/KafkaTSentryPrivilegeConverter.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolCommon.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolCommon.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolCommon.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolCommon.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolSolr.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolSolr.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolSolr.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryConfigToolSolr.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellKafka.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellKafka.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellKafka.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellKafka.java
index d6d9014a9..ea05db7aa 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellKafka.java
+++ b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellKafka.java
@@ -22,7 +22,7 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.sentry.provider.common.AuthorizationComponent;
+import org.apache.sentry.core.common.utils.AuthorizationComponent;
import org.apache.sentry.provider.db.generic.service.thrift.SentryGenericServiceClient;
import org.apache.sentry.provider.db.generic.service.thrift.SentryGenericServiceClientFactory;
import org.apache.sentry.provider.db.generic.tools.command.*;
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellSolr.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellSolr.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellSolr.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SentryShellSolr.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SolrTSentryPrivilegeConverter.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SolrTSentryPrivilegeConverter.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/SolrTSentryPrivilegeConverter.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/SolrTSentryPrivilegeConverter.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/AddRoleToGroupCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/AddRoleToGroupCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/AddRoleToGroupCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/AddRoleToGroupCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/Command.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/Command.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/Command.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/Command.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/CreateRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/CreateRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/CreateRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/CreateRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DeleteRoleFromGroupCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DeleteRoleFromGroupCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DeleteRoleFromGroupCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DeleteRoleFromGroupCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DropRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DropRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DropRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/DropRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/GrantPrivilegeToRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/GrantPrivilegeToRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/GrantPrivilegeToRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/GrantPrivilegeToRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListPrivilegesByRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListPrivilegesByRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListPrivilegesByRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListPrivilegesByRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListRolesCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListRolesCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListRolesCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/ListRolesCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/RevokePrivilegeFromRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/RevokePrivilegeFromRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/RevokePrivilegeFromRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/RevokePrivilegeFromRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/TSentryPrivilegeConverter.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/TSentryPrivilegeConverter.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/tools/command/TSentryPrivilegeConverter.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/generic/tools/command/TSentryPrivilegeConverter.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceManager.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceManager.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceManager.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceManager.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClient.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClient.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClient.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClient.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
index 1039e6ebf..cad39c12c 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
+++ b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
@@ -37,6 +37,7 @@
import org.apache.sentry.core.common.exception.SentryUserException;
import org.apache.sentry.core.common.ActiveRoleSet;
import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.common.utils.SentryConstants;
import org.apache.sentry.core.model.db.AccessConstants;
import org.apache.sentry.core.model.db.DBModelAuthorizable;
import org.apache.sentry.core.common.utils.PolicyFileConstants;
@@ -172,7 +173,7 @@ public SentryPolicyServiceClientDefaultImpl(Configuration conf) throws IOExcepti
ServiceConstants.ClientConfig.SENTRY_POLICY_CLIENT_THRIFT_MAX_MESSAGE_SIZE_DEFAULT);
TMultiplexedProtocol protocol = new TMultiplexedProtocol(
new TBinaryProtocol(transport, maxMessageSize, maxMessageSize, true, true),
- SentryPolicyStoreProcessor.SENTRY_POLICY_SERVICE_NAME);
+ ServiceConstants.SENTRY_POLICY_SERVICE_NAME);
client = new SentryPolicyService.Client(protocol);
LOGGER.debug("Successfully created client");
}
@@ -316,7 +317,7 @@ public synchronized Set listRoles(String requestorUserName)
public synchronized Set listUserRoles(String requestorUserName)
throws SentryUserException {
Set tSentryRoles = Sets.newHashSet();
- tSentryRoles.addAll(listRolesByGroupName(requestorUserName, AccessConstants.ALL));
+ tSentryRoles.addAll(listRolesByGroupName(requestorUserName, SentryConstants.RESOURCE_WILDCARD_VALUE));
tSentryRoles.addAll(listRolesByUserName(requestorUserName, requestorUserName));
return tSentryRoles;
}
@@ -325,14 +326,14 @@ public synchronized TSentryPrivilege grantURIPrivilege(String requestorUserName,
String roleName, String server, String uri)
throws SentryUserException {
return grantPrivilege(requestorUserName, roleName,
- PrivilegeScope.URI, server, uri, null, null, null, AccessConstants.ALL);
+ PrivilegeScope.URI, server, uri, null, null, null, SentryConstants.RESOURCE_WILDCARD_VALUE);
}
public synchronized TSentryPrivilege grantURIPrivilege(String requestorUserName,
String roleName, String server, String uri, Boolean grantOption)
throws SentryUserException {
return grantPrivilege(requestorUserName, roleName,
- PrivilegeScope.URI, server, uri, null, null, null, AccessConstants.ALL, grantOption);
+ PrivilegeScope.URI, server, uri, null, null, null, SentryConstants.RESOURCE_WILDCARD_VALUE, grantOption);
}
public synchronized void grantServerPrivilege(String requestorUserName,
@@ -341,8 +342,9 @@ public synchronized void grantServerPrivilege(String requestorUserName,
// "ALL" and "*" should be synonyms for action and need to be unified with grantServerPrivilege without
// action explicitly specified.
- if (AccessConstants.ACTION_ALL.equalsIgnoreCase(action) || AccessConstants.ALL.equals(action)) {
- action = AccessConstants.ALL;
+ if (SentryConstants.RESOURCE_WILDCARD_VALUE_ALL.equalsIgnoreCase(action)
+ || SentryConstants.RESOURCE_WILDCARD_VALUE.equals(action)) {
+ action = SentryConstants.RESOURCE_WILDCARD_VALUE;
}
grantPrivilege(requestorUserName, roleName,
@@ -357,7 +359,7 @@ public synchronized void grantServerPrivilege(String requestorUserName,
public synchronized TSentryPrivilege grantServerPrivilege(String requestorUserName,
String roleName, String server, Boolean grantOption) throws SentryUserException {
return grantServerPrivilege(requestorUserName, roleName, server,
- AccessConstants.ALL, grantOption);
+ SentryConstants.RESOURCE_WILDCARD_VALUE, grantOption);
}
public synchronized TSentryPrivilege grantServerPrivilege(String requestorUserName,
@@ -366,8 +368,9 @@ public synchronized TSentryPrivilege grantServerPrivilege(String requestorUserNa
// "ALL" and "*" should be synonyms for action and need to be unified with grantServerPrivilege without
// action explicitly specified.
- if (AccessConstants.ACTION_ALL.equalsIgnoreCase(action) || AccessConstants.ALL.equals(action)) {
- action = AccessConstants.ALL;
+ if (SentryConstants.RESOURCE_WILDCARD_VALUE_ALL.equalsIgnoreCase(action)
+ || SentryConstants.RESOURCE_WILDCARD_VALUE.equals(action)) {
+ action = SentryConstants.RESOURCE_WILDCARD_VALUE;
}
return grantPrivilege(requestorUserName, roleName,
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellCommon.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/SentryShellCommon.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellCommon.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/SentryShellCommon.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/Command.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/Command.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/Command.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/Command.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CommandUtil.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CommandUtil.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CommandUtil.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CommandUtil.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CreateRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CreateRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CreateRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CreateRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/DropRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/DropRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/DropRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/DropRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantPrivilegeToRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantPrivilegeToRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantPrivilegeToRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantPrivilegeToRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantRoleToGroupsCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantRoleToGroupsCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantRoleToGroupsCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/GrantRoleToGroupsCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListPrivilegesCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListPrivilegesCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListPrivilegesCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListPrivilegesCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListRolesCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListRolesCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListRolesCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/ListRolesCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokePrivilegeFromRoleCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokePrivilegeFromRoleCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokePrivilegeFromRoleCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokePrivilegeFromRoleCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokeRoleFromGroupsCmd.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokeRoleFromGroupsCmd.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokeRoleFromGroupsCmd.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/provider/db/tools/command/hive/RevokeRoleFromGroupsCmd.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HAClientInvocationHandler.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/HAClientInvocationHandler.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HAClientInvocationHandler.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/HAClientInvocationHandler.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryClientInvocationHandler.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/SentryClientInvocationHandler.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryClientInvocationHandler.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/SentryClientInvocationHandler.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientFactory.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientFactory.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientFactory.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientFactory.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientPoolFactory.java b/sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientPoolFactory.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientPoolFactory.java
rename to sentry-service/sentry-service-client/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientPoolFactory.java
diff --git a/sentry-service/sentry-service-common/pom.xml b/sentry-service/sentry-service-common/pom.xml
new file mode 100644
index 000000000..bac8c650a
--- /dev/null
+++ b/sentry-service/sentry-service-common/pom.xml
@@ -0,0 +1,159 @@
+
+
+
+ 4.0.0
+
+ org.apache.sentry
+ sentry-service
+ 1.8.0-SNAPSHOT
+
+
+ sentry-service-common
+ Sentry Service Common
+
+
+
+ commons-lang
+ commons-lang
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.slf4j
+ slf4j-log4j12
+
+
+ org.apache.thrift
+ libfb303
+
+
+ org.apache.thrift
+ libthrift
+
+
+ org.apache.sentry
+ sentry-core-common
+
+
+ org.apache.curator
+ curator-recipes
+
+
+ org.apache.curator
+ curator-x-discovery
+
+
+ org.apache.curator
+ curator-test
+
+
+ org.apache.hadoop
+ hadoop-common
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ add-source
+ generate-sources
+
+ add-source
+
+
+
+ src/gen/thrift/gen-javabean
+
+
+
+
+
+
+
+
+
+
+ thriftif
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+
+
+ generate-thrift-sources
+ generate-sources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ run
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+ enforce-property
+
+ enforce
+
+
+
+
+ thrift.home
+
+
+ true
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyService.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyService.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyService.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyService.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleAddGroupsResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAuthorizable.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAuthorizable.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAuthorizable.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TAuthorizable.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TCreateSentryRoleResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropPrivilegesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TDropSentryRoleResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesByAuthResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesForProviderResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryPrivilegesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TListSentryRolesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TRenamePrivilegesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryActiveRoleSet.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryActiveRoleSet.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryActiveRoleSet.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryActiveRoleSet.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryGrantOption.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryGrantOption.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryGrantOption.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryGrantOption.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilege.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilege.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilege.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilege.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilegeMap.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilegeMap.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilegeMap.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryPrivilegeMap.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryRole.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryRole.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryRole.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/generic/service/thrift/TSentryRole.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/SentryPolicyService.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/SentryPolicyService.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/SentryPolicyService.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/SentryPolicyService.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddGroupsResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleAddUsersResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteGroupsResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleDeleteUsersResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleGrantPrivilegeResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TAlterSentryRoleRevokePrivilegeResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TCreateSentryRoleResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropPrivilegesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TDropSentryRoleResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesByAuthResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesForProviderResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryPrivilegesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesForUserRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesForUserRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesForUserRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesForUserRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TRenamePrivilegesResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryActiveRoleSet.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryActiveRoleSet.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryActiveRoleSet.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryActiveRoleSet.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryAuthorizable.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryAuthorizable.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryAuthorizable.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryAuthorizable.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryConfigValueResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryExportMappingDataResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGrantOption.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGrantOption.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGrantOption.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGrantOption.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGroup.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGroup.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGroup.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryGroup.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataRequest.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataRequest.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataRequest.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataRequest.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataResponse.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataResponse.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataResponse.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryImportMappingDataResponse.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryMappingData.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryMappingData.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryMappingData.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryMappingData.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilege.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilege.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilege.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilege.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilegeMap.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilegeMap.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilegeMap.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryPrivilegeMap.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryRole.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryRole.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryRole.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TSentryRole.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/TSentryResponseStatus.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/TSentryResponseStatus.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/TSentryResponseStatus.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/TSentryResponseStatus.java
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/sentry_common_serviceConstants.java b/sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/sentry_common_serviceConstants.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/sentry_common_serviceConstants.java
rename to sentry-service/sentry-service-common/src/gen/thrift/gen-javabean/org/apache/sentry/service/thrift/sentry_common_serviceConstants.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/FixedJsonInstanceSerializer.java b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/provider/db/service/persistent/FixedJsonInstanceSerializer.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/FixedJsonInstanceSerializer.java
rename to sentry-service/sentry-service-common/src/main/java/org/apache/sentry/provider/db/service/persistent/FixedJsonInstanceSerializer.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/HAContext.java b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/provider/db/service/persistent/HAContext.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/HAContext.java
rename to sentry-service/sentry-service-common/src/main/java/org/apache/sentry/provider/db/service/persistent/HAContext.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/JaasConfiguration.java b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/JaasConfiguration.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/JaasConfiguration.java
rename to sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/JaasConfiguration.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceUtil.java b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/SentryServiceUtil.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceUtil.java
rename to sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/SentryServiceUtil.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java
rename to sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java
index 32a404457..5ec364c46 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java
+++ b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java
@@ -22,14 +22,14 @@
import javax.security.sasl.Sasl;
-import org.apache.sentry.provider.db.service.thrift.SentryMetrics;
-
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableMap;
public class ServiceConstants {
private static final ImmutableMap SASL_PROPERTIES;
+ public static final String SENTRY_POLICY_SERVICE_NAME = "SentryPolicyService";
+ public static final String SENTRY_GENERIC_SERVICE_NAME = "SentryGenericPolicyService";
static {
Map saslProps = new HashMap();
@@ -157,8 +157,6 @@ public static class ServerConfig {
public static final String SENTRY_WEB_PORT = "sentry.service.web.port";
public static final int SENTRY_WEB_PORT_DEFAULT = 29000;
public static final String SENTRY_REPORTER = "sentry.service.reporter";
- public static final String SENTRY_REPORTER_JMX = SentryMetrics.Reporting.JMX.name(); //case insensitive
- public static final String SENTRY_REPORTER_CONSOLE = SentryMetrics.Reporting.CONSOLE.name();//case insensitive
// Web SSL
public static final String SENTRY_WEB_USE_SSL = "sentry.web.use.ssl";
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/Status.java b/sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/Status.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/Status.java
rename to sentry-service/sentry-service-common/src/main/java/org/apache/sentry/service/thrift/Status.java
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry_common_service.thrift b/sentry-service/sentry-service-common/src/main/resources/sentry_common_service.thrift
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry_common_service.thrift
rename to sentry-service/sentry-service-common/src/main/resources/sentry_common_service.thrift
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry_generic_policy_service.thrift b/sentry-service/sentry-service-common/src/main/resources/sentry_generic_policy_service.thrift
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry_generic_policy_service.thrift
rename to sentry-service/sentry-service-common/src/main/resources/sentry_generic_policy_service.thrift
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry_policy_service.thrift b/sentry-service/sentry-service-common/src/main/resources/sentry_policy_service.thrift
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry_policy_service.thrift
rename to sentry-service/sentry-service-common/src/main/resources/sentry_policy_service.thrift
diff --git a/sentry-service/sentry-service-server/pom.xml b/sentry-service/sentry-service-server/pom.xml
new file mode 100644
index 000000000..1a4ef16bb
--- /dev/null
+++ b/sentry-service/sentry-service-server/pom.xml
@@ -0,0 +1,279 @@
+
+
+
+ 4.0.0
+
+ org.apache.sentry
+ sentry-service
+ 1.8.0-SNAPSHOT
+
+
+ sentry-service-server
+ Sentry Service Server
+
+
+
+ commons-lang
+ commons-lang
+
+
+ org.apache.derby
+ derby
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.slf4j
+ slf4j-log4j12
+
+
+ org.apache.thrift
+ libfb303
+
+
+ org.apache.thrift
+ libthrift
+
+
+ org.apache.sentry
+ sentry-service-client
+
+
+ org.apache.sentry
+ sentry-core-model-db
+
+
+ org.apache.sentry
+ sentry-core-model-kafka
+
+
+ org.apache.sentry
+ sentry-core-model-search
+
+
+ org.apache.sentry
+ sentry-core-model-sqoop
+
+
+ org.codehaus.jackson
+ jackson-core-asl
+
+
+ org.codehaus.jackson
+ jackson-mapper-asl
+
+
+ javax.jdo
+ jdo-api
+
+
+ com.codahale.metrics
+ metrics-core
+ ${metrics.version}
+
+
+ com.codahale.metrics
+ metrics-servlets
+ ${metrics.version}
+
+
+ com.codahale.metrics
+ metrics-jvm
+ ${metrics.version}
+
+
+ org.eclipse.jetty.aggregate
+ jetty-all
+
+
+ org.eclipse.jetty
+ jetty-server
+
+
+ org.eclipse.jetty
+ jetty-servlet
+
+
+ org.apache.hive
+ hive-beeline
+
+
+ org.mockito
+ mockito-all
+ test
+
+
+ org.apache.hadoop
+ hadoop-minikdc
+ test
+
+
+ junit
+ junit
+ test
+
+
+
+
+ ${basedir}/src/main/java
+ ${basedir}/src/test/java
+
+
+ ../../sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model
+
+ package.jdo
+
+
+
+ ${basedir}/src/main
+
+ webapp/*
+ webapp/css/*
+
+
+
+
+
+ com.google.code.maven-replacer-plugin
+ replacer
+ 1.5.2
+
+
+ replaceTokens
+ clean
+
+ replace
+
+
+
+
+ ${basedir}/src/main/webapp/SentryService.html
+
+
+ %PROJECT_VERSION%
+ ${version}
+
+
+
+
+
+ org.datanucleus
+ datanucleus-maven-plugin
+
+ JDO
+ **/*.jdo
+ true
+
+
+
+ process-classes
+
+ enhance
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ false
+
+
+
+
+
+
+
+ datanucleus3
+
+ true
+
+
+ 3.2.6
+ 3.2.12
+ 3.2.12
+
+
+
+ org.datanucleus
+ datanucleus-core
+ ${datanucleus-core.version}
+
+
+ org.datanucleus
+ datanucleus-api-jdo
+ ${datanucleus-api-jdo.version}
+
+
+ org.datanucleus
+ datanucleus-rdbms
+ ${datanucleus-rdbms.version}
+
+
+
+
+ datanucleus4
+
+ false
+
+
+ 4.2.1
+ 4.1.6
+ 4.1.7
+ 3.2.0-m3
+
+
+
+ org.datanucleus
+ datanucleus-core
+ ${datanucleus-core.version}
+
+
+ org.datanucleus
+ datanucleus-api-jdo
+ ${datanucleus-api-jdo.version}
+
+
+ org.datanucleus
+ datanucleus-rdbms
+ ${datanucleus-rdbms.version}
+
+
+ org.datanucleus
+ javax.jdo
+ ${datanucleus-jdo.version}
+
+
+
+
+
\ No newline at end of file
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java
index e960dcd08..c23042d06 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java
@@ -335,7 +335,7 @@ public Set getGroupsByRoles(String component, Set roles)
//get groups by roles
Query query = pm.newQuery(MSentryGroup.class);
StringBuilder filters = new StringBuilder();
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (String role : trimmedRoles) {
rolesFiler.add("role.roleName == \"" + role + "\" ");
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeObject.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeObject.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeObject.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeObject.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java
index fa9dadf48..b1180bff1 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java
@@ -74,7 +74,7 @@ public boolean checkPrivilegeOption(Set roles, PrivilegeObject priv
Query query = pm.newQuery(MSentryGMPrivilege.class);
StringBuilder filters = new StringBuilder();
if (roles != null && roles.size() > 0) {
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (MSentryRole role : roles) {
rolesFiler.add("role.roleName == \"" + role.getRoleName() + "\" ");
@@ -198,7 +198,7 @@ private Set populateIncludePrivileges(Set roles
filters.append(MSentryGMPrivilege.populateIncludePrivilegesQuery(parent));
// add filter for role names
if (roles != null && roles.size() > 0) {
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (MSentryRole role : roles) {
rolesFiler.add("role.roleName == \"" + role.getRoleName() + "\" ");
@@ -329,7 +329,7 @@ public Set getPrivilegesByRole(Set roles, Persiste
Query query = pm.newQuery(MSentryGMPrivilege.class);
StringBuilder filters = new StringBuilder();
// add filter for role names
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (MSentryRole role : roles) {
rolesFiler.add("role.roleName == \"" + role.getRoleName() + "\" ");
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandler.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandler.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandler.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandler.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandlerInvoker.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandlerInvoker.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandlerInvoker.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/NotificationHandlerInvoker.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessor.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessor.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessor.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessor.java
index 04e7ea9f5..e59d12a61 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessor.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessor.java
@@ -33,7 +33,7 @@
import org.apache.sentry.core.common.exception.SentrySiteConfigurationException;
import org.apache.sentry.core.model.db.AccessConstants;
import org.apache.sentry.core.common.utils.KeyValue;
-import org.apache.sentry.provider.common.AuthorizationComponent;
+import org.apache.sentry.core.common.utils.AuthorizationComponent;
import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
import org.apache.sentry.core.common.exception.SentryInvalidInputException;
@@ -75,7 +75,6 @@ public class SentryGenericPolicyProcessor implements SentryGenericPolicyService.
private final SentryStoreLayer store;
private final NotificationHandlerInvoker handerInvoker;
- public static final String SENTRY_GENERIC_SERVICE_NAME = "SentryGenericPolicyService";
private static final String ACCESS_DENIAL_MESSAGE = "Access denied to ";
public SentryGenericPolicyProcessor(Configuration conf) throws Exception {
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorFactory.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorFactory.java
similarity index 90%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorFactory.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorFactory.java
index 1cce1fc4b..e9ff6271a 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorFactory.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorFactory.java
@@ -19,6 +19,7 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.sentry.service.thrift.ProcessorFactory;
+import org.apache.sentry.service.thrift.ServiceConstants;
import org.apache.thrift.TMultiplexedProcessor;
import org.apache.thrift.TProcessor;
@@ -33,7 +34,7 @@ public boolean register(TMultiplexedProcessor multiplexedProcessor) throws Excep
SentryGenericPolicyProcessor processHandler = new SentryGenericPolicyProcessor(conf);
TProcessor processor = new SentryGenericPolicyProcessorWrapper(
processHandler);
- multiplexedProcessor.registerProcessor(SentryGenericPolicyProcessor.SENTRY_GENERIC_SERVICE_NAME, processor);
+ multiplexedProcessor.registerProcessor(ServiceConstants.SENTRY_GENERIC_SERVICE_NAME, processor);
return true;
}
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorWrapper.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorWrapper.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorWrapper.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericPolicyProcessorWrapper.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/appender/AuditLoggerTestAppender.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/appender/AuditLoggerTestAppender.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/appender/AuditLoggerTestAppender.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/appender/AuditLoggerTestAppender.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/appender/RollingFileWithoutDeleteAppender.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/appender/RollingFileWithoutDeleteAppender.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/appender/RollingFileWithoutDeleteAppender.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/appender/RollingFileWithoutDeleteAppender.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/AuditMetadataLogEntity.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/AuditMetadataLogEntity.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/AuditMetadataLogEntity.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/AuditMetadataLogEntity.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/DBAuditMetadataLogEntity.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/DBAuditMetadataLogEntity.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/DBAuditMetadataLogEntity.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/DBAuditMetadataLogEntity.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/GMAuditMetadataLogEntity.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/GMAuditMetadataLogEntity.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/GMAuditMetadataLogEntity.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/GMAuditMetadataLogEntity.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntity.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntity.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntity.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntity.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntityFactory.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntityFactory.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntityFactory.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/entity/JsonLogEntityFactory.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/util/CommandUtil.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/util/CommandUtil.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/util/CommandUtil.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/util/CommandUtil.java
index 328bbbbc0..3058650f7 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/util/CommandUtil.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/util/CommandUtil.java
@@ -24,6 +24,7 @@
import java.util.List;
import java.util.Set;
+import org.apache.commons.lang.StringUtils;
import org.apache.sentry.core.model.db.AccessConstants;
import org.apache.sentry.provider.db.generic.service.thrift.TAuthorizable;
import org.apache.sentry.provider.db.service.thrift.TAlterSentryRoleGrantPrivilegeRequest;
@@ -31,7 +32,6 @@
import org.apache.sentry.provider.db.service.thrift.TSentryGrantOption;
import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege;
import org.apache.sentry.service.thrift.ServiceConstants.PrivilegeScope;
-import org.datanucleus.util.StringUtils;
import com.google.common.annotations.VisibleForTesting;
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/util/Constants.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/util/Constants.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/log/util/Constants.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/log/util/Constants.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGMPrivilege.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGMPrivilege.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGMPrivilege.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGMPrivilege.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGroup.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGroup.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGroup.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryGroup.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryRole.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryRole.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryRole.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryRole.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUser.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUser.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUser.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUser.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryVersion.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryVersion.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryVersion.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryVersion.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/CommitContext.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/CommitContext.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/CommitContext.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/CommitContext.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
index b7ef0e94f..3adf273a1 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
@@ -58,9 +58,9 @@
import org.apache.sentry.core.common.exception.SentryNoSuchObjectException;
import org.apache.sentry.provider.db.service.model.MSentryGroup;
import org.apache.sentry.provider.db.service.model.MSentryPrivilege;
-import org.apache.sentry.provider.db.service.model.MSentryRole;
import org.apache.sentry.provider.db.service.model.MSentryUser;
import org.apache.sentry.provider.db.service.model.MSentryVersion;
+import org.apache.sentry.provider.db.service.model.MSentryRole;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor;
import org.apache.sentry.provider.db.service.thrift.TSentryActiveRoleSet;
import org.apache.sentry.provider.db.service.thrift.TSentryAuthorizable;
@@ -702,7 +702,7 @@ private Set getChildPrivileges(PersistenceManager pm, Set rolesFiler = new LinkedList();
for (String rName : roleNames) {
rolesFiler.add("role.roleName == \"" + trimAndLower(rName) + "\"");
@@ -1029,7 +1029,7 @@ private boolean hasAnyServerPrivileges(Set roleNames, String serverName)
try {
pm = openTransaction();
Query query = pm.newQuery(MSentryPrivilege.class);
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (String rName : roleNames) {
rolesFiler.add("role.roleName == \"" + trimAndLower(rName) + "\"");
@@ -1060,7 +1060,7 @@ List getMSentryPrivileges(Set roleNames, TSentryAuthor
try {
pm = openTransaction();
Query query = pm.newQuery(MSentryPrivilege.class);
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (String rName : roleNames) {
rolesFiler.add("role.roleName == \"" + trimAndLower(rName) + "\"");
@@ -1109,7 +1109,7 @@ List getMSentryPrivilegesByAuth(Set roleNames, TSentry
if (roleNames == null || roleNames.isEmpty()) {
filters.append(" !roles.isEmpty() ");
} else {
- query.declareVariables("org.apache.sentry.provider.db.service.model.MSentryRole role");
+ query.declareVariables("MSentryRole role");
List rolesFiler = new LinkedList();
for (String rName : roleNames) {
rolesFiler.add("role.roleName == \"" + trimAndLower(rName) + "\"");
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStoreSchemaInfo.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStoreSchemaInfo.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStoreSchemaInfo.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStoreSchemaInfo.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceRegister.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceRegister.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceRegister.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/ServiceRegister.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/ConfServlet.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/ConfServlet.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/ConfServlet.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/ConfServlet.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandler.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandler.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandler.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandler.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandlerInvoker.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandlerInvoker.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandlerInvoker.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/NotificationHandlerInvoker.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/PolicyStoreConstants.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/PolicyStoreConstants.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/PolicyStoreConstants.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/PolicyStoreConstants.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryAuthFilter.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryAuthFilter.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryAuthFilter.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryAuthFilter.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryHealthCheckServletContextListener.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryHealthCheckServletContextListener.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryHealthCheckServletContextListener.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryHealthCheckServletContextListener.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetrics.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetrics.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetrics.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetrics.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetricsServletContextListener.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetricsServletContextListener.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetricsServletContextListener.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetricsServletContextListener.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java
index 3de1f6588..5dff12a50 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java
@@ -32,7 +32,7 @@
import org.apache.sentry.core.common.exception.SentryUserException;
import org.apache.sentry.core.common.exception.SentrySiteConfigurationException;
import org.apache.sentry.core.model.db.AccessConstants;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.core.common.utils.PolicyFileConstants;
import org.apache.sentry.core.common.exception.SentryGroupNotFoundException;
import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
@@ -75,8 +75,6 @@ public class SentryPolicyStoreProcessor implements SentryPolicyService.Iface {
private static final Logger LOGGER = LoggerFactory.getLogger(SentryPolicyStoreProcessor.class);
private static final Logger AUDIT_LOGGER = LoggerFactory.getLogger(Constants.AUDIT_LOGGER_NAME);
- public static final String SENTRY_POLICY_SERVICE_NAME = "SentryPolicyService";
-
public static volatile SentryPolicyStoreProcessor instance;
private final String name;
@@ -143,7 +141,7 @@ private void initMetrics() {
} catch (IllegalArgumentException e) {
LOGGER.warn("Metrics reporting not configured correctly, please set " + ServerConfig.SENTRY_REPORTER +
- " to: " + ServerConfig.SENTRY_REPORTER_CONSOLE + "/" + ServerConfig.SENTRY_REPORTER_JMX);
+ " to: " + SentryMetrics.Reporting.CONSOLE.name() + "/" + SentryMetrics.Reporting.JMX.name());
}
}
}
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessorFactory.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessorFactory.java
similarity index 86%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessorFactory.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessorFactory.java
index 691c1fb81..45966e549 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessorFactory.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessorFactory.java
@@ -19,6 +19,7 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.sentry.service.thrift.ProcessorFactory;
+import org.apache.sentry.service.thrift.ServiceConstants;
import org.apache.thrift.TMultiplexedProcessor;
import org.apache.thrift.TProcessor;
@@ -29,11 +30,11 @@ public SentryPolicyStoreProcessorFactory(Configuration conf) {
public boolean register(TMultiplexedProcessor multiplexedProcessor) throws Exception {
SentryPolicyStoreProcessor sentryServiceHandler =
- new SentryPolicyStoreProcessor(SentryPolicyStoreProcessor.SENTRY_POLICY_SERVICE_NAME,
+ new SentryPolicyStoreProcessor(ServiceConstants.SENTRY_POLICY_SERVICE_NAME,
conf);
TProcessor processor =
new SentryProcessorWrapper(sentryServiceHandler);
- multiplexedProcessor.registerProcessor(SentryPolicyStoreProcessor.SENTRY_POLICY_SERVICE_NAME, processor);
+ multiplexedProcessor.registerProcessor(ServiceConstants.SENTRY_POLICY_SERVICE_NAME, processor);
return true;
}
}
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/ThriftUtil.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/ThriftUtil.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/ThriftUtil.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/thrift/ThriftUtil.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaHelper.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaHelper.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaHelper.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaHelper.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaTool.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaTool.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaTool.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/tools/SentrySchemaTool.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/GSSCallback.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/GSSCallback.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/GSSCallback.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/GSSCallback.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/KerberosConfiguration.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/KerberosConfiguration.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/KerberosConfiguration.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/KerberosConfiguration.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ProcessorFactory.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/ProcessorFactory.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ProcessorFactory.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/ProcessorFactory.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryKerberosContext.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryKerberosContext.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryKerberosContext.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryKerberosContext.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
rename to sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.derby.sql b/sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.derby.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.derby.sql
rename to sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.derby.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.mysql.sql b/sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.mysql.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.mysql.sql
rename to sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.mysql.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.oracle.sql b/sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.oracle.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.oracle.sql
rename to sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.oracle.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.postgres.sql b/sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.postgres.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/001-SENTRY-327.postgres.sql
rename to sentry-service/sentry-service-server/src/main/resources/001-SENTRY-327.postgres.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.derby.sql b/sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.derby.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.derby.sql
rename to sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.derby.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.mysql.sql b/sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.mysql.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.mysql.sql
rename to sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.mysql.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.oracle.sql b/sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.oracle.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.oracle.sql
rename to sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.oracle.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.postgres.sql b/sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.postgres.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/002-SENTRY-339.postgres.sql
rename to sentry-service/sentry-service-server/src/main/resources/002-SENTRY-339.postgres.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.derby.sql b/sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.derby.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.derby.sql
rename to sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.derby.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.mysql.sql b/sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.mysql.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.mysql.sql
rename to sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.mysql.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.oracle.sql b/sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.oracle.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.oracle.sql
rename to sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.oracle.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.postgres.sql b/sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.postgres.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/003-SENTRY-380.postgres.sql
rename to sentry-service/sentry-service-server/src/main/resources/003-SENTRY-380.postgres.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.derby.sql b/sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.derby.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.derby.sql
rename to sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.derby.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.mysql.sql b/sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.mysql.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.mysql.sql
rename to sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.mysql.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.oracle.sql b/sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.oracle.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.oracle.sql
rename to sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.oracle.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.postgres.sql b/sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.postgres.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/004-SENTRY-74.postgres.sql
rename to sentry-service/sentry-service-server/src/main/resources/004-SENTRY-74.postgres.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.derby.sql b/sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.derby.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.derby.sql
rename to sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.derby.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.mysql.sql b/sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.mysql.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.mysql.sql
rename to sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.mysql.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.oracle.sql b/sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.oracle.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.oracle.sql
rename to sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.oracle.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.postgres.sql b/sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.postgres.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.postgres.sql
rename to sentry-service/sentry-service-server/src/main/resources/005-SENTRY-398.postgres.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.derby.sql b/sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.derby.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.derby.sql
rename to sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.derby.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.mysql.sql b/sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.mysql.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.mysql.sql
rename to sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.mysql.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.oracle.sql b/sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.oracle.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.oracle.sql
rename to sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.oracle.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.postgres.sql b/sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.postgres.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.postgres.sql
rename to sentry-service/sentry-service-server/src/main/resources/006-SENTRY-711.postgres.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.4.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.4.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.4.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.4.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-db2-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.4.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.4.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.4.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.4.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-derby-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.4.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.4.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.4.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.4.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-mysql-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.4.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.4.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.4.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.4.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-oracle-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.4.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.4.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.4.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.4.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-postgres-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.4.0-to-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.4.0-to-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.4.0-to-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.4.0-to-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.5.0-to-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.5.0-to-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.5.0-to-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.5.0-to-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.6.0-to-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.6.0-to-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.6.0-to-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.6.0-to-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.7.0-to-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.7.0-to-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.7.0-to-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-db2-1.7.0-to-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.4.0-to-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.4.0-to-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.4.0-to-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.4.0-to-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.5.0-to-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.5.0-to-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.5.0-to-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.5.0-to-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.6.0-to-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.6.0-to-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.6.0-to-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.6.0-to-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.7.0-to-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.7.0-to-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-1.7.0-to-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-derby-1.7.0-to-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.4.0-to-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.4.0-to-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.4.0-to-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.4.0-to-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.5.0-to-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.5.0-to-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.5.0-to-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.5.0-to-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.6.0-to-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.6.0-to-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.6.0-to-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.6.0-to-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.7.0-to-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.7.0-to-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-1.7.0-to-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-mysql-1.7.0-to-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.4.0-to-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.4.0-to-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.4.0-to-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.4.0-to-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.5.0-to-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.5.0-to-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.5.0-to-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.5.0-to-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.6.0-to-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.6.0-to-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.6.0-to-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.6.0-to-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.7.0-to-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.7.0-to-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-1.7.0-to-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-oracle-1.7.0-to-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.4.0-to-1.5.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.4.0-to-1.5.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.4.0-to-1.5.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.4.0-to-1.5.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.5.0-to-1.6.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.5.0-to-1.6.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.5.0-to-1.6.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.5.0-to-1.6.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.6.0-to-1.7.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.6.0-to-1.7.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.6.0-to-1.7.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.6.0-to-1.7.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.7.0-to-1.8.0.sql b/sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.7.0-to-1.8.0.sql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-1.7.0-to-1.8.0.sql
rename to sentry-service/sentry-service-server/src/main/resources/sentry-upgrade-postgres-1.7.0-to-1.8.0.sql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.db2 b/sentry-service/sentry-service-server/src/main/resources/upgrade.order.db2
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.db2
rename to sentry-service/sentry-service-server/src/main/resources/upgrade.order.db2
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.derby b/sentry-service/sentry-service-server/src/main/resources/upgrade.order.derby
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.derby
rename to sentry-service/sentry-service-server/src/main/resources/upgrade.order.derby
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.mysql b/sentry-service/sentry-service-server/src/main/resources/upgrade.order.mysql
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.mysql
rename to sentry-service/sentry-service-server/src/main/resources/upgrade.order.mysql
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.oracle b/sentry-service/sentry-service-server/src/main/resources/upgrade.order.oracle
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.oracle
rename to sentry-service/sentry-service-server/src/main/resources/upgrade.order.oracle
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.postgres b/sentry-service/sentry-service-server/src/main/resources/upgrade.order.postgres
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/resources/upgrade.order.postgres
rename to sentry-service/sentry-service-server/src/main/resources/upgrade.order.postgres
diff --git a/sentry-provider/sentry-provider-db/src/main/webapp/SentryService.html b/sentry-service/sentry-service-server/src/main/webapp/SentryService.html
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/webapp/SentryService.html
rename to sentry-service/sentry-service-server/src/main/webapp/SentryService.html
diff --git a/sentry-provider/sentry-provider-db/src/main/webapp/css/bootstrap-theme.min.css b/sentry-service/sentry-service-server/src/main/webapp/css/bootstrap-theme.min.css
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/webapp/css/bootstrap-theme.min.css
rename to sentry-service/sentry-service-server/src/main/webapp/css/bootstrap-theme.min.css
diff --git a/sentry-provider/sentry-provider-db/src/main/webapp/css/bootstrap.min.css b/sentry-service/sentry-service-server/src/main/webapp/css/bootstrap.min.css
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/webapp/css/bootstrap.min.css
rename to sentry-service/sentry-service-server/src/main/webapp/css/bootstrap.min.css
diff --git a/sentry-provider/sentry-provider-db/src/main/webapp/css/sentry.css b/sentry-service/sentry-service-server/src/main/webapp/css/sentry.css
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/webapp/css/sentry.css
rename to sentry-service/sentry-service-server/src/main/webapp/css/sentry.css
diff --git a/sentry-provider/sentry-provider-db/src/main/webapp/sentry.png b/sentry-service/sentry-service-server/src/main/webapp/sentry.png
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/main/webapp/sentry.png
rename to sentry-service/sentry-service-server/src/main/webapp/sentry.png
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java
index f14b58667..590900f1a 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java
@@ -21,7 +21,7 @@
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
import org.junit.After;
import org.junit.AfterClass;
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestDelegateSentryStore.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestDelegateSentryStore.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestDelegateSentryStore.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestDelegateSentryStore.java
index 1ab5f037f..5ada04c3d 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestDelegateSentryStore.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestDelegateSentryStore.java
@@ -24,7 +24,7 @@
import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
import org.apache.sentry.core.common.exception.SentryNoSuchObjectException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestPrivilegeOperatePersistence.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestPrivilegeOperatePersistence.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestPrivilegeOperatePersistence.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestPrivilegeOperatePersistence.java
index 799d5ef40..714ed23f3 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestPrivilegeOperatePersistence.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestPrivilegeOperatePersistence.java
@@ -36,7 +36,7 @@
import org.apache.sentry.core.model.sqoop.SqoopActionConstant;
import org.apache.sentry.core.common.exception.SentryGrantDeniedException;
import org.apache.sentry.provider.db.generic.service.persistent.PrivilegeObject.Builder;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.ServiceConstants;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryGMPrivilege.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryGMPrivilege.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryGMPrivilege.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryGMPrivilege.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryRole.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryRole.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryRole.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/TestSentryRole.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceIntegrationBase.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceIntegrationBase.java
similarity index 79%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceIntegrationBase.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceIntegrationBase.java
index 94cade1ef..89d549e52 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceIntegrationBase.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/SentryGenericServiceIntegrationBase.java
@@ -37,15 +37,15 @@ public class SentryGenericServiceIntegrationBase extends SentryServiceIntegratio
public void connectToSentryService() throws Exception {
// The client should already be logged in when running in solr
// therefore we must manually login in the integration tests
- if (kerberos) {
- this.client = clientUgi.doAs( new PrivilegedExceptionAction() {
+ if (SentryServiceIntegrationBase.kerberos) {
+ this.client = SentryServiceIntegrationBase.clientUgi.doAs( new PrivilegedExceptionAction() {
@Override
public SentryGenericServiceClient run() throws Exception {
- return SentryGenericServiceClientFactory.create(conf);
+ return SentryGenericServiceClientFactory.create(SentryServiceIntegrationBase.conf);
}
});
} else {
- this.client = SentryGenericServiceClientFactory.create(conf);
+ this.client = SentryGenericServiceClientFactory.create(SentryServiceIntegrationBase.conf);
}
}
@@ -55,9 +55,9 @@ public void after() {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- Set tRoles = client.listAllRoles(ADMIN_USER, SOLR);
+ Set tRoles = client.listAllRoles(SentryServiceIntegrationBase.ADMIN_USER, SOLR);
for (TSentryRole tRole : tRoles) {
- client.dropRole(ADMIN_USER, tRole.getRoleName(), SOLR);
+ client.dropRole(SentryServiceIntegrationBase.ADMIN_USER, tRole.getRoleName(), SOLR);
}
if(client != null) {
client.close();
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestAuditLogForSentryGenericService.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestAuditLogForSentryGenericService.java
similarity index 94%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestAuditLogForSentryGenericService.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestAuditLogForSentryGenericService.java
index 6c7d22d4b..187676d9a 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestAuditLogForSentryGenericService.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestAuditLogForSentryGenericService.java
@@ -66,9 +66,9 @@ public void after() {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- Set tRoles = client.listAllRoles(ADMIN_USER, COMPONENT);
+ Set tRoles = client.listAllRoles(SentryServiceIntegrationBase.ADMIN_USER, COMPONENT);
for (TSentryRole tRole : tRoles) {
- client.dropRole(ADMIN_USER, tRole.getRoleName(), COMPONENT);
+ client.dropRole(SentryServiceIntegrationBase.ADMIN_USER, tRole.getRoleName(), COMPONENT);
}
if (client != null) {
client.close();
@@ -88,15 +88,15 @@ public void runTestAsSubject() throws Exception {
*/
@Override
public void connectToSentryService() throws Exception {
- if (kerberos) {
- this.client = clientUgi.doAs(new PrivilegedExceptionAction() {
+ if (SentryServiceIntegrationBase.kerberos) {
+ this.client = SentryServiceIntegrationBase.clientUgi.doAs(new PrivilegedExceptionAction() {
@Override
public SentryGenericServiceClient run() throws Exception {
- return SentryGenericServiceClientFactory.create(conf);
+ return SentryGenericServiceClientFactory.create(SentryServiceIntegrationBase.conf);
}
});
} else {
- this.client = SentryGenericServiceClientFactory.create(conf);
+ this.client = SentryGenericServiceClientFactory.create(SentryServiceIntegrationBase.conf);
}
}
@@ -105,8 +105,8 @@ public void testAuditLogForGenericModel() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_r";
String testGroupName = "g1";
String action = "all";
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericPolicyProcessor.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericPolicyProcessor.java
similarity index 83%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericPolicyProcessor.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericPolicyProcessor.java
index 11dd5e20c..8b3599fd9 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericPolicyProcessor.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericPolicyProcessor.java
@@ -17,11 +17,6 @@
*/
package org.apache.sentry.provider.db.generic.service.thrift;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyListOf;
-import static org.mockito.Matchers.anySetOf;
-import static org.mockito.Matchers.anyString;
-
import java.util.*;
import org.apache.hadoop.conf.Configuration;
@@ -30,7 +25,7 @@
import org.apache.sentry.core.model.search.Collection;
import org.apache.sentry.core.model.search.Field;
import org.apache.sentry.core.model.search.SearchConstants;
-import org.apache.sentry.provider.common.GroupMappingService;
+import org.apache.sentry.core.common.service.GroupMappingService;
import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
import org.apache.sentry.core.common.exception.SentryGrantDeniedException;
import org.apache.sentry.core.common.exception.SentryInvalidInputException;
@@ -48,6 +43,7 @@
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
+import org.mockito.Matchers;
import com.google.common.collect.Sets;
@@ -114,33 +110,33 @@ private Status fromTSentryStatus(TSentryResponseStatus status) {
@Test
public void testAdminOperation() throws Exception {
- Mockito.when(mockStore.createRole(anyString(), anyString(), anyString()))
+ Mockito.when(mockStore.createRole(Matchers.anyString(), Matchers.anyString(), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID));
- Mockito.when(mockStore.dropRole(anyString(), anyString(), anyString()))
+ Mockito.when(mockStore.dropRole(Matchers.anyString(), Matchers.anyString(), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 1));
- Mockito.when(mockStore.alterRoleAddGroups(anyString(), anyString(), anySetOf(String.class),anyString()))
+ Mockito.when(mockStore.alterRoleAddGroups(Matchers.anyString(), Matchers.anyString(), Matchers.anySetOf(String.class), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 2));
- Mockito.when(mockStore.alterRoleDeleteGroups(anyString(), anyString(),anySetOf(String.class), anyString()))
+ Mockito.when(mockStore.alterRoleDeleteGroups(Matchers.anyString(), Matchers.anyString(), Matchers.anySetOf(String.class), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 3));
- Mockito.when(mockStore.dropPrivilege(anyString(), any(PrivilegeObject.class), anyString()))
+ Mockito.when(mockStore.dropPrivilege(Matchers.anyString(), Matchers.any(PrivilegeObject.class), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 4));
- Mockito.when(mockStore.renamePrivilege(anyString(), anyString(), anyListOf(Authorizable.class),
- anyListOf(Authorizable.class), anyString()))
+ Mockito.when(mockStore.renamePrivilege(Matchers.anyString(), Matchers.anyString(), Matchers.anyListOf(Authorizable.class),
+ Matchers.anyListOf(Authorizable.class), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 5));
testOperation(ADMIN_USER, Status.OK);
}
@Test
public void testGrantAndRevokePrivilege() throws Exception {
- Mockito.when(mockStore.alterRoleGrantPrivilege(anyString(), anyString(), any(PrivilegeObject.class), anyString()))
+ Mockito.when(mockStore.alterRoleGrantPrivilege(Matchers.anyString(), Matchers.anyString(), Matchers.any(PrivilegeObject.class), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 6));
- Mockito.when(mockStore.alterRoleRevokePrivilege(anyString(), anyString(),any(PrivilegeObject.class), anyString()))
+ Mockito.when(mockStore.alterRoleRevokePrivilege(Matchers.anyString(), Matchers.anyString(), Matchers.any(PrivilegeObject.class), Matchers.anyString()))
.thenReturn(new CommitContext(SERVER_UUID, SEQ_ID + 7));
setup();
@@ -162,35 +158,35 @@ public void testGrantAndRevokePrivilege() throws Exception {
@Test
public void testOperationWithException() throws Exception {
- String roleName = anyString();
- Mockito.when(mockStore.createRole(anyString(), roleName, anyString()))
+ String roleName = Matchers.anyString();
+ Mockito.when(mockStore.createRole(Matchers.anyString(), roleName, Matchers.anyString()))
.thenThrow(new SentryAlreadyExistsException("Role: " + roleName + " already exists"));
- roleName = anyString();
- Mockito.when(mockStore.dropRole(anyString(), roleName, anyString()))
+ roleName = Matchers.anyString();
+ Mockito.when(mockStore.dropRole(Matchers.anyString(), roleName, Matchers.anyString()))
.thenThrow(new SentryNoSuchObjectException("Role: " + roleName + " doesn't exist"));
- roleName = anyString();
- Mockito.when(mockStore.alterRoleAddGroups(anyString(), roleName, anySetOf(String.class),anyString()))
+ roleName = Matchers.anyString();
+ Mockito.when(mockStore.alterRoleAddGroups(Matchers.anyString(), roleName, Matchers.anySetOf(String.class), Matchers.anyString()))
.thenThrow(new SentryNoSuchObjectException("Role: " + roleName + " doesn't exist"));
- roleName = anyString();
- Mockito.when(mockStore.alterRoleDeleteGroups(anyString(), roleName, anySetOf(String.class), anyString()))
+ roleName = Matchers.anyString();
+ Mockito.when(mockStore.alterRoleDeleteGroups(Matchers.anyString(), roleName, Matchers.anySetOf(String.class), Matchers.anyString()))
.thenThrow(new SentryNoSuchObjectException("Role: " + roleName + " doesn't exist"));
- roleName = anyString();
- Mockito.when(mockStore.alterRoleGrantPrivilege(anyString(), roleName, any(PrivilegeObject.class), anyString()))
+ roleName = Matchers.anyString();
+ Mockito.when(mockStore.alterRoleGrantPrivilege(Matchers.anyString(), roleName, Matchers.any(PrivilegeObject.class), Matchers.anyString()))
.thenThrow(new SentryGrantDeniedException("Role: " + roleName + " is not allowed to do grant"));
- roleName = anyString();
- Mockito.when(mockStore.alterRoleRevokePrivilege(anyString(), roleName, any(PrivilegeObject.class), anyString()))
+ roleName = Matchers.anyString();
+ Mockito.when(mockStore.alterRoleRevokePrivilege(Matchers.anyString(), roleName, Matchers.any(PrivilegeObject.class), Matchers.anyString()))
.thenThrow(new SentryGrantDeniedException("Role: " + roleName + " is not allowed to do grant"));
- Mockito.when(mockStore.dropPrivilege(anyString(), any(PrivilegeObject.class), anyString()))
+ Mockito.when(mockStore.dropPrivilege(Matchers.anyString(), Matchers.any(PrivilegeObject.class), Matchers.anyString()))
.thenThrow(new SentryInvalidInputException("Invalid input privilege object"));
- Mockito.when(mockStore.renamePrivilege(anyString(), anyString(), anyListOf(Authorizable.class),
- anyListOf(Authorizable.class), anyString()))
+ Mockito.when(mockStore.renamePrivilege(Matchers.anyString(), Matchers.anyString(), Matchers.anyListOf(Authorizable.class),
+ Matchers.anyListOf(Authorizable.class), Matchers.anyString()))
.thenThrow(new RuntimeException("Unknown error"));
setup();
@@ -263,17 +259,17 @@ public void testGetRolesAndPrivileges() throws Exception {
MSentryRole role = new MSentryRole("r1", 290);
mSentryGMPrivilege.setRoles(Sets.newHashSet(role));
- Mockito.when(mockStore.getRolesByGroups(anyString(), anySetOf(String.class)))
+ Mockito.when(mockStore.getRolesByGroups(Matchers.anyString(), Matchers.anySetOf(String.class)))
.thenReturn(Sets.newHashSet(roleName));
- Mockito.when(mockStore.getPrivilegesByProvider(anyString(), anyString(), anySetOf(String.class),
- anySetOf(String.class), anyListOf(Authorizable.class)))
+ Mockito.when(mockStore.getPrivilegesByProvider(Matchers.anyString(), Matchers.anyString(), Matchers.anySetOf(String.class),
+ Matchers.anySetOf(String.class), Matchers.anyListOf(Authorizable.class)))
.thenReturn(Sets.newHashSet(queryPrivilege, updatePrivilege));
- Mockito.when(mockStore.getGroupsByRoles(anyString(), anySetOf(String.class)))
+ Mockito.when(mockStore.getGroupsByRoles(Matchers.anyString(), Matchers.anySetOf(String.class)))
.thenReturn(Sets.newHashSet(groupName));
- Mockito.when(mockStore.getPrivilegesByAuthorizable(anyString(), anyString(), anySetOf(String.class), anyListOf(Authorizable.class)))
+ Mockito.when(mockStore.getPrivilegesByAuthorizable(Matchers.anyString(), Matchers.anyString(), Matchers.anySetOf(String.class), Matchers.anyListOf(Authorizable.class)))
.thenReturn(Sets.newHashSet(mSentryGMPrivilege));
Mockito.when(mockStore.getAllRoleNames())
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceIntegration.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceIntegration.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceIntegration.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceIntegration.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryConfigToolSolr.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryConfigToolSolr.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryConfigToolSolr.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryConfigToolSolr.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellKafka.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellKafka.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellKafka.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellKafka.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellSolr.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellSolr.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellSolr.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/tools/TestSentryShellSolr.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/appender/TestRollingFileWithoutDeleteAppender.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/appender/TestRollingFileWithoutDeleteAppender.java
similarity index 82%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/appender/TestRollingFileWithoutDeleteAppender.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/appender/TestRollingFileWithoutDeleteAppender.java
index ca9062bca..50785fd30 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/appender/TestRollingFileWithoutDeleteAppender.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/appender/TestRollingFileWithoutDeleteAppender.java
@@ -18,16 +18,13 @@
package org.apache.sentry.provider.db.log.appender;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertTrue;
-
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -45,7 +42,7 @@ public void init() {
@Test
public void testRollOver() throws Throwable {
if (dataDir == null) {
- fail("Excepted temp folder for audit log is created.");
+ Assert.fail("Excepted temp folder for audit log is created.");
}
RollingFileWithoutDeleteAppender appender = new RollingFileWithoutDeleteAppender(
new PatternLayout("%m%n"), dataDir.getPath() + "/auditLog.log");
@@ -63,12 +60,12 @@ public void testRollOver() throws Throwable {
if (dataDir != null) {
File[] files = dataDir.listFiles();
if (files != null) {
- assertEquals(files.length, 10);
+ Assert.assertEquals(files.length, 10);
} else {
- fail("Excepted 10 log files.");
+ Assert.fail("Excepted 10 log files.");
}
} else {
- fail("Excepted 10 log files.");
+ Assert.fail("Excepted 10 log files.");
}
}
@@ -80,7 +77,7 @@ public void testRollOver() throws Throwable {
@Test
public void testFileNamePattern() throws Throwable {
if (dataDir == null) {
- fail("Excepted temp folder for audit log is created.");
+ Assert.fail("Excepted temp folder for audit log is created.");
}
RollingFileWithoutDeleteAppender appender = new RollingFileWithoutDeleteAppender(
new PatternLayout("%m%n"), dataDir.getPath() + "/auditLog.log");
@@ -89,11 +86,11 @@ public void testFileNamePattern() throws Throwable {
sentryLogger.debug("123456789012345");
File[] files = dataDir.listFiles();
if (files != null) {
- assertEquals(files.length, 2);
- assertTrue(files[0].getName().contains("auditLog.log."));
- assertTrue(files[1].getName().contains("auditLog.log."));
+ Assert.assertEquals(files.length, 2);
+ Assert.assertTrue(files[0].getName().contains("auditLog.log."));
+ Assert.assertTrue(files[1].getName().contains("auditLog.log."));
} else {
- fail("Excepted 2 log files.");
+ Assert.fail("Excepted 2 log files.");
}
}
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestDbAuditMetadataLogEntity.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestDbAuditMetadataLogEntity.java
similarity index 93%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestDbAuditMetadataLogEntity.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestDbAuditMetadataLogEntity.java
index 3d336af94..3d15b4f10 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestDbAuditMetadataLogEntity.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestDbAuditMetadataLogEntity.java
@@ -18,12 +18,10 @@
package org.apache.sentry.provider.db.log.entity;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
import org.apache.sentry.provider.db.log.util.Constants;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ContainerNode;
+import org.junit.Assert;
import org.junit.Test;
public class TestDbAuditMetadataLogEntity {
@@ -56,13 +54,13 @@ public void testToJsonFormatLog() throws Throwable {
void assertEntryEquals(ContainerNode rootNode, String key, String value) {
JsonNode node = assertNodeContains(rootNode, key);
- assertEquals(value, node.getTextValue());
+ Assert.assertEquals(value, node.getTextValue());
}
private JsonNode assertNodeContains(ContainerNode rootNode, String key) {
JsonNode node = rootNode.get(key);
if (node == null) {
- fail("No entry of name \"" + key + "\" found in " + rootNode.toString());
+ Assert.fail("No entry of name \"" + key + "\" found in " + rootNode.toString());
}
return node;
}
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestGMAuditMetadataLogEntity.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestGMAuditMetadataLogEntity.java
similarity index 93%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestGMAuditMetadataLogEntity.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestGMAuditMetadataLogEntity.java
index bbee1b489..62b46f6c8 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestGMAuditMetadataLogEntity.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestGMAuditMetadataLogEntity.java
@@ -18,15 +18,13 @@
package org.apache.sentry.provider.db.log.entity;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
import java.util.HashMap;
import java.util.Map;
import org.apache.sentry.provider.db.log.util.Constants;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ContainerNode;
+import org.junit.Assert;
import org.junit.Test;
public class TestGMAuditMetadataLogEntity {
@@ -61,13 +59,13 @@ public void testToJsonFormatLog() throws Throwable {
void assertEntryEquals(ContainerNode rootNode, String key, String value) {
JsonNode node = assertNodeContains(rootNode, key);
- assertEquals(value, node.getTextValue());
+ Assert.assertEquals(value, node.getTextValue());
}
private JsonNode assertNodeContains(ContainerNode rootNode, String key) {
JsonNode node = rootNode.get(key);
if (node == null) {
- fail("No entry of name \"" + key + "\" found in " + rootNode.toString());
+ Assert.fail("No entry of name \"" + key + "\" found in " + rootNode.toString());
}
return node;
}
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactory.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactory.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactory.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactory.java
index 1ec884041..bf206ea04 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactory.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactory.java
@@ -125,7 +125,7 @@ public void testGrantRole() {
DBAuditMetadataLogEntity amle = new DBAuditMetadataLogEntity();
Set amles = JsonLogEntityFactory
.getInstance().createJsonLogEntitys(request, response, conf);
- assertEquals(amles.size(),1);
+ assertEquals(amles.size(), 1);
amle = (DBAuditMetadataLogEntity) amles.iterator().next();
assertCommon(amle, Constants.TRUE, Constants.OPERATION_GRANT_PRIVILEGE,
@@ -140,7 +140,7 @@ public void testGrantRole() {
response.setStatus(Status.InvalidInput("", null));
amles = JsonLogEntityFactory.getInstance()
.createJsonLogEntitys(request, response, conf);
- assertEquals(amles.size(),1);
+ assertEquals(amles.size(), 1);
amle = (DBAuditMetadataLogEntity) amles.iterator().next();
assertCommon(amle, Constants.FALSE, Constants.OPERATION_GRANT_PRIVILEGE,
@@ -164,7 +164,7 @@ public void testRevokeRole() {
DBAuditMetadataLogEntity amle = new DBAuditMetadataLogEntity();
Set amles = JsonLogEntityFactory
.getInstance().createJsonLogEntitys(request, response, conf);
- assertEquals(amles.size(),1);
+ assertEquals(amles.size(), 1);
amle = (DBAuditMetadataLogEntity) amles.iterator().next();
assertCommon(amle, Constants.TRUE, Constants.OPERATION_REVOKE_PRIVILEGE,
@@ -179,7 +179,7 @@ public void testRevokeRole() {
response.setStatus(Status.InvalidInput("", null));
amles = JsonLogEntityFactory.getInstance()
.createJsonLogEntitys(request, response, conf);
- assertEquals(amles.size(),1);
+ assertEquals(amles.size(), 1);
amle = (DBAuditMetadataLogEntity) amles.iterator().next();
assertCommon(amle, Constants.FALSE, Constants.OPERATION_REVOKE_PRIVILEGE,
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactoryGM.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactoryGM.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactoryGM.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/entity/TestJsonLogEntityFactoryGM.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/util/TestCommandUtil.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/util/TestCommandUtil.java
similarity index 88%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/util/TestCommandUtil.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/util/TestCommandUtil.java
index 8cf0e70e9..74e9dd81c 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/log/util/TestCommandUtil.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/log/util/TestCommandUtil.java
@@ -47,8 +47,8 @@ public void testCreateCmdForCreateOrDropRole() {
String createRoleCmdExcepted = "CREATE ROLE testRole";
String dropRoleCmdExcepted = "DROP ROLE testRole";
- assertEquals(createRoleCmdExcepted, createRoleCmdResult);
- assertEquals(dropRoleCmdResult, dropRoleCmdExcepted);
+ Assert.assertEquals(createRoleCmdExcepted, createRoleCmdResult);
+ Assert.assertEquals(dropRoleCmdResult, dropRoleCmdExcepted);
}
@Test
@@ -61,8 +61,8 @@ public void testCreateCmdForRoleAddOrDeleteGroup1() {
getGroupStr(1));
String createRoleDeleteGroupCmdExcepted = "REVOKE ROLE testRole FROM GROUP testGroup1";
- assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
- assertEquals(createRoleDeleteGroupCmdExcepted,
+ Assert.assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
+ Assert.assertEquals(createRoleDeleteGroupCmdExcepted,
createRoleDeleteGroupCmdResult);
}
@@ -75,8 +75,8 @@ public void testCreateCmdForRoleAddOrDeleteGroup2() {
getGroupStr(3));
String createRoleDeleteGroupCmdExcepted = "REVOKE ROLE testRole FROM GROUP testGroup1, testGroup2, testGroup3";
- assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
- assertEquals(createRoleDeleteGroupCmdExcepted,
+ Assert.assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
+ Assert.assertEquals(createRoleDeleteGroupCmdExcepted,
createRoleDeleteGroupCmdResult);
}
@@ -89,8 +89,8 @@ public void testCreateCmdForRoleAddOrDeleteUser1() {
CommandUtil.createCmdForRoleDeleteUser("testRole", getUserStr(1));
String createRoleDeleteGroupCmdExcepted = "REVOKE ROLE testRole FROM USER testUser1";
- assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
- assertEquals(createRoleDeleteGroupCmdExcepted, createRoleDeleteGroupCmdResult);
+ Assert.assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
+ Assert.assertEquals(createRoleDeleteGroupCmdExcepted, createRoleDeleteGroupCmdResult);
}
@Test
@@ -104,8 +104,8 @@ public void testCreateCmdForRoleAddOrDeleteUser2() {
String createRoleDeleteGroupCmdExcepted =
"REVOKE ROLE testRole FROM USER testUser1, testUser2, testUser3";
- assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
- assertEquals(createRoleDeleteGroupCmdExcepted, createRoleDeleteGroupCmdResult);
+ Assert.assertEquals(createRoleAddGroupCmdExcepted, createRoleAddGroupCmdResult);
+ Assert.assertEquals(createRoleDeleteGroupCmdExcepted, createRoleDeleteGroupCmdResult);
}
@Test
@@ -128,8 +128,8 @@ public void testCreateCmdForGrantOrRevokePrivilege1() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE ALL ON DATABASE dbTest FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -153,8 +153,8 @@ public void testCreateCmdForGrantOrRevokePrivilege2() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE INSERT ON DATABASE dbTest FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -178,8 +178,8 @@ public void testCreateCmdForGrantOrRevokePrivilege3() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE SELECT ON DATABASE dbTest FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -203,8 +203,8 @@ public void testCreateCmdForGrantOrRevokePrivilege4() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE null ON DATABASE dbTest FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -228,8 +228,8 @@ public void testCreateCmdForGrantOrRevokePrivilege5() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE SELECT ON TABLE tableTest FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -253,8 +253,8 @@ public void testCreateCmdForGrantOrRevokePrivilege6() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE SELECT ON SERVER serverTest FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -278,8 +278,8 @@ public void testCreateCmdForGrantOrRevokePrivilege7() {
.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE SELECT ON URI hdfs://namenode:port/path/to/dir FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted,
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted,
createRevokePrivilegeCmdResult);
}
@@ -301,8 +301,8 @@ public void testCreateCmdForGrantOrRevokePrivilege8() {
String createRevokePrivilegeCmdResult = CommandUtil.createCmdForRevokePrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE SELECT ON SERVER serverTest FROM ROLE testRole WITH GRANT OPTION";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted, createRevokePrivilegeCmdResult);
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted, createRevokePrivilegeCmdResult);
}
// generate the command without grant option
@@ -320,8 +320,8 @@ public void testCreateCmdForGrantOrRevokeGMPrivilege1() {
.createCmdForRevokeGMPrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE ACTION ON resourceType1 resourceName1 resourceType2 resourceName2 FROM ROLE testRole";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted, createRevokePrivilegeCmdResult);
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted, createRevokePrivilegeCmdResult);
}
// generate the command with grant option
@@ -341,8 +341,8 @@ public void testCreateCmdForGrantOrRevokeGMPrivilege2() {
.createCmdForRevokeGMPrivilege(revokeRequest);
String createRevokePrivilegeCmdExcepted = "REVOKE ACTION ON resourceType1 resourceName1 resourceType2 resourceName2 FROM ROLE testRole WITH GRANT OPTION";
- assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
- assertEquals(createRevokePrivilegeCmdExcepted, createRevokePrivilegeCmdResult);
+ Assert.assertEquals(createGrantPrivilegeCmdExcepted, createGrantPrivilegeCmdResult);
+ Assert.assertEquals(createRevokePrivilegeCmdExcepted, createRevokePrivilegeCmdResult);
}
private String getGroupStr(int num) {
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryPrivilege.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryPrivilege.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryPrivilege.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryPrivilege.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryServiceDiscovery.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryServiceDiscovery.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryServiceDiscovery.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryServiceDiscovery.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
index bc7fe12b7..600e1185a 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
@@ -43,7 +43,7 @@
import org.apache.sentry.provider.db.service.thrift.TSentryGroup;
import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege;
import org.apache.sentry.provider.db.service.thrift.TSentryRole;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
import org.junit.After;
import org.junit.AfterClass;
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java
similarity index 99%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java
index 3ff97dfdc..d1a88b0a9 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java
@@ -36,7 +36,7 @@
import org.apache.sentry.provider.db.service.thrift.TSentryGrantOption;
import org.apache.sentry.provider.db.service.thrift.TSentryMappingData;
import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.ServiceConstants.PrivilegeScope;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
import org.junit.After;
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreToAuthorizable.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreToAuthorizable.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreToAuthorizable.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreToAuthorizable.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java
index a8e8a035b..103dbb609 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java
@@ -56,7 +56,6 @@ public void testVerifySentryVersionCheck() throws Exception {
SentryStore sentryStore = new SentryStore(conf);
sentryStore.stop();
conf.set(ServerConfig.SENTRY_VERIFY_SCHEM_VERSION, "true");
- sentryStore = new SentryStore(conf);
}
/**
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/SentryMiniKdcTestcase.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/SentryMiniKdcTestcase.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/SentryMiniKdcTestcase.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/SentryMiniKdcTestcase.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestAuthorizingDDLAuditLogWithKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestAuthorizingDDLAuditLogWithKerberos.java
similarity index 98%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestAuthorizingDDLAuditLogWithKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestAuthorizingDDLAuditLogWithKerberos.java
index 426b2f7ab..48f25ddf5 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestAuthorizingDDLAuditLogWithKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestAuthorizingDDLAuditLogWithKerberos.java
@@ -54,8 +54,8 @@ public void testBasic() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestConnectionWithTicketTimeout.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestConnectionWithTicketTimeout.java
similarity index 75%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestConnectionWithTicketTimeout.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestConnectionWithTicketTimeout.java
index 36fa4b5e3..c6177d414 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestConnectionWithTicketTimeout.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestConnectionWithTicketTimeout.java
@@ -19,29 +19,29 @@
package org.apache.sentry.provider.db.service.thrift;
import org.apache.hadoop.minikdc.MiniKdc;
+import org.apache.sentry.service.thrift.SentryServiceIntegrationBase;
import org.apache.sentry.service.thrift.ServiceConstants;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@Ignore("SENTRY-515: Not part of automated unit testing, as it takes too long. Fails until we move to a hadoop 2.6.1. See HADOOP-10786")
-public class TestConnectionWithTicketTimeout extends
- org.apache.sentry.service.thrift.SentryServiceIntegrationBase {
+public class TestConnectionWithTicketTimeout extends SentryServiceIntegrationBase {
@BeforeClass
public static void setup() throws Exception {
- kerberos = true;
+ SentryServiceIntegrationBase.kerberos = true;
beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
public static void beforeSetup() throws Exception {
- kdcConfOverlay.setProperty(MiniKdc.MAX_TICKET_LIFETIME, "360001");
+ SentryServiceIntegrationBase.kdcConfOverlay.setProperty(MiniKdc.MAX_TICKET_LIFETIME, "360001");
//Only UGI based client connections renew their TGT, this is not a problem in the real world
// as this is not configurable and always true
- conf.set(ServiceConstants.ServerConfig.SECURITY_USE_UGI_TRANSPORT, "true");
+ SentryServiceIntegrationBase.conf.set(ServiceConstants.ServerConfig.SECURITY_USE_UGI_TRANSPORT, "true");
}
/***
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestNotificationHandlerInvoker.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestNotificationHandlerInvoker.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestNotificationHandlerInvoker.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestNotificationHandlerInvoker.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyStoreProcessor.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyStoreProcessor.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyStoreProcessor.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyStoreProcessor.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForHaWithoutKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForHaWithoutKerberos.java
similarity index 82%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForHaWithoutKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForHaWithoutKerberos.java
index 6c78942ca..d5cc1b94a 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForHaWithoutKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForHaWithoutKerberos.java
@@ -38,18 +38,18 @@ public class TestSentryServerForHaWithoutKerberos extends SentryServiceIntegrati
@BeforeClass
public static void setup() throws Exception {
- kerberos = false;
- haEnabled = true;
- beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = false;
+ SentryServiceIntegrationBase.haEnabled = true;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
@Test
public void testCreateRole() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
@@ -60,8 +60,8 @@ public void testCreateRole() throws Exception {
@Test
public void testQueryPushDown() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -129,8 +129,8 @@ public void testQueryPushDown() throws Exception {
*/
@Test
public void testDropRole() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
@@ -138,39 +138,39 @@ public void testDropRole() throws Exception {
// create role and add privileges
client.dropRoleIfExists(requestorUserName, roleName);
client.createRole(requestorUserName, roleName);
- client.grantRoleToGroup(requestorUserName, ADMIN_GROUP, roleName);
+ client.grantRoleToGroup(requestorUserName, SentryServiceIntegrationBase.ADMIN_GROUP, roleName);
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
client.grantTablePrivilege(requestorUserName, roleName, "server1", "db3", "tab3", "ALL");
assertEquals(2, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// drop role and verify privileges
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// recreate the role
client.createRole(requestorUserName, roleName);
- client.grantRoleToGroup(requestorUserName, ADMIN_GROUP, roleName);
+ client.grantRoleToGroup(requestorUserName, SentryServiceIntegrationBase.ADMIN_GROUP, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// grant different privileges and verify
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
assertEquals(1, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
}
@Test
public void testDropRoleOnUser() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
- Set requestorUserNames = Sets.newHashSet(ADMIN_USER);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
+ Set requestorUserNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_USER);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
@@ -178,32 +178,32 @@ public void testDropRoleOnUser() throws Exception {
// create role and add privileges
client.dropRoleIfExists(requestorUserName, roleName);
client.createRole(requestorUserName, roleName);
- client.grantRoleToUser(requestorUserName, ADMIN_USER, roleName);
+ client.grantRoleToUser(requestorUserName, SentryServiceIntegrationBase.ADMIN_USER, roleName);
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
client.grantTablePrivilege(requestorUserName, roleName, "server1", "db3", "tab3", "ALL");
assertEquals(2, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// drop role and verify privileges
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// recreate the role
client.createRole(requestorUserName, roleName);
- client.grantRoleToGroup(requestorUserName, ADMIN_GROUP, roleName);
+ client.grantRoleToGroup(requestorUserName, SentryServiceIntegrationBase.ADMIN_GROUP, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// grant different privileges and verify
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
assertEquals(1, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
}
/**
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolHAWithoutKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolHAWithoutKerberos.java
similarity index 100%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolHAWithoutKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolHAWithoutKerberos.java
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolWithoutKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolWithoutKerberos.java
similarity index 71%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolWithoutKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolWithoutKerberos.java
index 62fbb2f47..121fc4dfc 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolWithoutKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerForPoolWithoutKerberos.java
@@ -18,19 +18,20 @@
package org.apache.sentry.provider.db.service.thrift;
+import org.apache.sentry.service.thrift.SentryServiceIntegrationBase;
import org.junit.BeforeClass;
public class TestSentryServerForPoolWithoutKerberos extends TestSentryServerWithoutKerberos {
@BeforeClass
public static void setup() throws Exception {
- kerberos = false;
- haEnabled = false;
- pooled = true;
- beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = false;
+ SentryServiceIntegrationBase.haEnabled = false;
+ SentryServiceIntegrationBase.pooled = true;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
}
\ No newline at end of file
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerWithoutKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerWithoutKerberos.java
similarity index 83%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerWithoutKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerWithoutKerberos.java
index b37f057b0..86cf9da94 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerWithoutKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServerWithoutKerberos.java
@@ -40,17 +40,17 @@ public class TestSentryServerWithoutKerberos extends SentryServiceIntegrationBas
@BeforeClass
public static void setup() throws Exception {
- kerberos = false;
- beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = false;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
@Test
public void testCreateRole() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
@@ -61,8 +61,8 @@ public void testCreateRole() throws Exception {
@Test
public void testQueryPushDown() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -135,8 +135,8 @@ public void testQueryPushDown() throws Exception {
*/
@Test
public void testDropRole() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
@@ -144,39 +144,39 @@ public void testDropRole() throws Exception {
// create role and add privileges
client.dropRoleIfExists(requestorUserName, roleName);
client.createRole(requestorUserName, roleName);
- client.grantRoleToGroup(requestorUserName, ADMIN_GROUP, roleName);
+ client.grantRoleToGroup(requestorUserName, SentryServiceIntegrationBase.ADMIN_GROUP, roleName);
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
client.grantTablePrivilege(requestorUserName, roleName, "server1", "db3", "tab3", "ALL");
assertEquals(2, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// drop role and verify privileges
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// recreate the role
client.createRole(requestorUserName, roleName);
- client.grantRoleToGroup(requestorUserName, ADMIN_GROUP, roleName);
+ client.grantRoleToGroup(requestorUserName, SentryServiceIntegrationBase.ADMIN_GROUP, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// grant different privileges and verify
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
assertEquals(1, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, null,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
}
@Test
public void testDropRoleOnUser() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
- Set requestorUserNames = Sets.newHashSet(ADMIN_USER);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
+ Set requestorUserNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_USER);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
@@ -184,31 +184,31 @@ public void testDropRoleOnUser() throws Exception {
// create role and add privileges
client.dropRoleIfExists(requestorUserName, roleName);
client.createRole(requestorUserName, roleName);
- client.grantRoleToUser(requestorUserName, ADMIN_USER, roleName);
+ client.grantRoleToUser(requestorUserName, SentryServiceIntegrationBase.ADMIN_USER, roleName);
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
client.grantTablePrivilege(requestorUserName, roleName, "server1", "db3", "tab3", "ALL");
assertEquals(2, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// drop role and verify privileges
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// recreate the role
client.createRole(requestorUserName, roleName);
- client.grantRoleToGroup(requestorUserName, ADMIN_GROUP, roleName);
+ client.grantRoleToGroup(requestorUserName, SentryServiceIntegrationBase.ADMIN_GROUP, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
// grant different privileges and verify
client.grantDatabasePrivilege(requestorUserName, roleName, "server1", "db2", AccessConstants.ALL);
assertEquals(1, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
client.dropRole(requestorUserName, roleName);
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
assertEquals(0, client.listPrivilegesForProvider(requestorUserGroupNames, requestorUserNames,
- ActiveRoleSet.ALL).size());
+ ActiveRoleSet.ALL).size());
}
}
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
similarity index 83%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
index fe4164d49..87eb41b91 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
@@ -44,8 +44,8 @@ public void testConnectionWhenReconnect() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_r";
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -54,8 +54,8 @@ public void runTestAsSubject() throws Exception {
client.createRole(requestorUserName, roleName);
client.listRoles(requestorUserName);
stopSentryService();
- server = new SentryServiceFactory().create(conf);
- startSentryService();
+ SentryServiceIntegrationBase.server = new SentryServiceFactory().create(SentryServiceIntegrationBase.conf);
+ SentryServiceIntegrationBase.startSentryService();
client.listRoles(requestorUserName);
client.dropRole(requestorUserName, roleName);
}
@@ -68,8 +68,8 @@ public void testConnectionWithMultipleRetries() throws Exception {
@Override
public void runTestAsSubject() throws Exception {
List> tasks = new ArrayList>();
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_r";
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -81,11 +81,11 @@ public void runTestAsSubject() throws Exception {
Callable func = new Callable() {
public Boolean call() throws Exception {
- return clientUgi.doAs(new PrivilegedExceptionAction() {
+ return SentryServiceIntegrationBase.clientUgi.doAs(new PrivilegedExceptionAction() {
@Override
public Boolean run() throws Exception {
try {
- client.listRoles(ADMIN_USER);
+ client.listRoles(SentryServiceIntegrationBase.ADMIN_USER);
return true;
} catch (SentryUserException sue) {
return false;
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java
similarity index 87%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java
index 51bba31bd..e44c7cab3 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java
@@ -36,12 +36,12 @@ public class TestSentryServiceFailureCase extends SentryServiceIntegrationBase {
@BeforeClass
public static void setup() throws Exception {
- kerberos = true;
- beforeSetup();
- setupConf();
- conf.set(ServerConfig.ALLOW_CONNECT, "");
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = true;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.conf.set(ServerConfig.ALLOW_CONNECT, "");
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
@Override
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java
similarity index 71%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java
index 813b30b52..f6cd8a0c3 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java
@@ -21,7 +21,7 @@
import java.io.File;
import java.util.Set;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.SentryServiceIntegrationBase;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
import org.junit.Before;
@@ -37,20 +37,20 @@ public class TestSentryServiceForHAWithKerberos extends SentryServiceIntegration
@BeforeClass
public static void setup() throws Exception {
- kerberos = true;
- haEnabled = true;
- SERVER_KERBEROS_NAME = "sentry/_HOST@" + REALM;
- beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = true;
+ SentryServiceIntegrationBase.haEnabled = true;
+ SentryServiceIntegrationBase.SERVER_KERBEROS_NAME = "sentry/_HOST@" + SentryServiceIntegrationBase.REALM;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
@Override
@Before
public void before() throws Exception {
- policyFilePath = new File(dbDir, "local_policy_file.ini");
- conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE,
+ policyFilePath = new File(SentryServiceIntegrationBase.dbDir, "local_policy_file.ini");
+ SentryServiceIntegrationBase.conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE,
policyFilePath.getPath());
policyFile = new PolicyFile();
connectToSentryService();
@@ -61,8 +61,8 @@ public void testCreateRole() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r";
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolHAWithKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolHAWithKerberos.java
similarity index 65%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolHAWithKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolHAWithKerberos.java
index acb906fc8..d453e9225 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolHAWithKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolHAWithKerberos.java
@@ -18,19 +18,22 @@
package org.apache.sentry.provider.db.service.thrift;
+import org.apache.sentry.service.thrift.SentryServiceIntegrationBase;
import org.junit.BeforeClass;
-public class TestSentryServiceForPoolHAWithKerberos extends TestSentryServiceWithKerberos {
+public class
+
+ TestSentryServiceForPoolHAWithKerberos extends TestSentryServiceWithKerberos {
@BeforeClass
public static void setup() throws Exception {
- kerberos = true;
- haEnabled = true;
- pooled = true;
- beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = true;
+ SentryServiceIntegrationBase.haEnabled = true;
+ SentryServiceIntegrationBase.pooled = true;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
}
\ No newline at end of file
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolWithKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolWithKerberos.java
similarity index 71%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolWithKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolWithKerberos.java
index bd3c1ccba..f3eb648e2 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolWithKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForPoolWithKerberos.java
@@ -18,19 +18,20 @@
package org.apache.sentry.provider.db.service.thrift;
+import org.apache.sentry.service.thrift.SentryServiceIntegrationBase;
import org.junit.BeforeClass;
public class TestSentryServiceForPoolWithKerberos extends TestSentryServiceWithKerberos {
@BeforeClass
public static void setup() throws Exception {
- kerberos = true;
- haEnabled = false;
- pooled = true;
- beforeSetup();
- setupConf();
- startSentryService();
- afterSetup();
+ SentryServiceIntegrationBase.kerberos = true;
+ SentryServiceIntegrationBase.haEnabled = false;
+ SentryServiceIntegrationBase.pooled = true;
+ SentryServiceIntegrationBase.beforeSetup();
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
+ SentryServiceIntegrationBase.afterSetup();
}
}
\ No newline at end of file
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceImportExport.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceImportExport.java
similarity index 92%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceImportExport.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceImportExport.java
index 930b47335..c5573a72b 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceImportExport.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceImportExport.java
@@ -50,16 +50,16 @@ public class TestSentryServiceImportExport extends SentryServiceIntegrationBase
@BeforeClass
public static void setup() throws Exception {
- kerberos = false;
- setupConf();
- startSentryService();
+ SentryServiceIntegrationBase.kerberos = false;
+ SentryServiceIntegrationBase.setupConf();
+ SentryServiceIntegrationBase.startSentryService();
}
@Before
public void preparePolicyFile() throws Exception {
super.before();
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
}
@@ -91,9 +91,9 @@ public void runTestAsSubject() throws Exception {
}
policyFileMappingData.put(PolicyFileConstants.GROUPS, groupRolesMap);
policyFileMappingData.put(PolicyFileConstants.ROLES, rolePrivilegesMap);
- client.importPolicy(policyFileMappingData, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData, SentryServiceIntegrationBase.ADMIN_USER, false);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData,
policyFileMappingData);
}
@@ -123,7 +123,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(PRIVILIEGE1, PRIVILIEGE2, PRIVILIEGE3, PRIVILIEGE4));
policyFileMappingData1.put(PolicyFileConstants.GROUPS, groupRolesMap1);
policyFileMappingData1.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData1, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData1, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> policyFileMappingData2 = Maps.newHashMap();
Map> groupRolesMap2 = Maps.newHashMap();
@@ -136,7 +136,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(PRIVILIEGE5, PRIVILIEGE6, PRIVILIEGE7, PRIVILIEGE8));
policyFileMappingData2.put(PolicyFileConstants.GROUPS, groupRolesMap2);
policyFileMappingData2.put(PolicyFileConstants.ROLES, rolePrivilegesMap2);
- client.importPolicy(policyFileMappingData2, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData2, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> exceptedMappingData = Maps.newHashMap();
// for exceptedMappingData, combine policyFileMappingData1 and policyFileMappingData2
@@ -149,7 +149,7 @@ public void runTestAsSubject() throws Exception {
exceptedMappingData.get(PolicyFileConstants.ROLES).putAll(
policyFileMappingData2.get(PolicyFileConstants.ROLES));
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData, exceptedMappingData);
}
});
@@ -186,7 +186,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(PRIVILIEGE1, PRIVILIEGE2, PRIVILIEGE3, PRIVILIEGE4, PRIVILIEGE5));
policyFileMappingData1.put(PolicyFileConstants.GROUPS, groupRolesMap1);
policyFileMappingData1.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData1, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData1, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> policyFileMappingData2 = Maps.newHashMap();
Map> groupRolesMap2 = Maps.newHashMap();
@@ -200,7 +200,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(PRIVILIEGE4, PRIVILIEGE5, PRIVILIEGE6, PRIVILIEGE7, PRIVILIEGE8));
policyFileMappingData2.put(PolicyFileConstants.GROUPS, groupRolesMap2);
policyFileMappingData2.put(PolicyFileConstants.ROLES, rolePrivilegesMap2);
- client.importPolicy(policyFileMappingData2, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData2, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> exceptedMappingData = Maps.newHashMap();
Map> exceptedRolesMap = Maps.newHashMap();
@@ -217,7 +217,7 @@ public void runTestAsSubject() throws Exception {
exceptedMappingData.put(PolicyFileConstants.GROUPS, exceptedRolesMap);
exceptedMappingData.put(PolicyFileConstants.ROLES, exceptedPrivilegesMap);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData, exceptedMappingData);
}
});
@@ -237,9 +237,9 @@ public void runTestAsSubject() throws Exception {
Map> rolePrivilegesMap = Maps.newHashMap();
policyFileMappingData.put(PolicyFileConstants.GROUPS, groupRolesMap);
policyFileMappingData.put(PolicyFileConstants.ROLES, rolePrivilegesMap);
- client.importPolicy(policyFileMappingData, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData, SentryServiceIntegrationBase.ADMIN_USER, false);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData,
policyFileMappingData);
}
@@ -269,7 +269,7 @@ public void runTestAsSubject() throws Exception {
rolePrivilegesMap1.put("role1", Sets.newHashSet(PRIVILIEGE1));
policyFileMappingData1.put(PolicyFileConstants.GROUPS, groupRolesMap1);
policyFileMappingData1.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData1, ADMIN_USER, true);
+ client.importPolicy(policyFileMappingData1, SentryServiceIntegrationBase.ADMIN_USER, true);
Map>> policyFileMappingData2 = Maps.newHashMap();
Map> groupRolesMap2 = Maps.newHashMap();
@@ -280,7 +280,7 @@ public void runTestAsSubject() throws Exception {
rolePrivilegesMap2.put("role3", Sets.newHashSet(PRIVILIEGE2));
policyFileMappingData2.put(PolicyFileConstants.GROUPS, groupRolesMap2);
policyFileMappingData2.put(PolicyFileConstants.ROLES, rolePrivilegesMap2);
- client.importPolicy(policyFileMappingData2, ADMIN_USER, true);
+ client.importPolicy(policyFileMappingData2, SentryServiceIntegrationBase.ADMIN_USER, true);
Map>> exceptedMappingData = Maps.newHashMap();
Map> exceptedRolesMap = Maps.newHashMap();
@@ -294,7 +294,7 @@ public void runTestAsSubject() throws Exception {
exceptedMappingData.put(PolicyFileConstants.GROUPS, exceptedRolesMap);
exceptedMappingData.put(PolicyFileConstants.ROLES, exceptedPrivilegesMap);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData, exceptedMappingData);
}
});
@@ -332,7 +332,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(PRIVILIEGE1, PRIVILIEGE2, PRIVILIEGE3, PRIVILIEGE4, PRIVILIEGE5));
policyFileMappingData1.put(PolicyFileConstants.GROUPS, groupRolesMap1);
policyFileMappingData1.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData1, ADMIN_USER, true);
+ client.importPolicy(policyFileMappingData1, SentryServiceIntegrationBase.ADMIN_USER, true);
Map>> policyFileMappingData2 = Maps.newHashMap();
Map> groupRolesMap2 = Maps.newHashMap();
@@ -346,7 +346,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(PRIVILIEGE4, PRIVILIEGE5, PRIVILIEGE6, PRIVILIEGE7, PRIVILIEGE8));
policyFileMappingData2.put(PolicyFileConstants.GROUPS, groupRolesMap2);
policyFileMappingData2.put(PolicyFileConstants.ROLES, rolePrivilegesMap2);
- client.importPolicy(policyFileMappingData2, ADMIN_USER, true);
+ client.importPolicy(policyFileMappingData2, SentryServiceIntegrationBase.ADMIN_USER, true);
Map>> exceptedMappingData = Maps.newHashMap();
Map> exceptedRolesMap = Maps.newHashMap();
@@ -363,7 +363,7 @@ public void runTestAsSubject() throws Exception {
exceptedMappingData.put(PolicyFileConstants.GROUPS, exceptedRolesMap);
exceptedMappingData.put(PolicyFileConstants.ROLES, exceptedPrivilegesMap);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData, exceptedMappingData);
}
});
@@ -399,7 +399,7 @@ public void runTestAsSubject() throws Exception {
Sets.newHashSet(testPrivilege5, testPrivilege6, testPrivilege7, testPrivilege8));
policyFileMappingData1.put(PolicyFileConstants.GROUPS, groupRolesMap1);
policyFileMappingData1.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData1, ADMIN_USER, true);
+ client.importPolicy(policyFileMappingData1, SentryServiceIntegrationBase.ADMIN_USER, true);
Map>> exceptedMappingData = Maps.newHashMap();
Map> exceptedRolesMap = Maps.newHashMap();
@@ -410,7 +410,7 @@ public void runTestAsSubject() throws Exception {
exceptedMappingData.put(PolicyFileConstants.GROUPS, exceptedRolesMap);
exceptedMappingData.put(PolicyFileConstants.ROLES, exceptedPrivilegesMap);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData, exceptedMappingData);
}
});
@@ -446,7 +446,7 @@ public void runTestAsSubject() throws Exception {
rolePrivilegesMap1.put("role2", Sets.newHashSet(testPrivilege4, testPrivilege5));
policyFileMappingData1.put(PolicyFileConstants.GROUPS, groupRolesMap1);
policyFileMappingData1.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData1, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData1, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> policyFileMappingData2 = Maps.newHashMap();
Map> groupRolesMap2 = Maps.newHashMap();
@@ -456,10 +456,10 @@ public void runTestAsSubject() throws Exception {
rolePrivilegesMap2.put("role2", Sets.newHashSet(testPrivilege6));
policyFileMappingData2.put(PolicyFileConstants.GROUPS, groupRolesMap2);
policyFileMappingData2.put(PolicyFileConstants.ROLES, rolePrivilegesMap2);
- client.importPolicy(policyFileMappingData2, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData2, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> exceptedMappingData = policyFileMappingData2;
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
// all and * should replace the select and insert
validateSentryMappingData(sentryMappingData, exceptedMappingData);
}
@@ -526,7 +526,7 @@ public void runTestAsSubject() throws Exception {
PRIVILIEGE7, PRIVILIEGE8));
policyFileMappingData.put(PolicyFileConstants.GROUPS, groupRolesMap);
policyFileMappingData.put(PolicyFileConstants.ROLES, rolePrivilegesMap1);
- client.importPolicy(policyFileMappingData, ADMIN_USER, true);
+ client.importPolicy(policyFileMappingData, SentryServiceIntegrationBase.ADMIN_USER, true);
// verify the rolePrivilegesMap and groupRolesMap with null objectPath
Map>> expectedMappingData = Maps.newHashMap();
@@ -545,7 +545,7 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- Map>> sentryMappingData = client.exportPolicy(ADMIN_USER, null);
+ Map>> sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the rolePrivilegesMap and groupRolesMap with empty objectPath
@@ -565,7 +565,7 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- sentryMappingData = client.exportPolicy(ADMIN_USER, "");
+ sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "");
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the rolePrivilegesMap and groupRolesMap for db=db1
@@ -584,7 +584,7 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- sentryMappingData = client.exportPolicy(ADMIN_USER, "db=db1");
+ sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "db=db1");
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the rolePrivilegesMap and groupRolesMap for db=db2
@@ -600,7 +600,7 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- sentryMappingData = client.exportPolicy(ADMIN_USER, "db=db2");
+ sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "db=db2");
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the rolePrivilegesMap and groupRolesMap for db=db1->table=tbl1
@@ -617,7 +617,7 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- sentryMappingData = client.exportPolicy(ADMIN_USER, "db=db1->table=tbl1");
+ sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "db=db1->table=tbl1");
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the rolePrivilegesMap and groupRolesMap for db=db1->table=tbl2
@@ -632,7 +632,7 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- sentryMappingData = client.exportPolicy(ADMIN_USER, "db=db1->table=tbl2");
+ sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "db=db1->table=tbl2");
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the rolePrivilegesMap and groupRolesMap for db=db1->table=tbl1
@@ -649,12 +649,12 @@ public void runTestAsSubject() throws Exception {
expectedMappingData.put(PolicyFileConstants.GROUPS, expectedGroupRoles);
expectedMappingData.put(PolicyFileConstants.ROLES, expectedRolePrivileges);
- sentryMappingData = client.exportPolicy(ADMIN_USER, "table=tbl1");
+ sentryMappingData = client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "table=tbl1");
validateSentryMappingData(sentryMappingData, expectedMappingData);
// verify the invalid exportObject string
try {
- client.exportPolicy(ADMIN_USER, "invalidString");
+ client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, "invalidString");
fail("RuntimeException should be thrown.");
} catch (RuntimeException sue) {
// excepted exception
@@ -693,10 +693,10 @@ public void runTestAsSubject() throws Exception {
policyFileMappingData.put(PolicyFileConstants.USER_ROLES, userRolesMap);
policyFileMappingData.put(PolicyFileConstants.GROUPS, groupRolesMap);
policyFileMappingData.put(PolicyFileConstants.ROLES, rolePrivilegesMap);
- client.importPolicy(policyFileMappingData, ADMIN_USER, false);
+ client.importPolicy(policyFileMappingData, SentryServiceIntegrationBase.ADMIN_USER, false);
Map>> sentryMappingData =
- client.exportPolicy(ADMIN_USER, null);
+ client.exportPolicy(SentryServiceIntegrationBase.ADMIN_USER, null);
// validate the [user, role] mapping
validateRolesMap(sentryMappingData.get(PolicyFileConstants.USER_ROLES),
policyFileMappingData.get(PolicyFileConstants.USER_ROLES));
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceIntegration.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceIntegration.java
similarity index 93%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceIntegration.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceIntegration.java
index a05521f92..ef3bb4f29 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceIntegration.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceIntegration.java
@@ -52,8 +52,8 @@ public void testCreateDropShowRole() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_r";
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -77,8 +77,8 @@ public void testGranRevokePrivilegeOnTableForRole() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName1 = "admin_r1";
@@ -139,8 +139,8 @@ public void testAddDeleteRolesForUser() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
// user1->group1
@@ -244,8 +244,8 @@ public void testGranRevokePrivilegeForRoleWithUG() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
// user1_1->group1
@@ -365,8 +365,8 @@ public void testMultipleRolesSamePrivilege() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName1 = "admin_r1";
@@ -393,8 +393,8 @@ public void testShowRoleGrant() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_testdb";
String groupName = "group1";
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
@@ -426,8 +426,8 @@ public void testShowGrant() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_testdb";
String server = "server1";
String db = "testDB";
@@ -455,8 +455,8 @@ public void testUriWithEquals() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName = "admin_testdb";
String server = "server1";
String uri = "file://u/w/h/t/partition=value/";
@@ -490,8 +490,8 @@ public void testSameGrantTwice() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r1";
@@ -509,8 +509,8 @@ public void testGrantRevokeWithGrantOption() throws Exception {
@Override
public void runTestAsSubject() throws Exception {
// Grant a privilege with Grant Option
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r1";
@@ -539,8 +539,8 @@ public void testGrantTwoPrivilegeDiffInGrantOption() throws Exception {
@Override
public void runTestAsSubject() throws Exception {
// Grant a privilege with 'Grant Option'.
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName = "admin_r1";
@@ -568,8 +568,8 @@ public void testGranRevokePrivilegeOnColumnForRole() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
String roleName1 = "admin_r1";
@@ -637,8 +637,8 @@ public void testListByAuthDB() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName1 = "role1";
String roleName2 = "role2";
Set testRoleSet = Sets.newHashSet(roleName1, roleName2);
@@ -745,8 +745,8 @@ public void testListByAuthTab() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName1 = "role1";
String roleName2 = "role2";
String server = "server1";
@@ -809,8 +809,8 @@ public void testListByAuthUri() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
String roleName1 = "role1";
String roleName2 = "role2";
String server = "server1";
@@ -878,11 +878,11 @@ public void testListByAuthTabForNonAdmin() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
String user1 = "user1";
String group1 = "group1";
String group2 = "group2";
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
Set userGroupNames1 = Sets.newHashSet(group1);
Set userGroupNames2 = Sets.newHashSet(group2);
String roleName1 = "role1";
@@ -1006,8 +1006,8 @@ public void testGetConfigVal() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -1053,8 +1053,8 @@ public void testGranRevokePrivilegeOnServerForRole() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
@@ -1080,9 +1080,9 @@ public void testGranRevokePrivilegeWithoutAction() throws Exception {
runTestAsSubject(new TestOperation(){
@Override
public void runTestAsSubject() throws Exception {
- String requestorUserName = ADMIN_USER;
+ String requestorUserName = SentryServiceIntegrationBase.ADMIN_USER;
String roleName1 = "admin_r1";
- Set requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP);
+ Set requestorUserGroupNames = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
setLocalGroupMapping(requestorUserName, requestorUserGroupNames);
writePolicyFile();
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
similarity index 78%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
index 15eab15b7..b7d0b8851 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
@@ -33,7 +33,7 @@
* Test sentry service with a larger message size than the server's or client's thrift max message size.
*/
public class TestSentryServiceWithInvalidMsgSize extends SentryServiceIntegrationBase {
- private final Set REQUESTER_USER_GROUP_NAMES = Sets.newHashSet(ADMIN_GROUP);
+ private final Set REQUESTER_USER_GROUP_NAMES = Sets.newHashSet(SentryServiceIntegrationBase.ADMIN_GROUP);
private final String ROLE_NAME = "admin_r";
/**
@@ -44,18 +44,18 @@ public void testClientWithSmallMaxMsgSize() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- Configuration confWithSmallMaxMsgSize = new Configuration(conf);
+ Configuration confWithSmallMaxMsgSize = new Configuration(SentryServiceIntegrationBase.conf);
confWithSmallMaxMsgSize.setLong(ServiceConstants.ClientConfig.SENTRY_POLICY_CLIENT_THRIFT_MAX_MESSAGE_SIZE, 20);
// create a client with a small thrift max message size
SentryPolicyServiceClient clientWithSmallMaxMsgSize = SentryServiceClientFactory.create(confWithSmallMaxMsgSize);
- setLocalGroupMapping(ADMIN_USER, REQUESTER_USER_GROUP_NAMES);
+ setLocalGroupMapping(SentryServiceIntegrationBase.ADMIN_USER, REQUESTER_USER_GROUP_NAMES);
writePolicyFile();
boolean exceptionThrown = false;
try {
// client throws exception when message size is larger than the client's thrift max message size.
- clientWithSmallMaxMsgSize.listRoles(ADMIN_USER);
+ clientWithSmallMaxMsgSize.listRoles(SentryServiceIntegrationBase.ADMIN_USER);
} catch (SentryUserException e) {
exceptionThrown = true;
Assert.assertTrue(e.getMessage().contains("Thrift exception occurred"));
@@ -66,10 +66,10 @@ public void runTestAsSubject() throws Exception {
}
// client can still talk with sentry server when message size is smaller.
- client.dropRoleIfExists(ADMIN_USER, ROLE_NAME);
- client.listRoles(ADMIN_USER);
- client.createRole(ADMIN_USER, ROLE_NAME);
- client.listRoles(ADMIN_USER);
+ client.dropRoleIfExists(SentryServiceIntegrationBase.ADMIN_USER, ROLE_NAME);
+ client.listRoles(SentryServiceIntegrationBase.ADMIN_USER);
+ client.createRole(SentryServiceIntegrationBase.ADMIN_USER, ROLE_NAME);
+ client.listRoles(SentryServiceIntegrationBase.ADMIN_USER);
}
});
}
@@ -82,26 +82,26 @@ public void testServerWithSmallMaxMsgSize() throws Exception {
runTestAsSubject(new TestOperation() {
@Override
public void runTestAsSubject() throws Exception {
- Configuration confWithSmallMaxMsgSize = new Configuration(conf);
+ Configuration confWithSmallMaxMsgSize = new Configuration(SentryServiceIntegrationBase.conf);
confWithSmallMaxMsgSize.setLong(ServiceConstants.ServerConfig.SENTRY_POLICY_SERVER_THRIFT_MAX_MESSAGE_SIZE,
50);
stopSentryService();
// create a server with a small max thrift message size
- server = new SentryServiceFactory().create(confWithSmallMaxMsgSize);
- startSentryService();
+ SentryServiceIntegrationBase.server = new SentryServiceFactory().create(confWithSmallMaxMsgSize);
+ SentryServiceIntegrationBase.startSentryService();
- setLocalGroupMapping(ADMIN_USER, REQUESTER_USER_GROUP_NAMES);
+ setLocalGroupMapping(SentryServiceIntegrationBase.ADMIN_USER, REQUESTER_USER_GROUP_NAMES);
writePolicyFile();
// client can talk with server when message size is smaller.
- client.listRoles(ADMIN_USER);
- client.createRole(ADMIN_USER, ROLE_NAME);
+ client.listRoles(SentryServiceIntegrationBase.ADMIN_USER);
+ client.createRole(SentryServiceIntegrationBase.ADMIN_USER, ROLE_NAME);
boolean exceptionThrown = false;
try {
// client throws exception when message size is larger than the server's thrift max message size.
- client.grantServerPrivilege(ADMIN_USER, ROLE_NAME, "server", false);
+ client.grantServerPrivilege(SentryServiceIntegrationBase.ADMIN_USER, ROLE_NAME, "server", false);
} catch (SentryUserException e) {
exceptionThrown = true;
Assert.assertTrue(e.getMessage().contains("org.apache.thrift.transport.TTransportException"));
@@ -110,7 +110,7 @@ public void runTestAsSubject() throws Exception {
}
// client can still talk with sentry server when message size is smaller.
- Set roles = client.listRoles(ADMIN_USER);
+ Set roles = client.listRoles(SentryServiceIntegrationBase.ADMIN_USER);
Assert.assertTrue(roles.size() == 1);
Assert.assertEquals(ROLE_NAME, roles.iterator().next().getRoleName());
}
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java
similarity index 93%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java
index ff7338266..26cee464a 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java
@@ -30,7 +30,7 @@ public class TestSentryServiceWithKerberos extends SentryServiceIntegrationBase
@BeforeClass
public static void setup() throws Exception {
- SERVER_KERBEROS_NAME = "sentry/_HOST@" + REALM;
+ SentryServiceIntegrationBase.SERVER_KERBEROS_NAME = "sentry/_HOST@" + SentryServiceIntegrationBase.REALM;
SentryServiceIntegrationBase.setup();
}
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java
similarity index 80%
rename from sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java
rename to sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java
index ece2ee838..a82cbde1b 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java
@@ -51,8 +51,8 @@ public class TestSentryWebServerWithKerberos extends SentryServiceIntegrationBas
@BeforeClass
public static void setup() throws Exception {
- webServerEnabled = true;
- webSecurity = true;
+ SentryServiceIntegrationBase.webServerEnabled = true;
+ SentryServiceIntegrationBase.webSecurity = true;
SentryServiceIntegrationBase.setup();
}
@@ -68,10 +68,10 @@ public void after() {
@Test
public void testPing() throws Exception {
- clientUgi.doAs(new PrivilegedExceptionAction() {
+ SentryServiceIntegrationBase.clientUgi.doAs(new PrivilegedExceptionAction() {
@Override
public Void run() throws Exception {
- final URL url = new URL("http://"+ SERVER_HOST + ":" + webServerPort + "/ping");
+ final URL url = new URL("http://"+ SentryServiceIntegrationBase.SERVER_HOST + ":" + SentryServiceIntegrationBase.webServerPort + "/ping");
HttpURLConnection conn = new AuthenticatedURL(new KerberosAuthenticator()).
openConnection(url, new AuthenticatedURL.Token());
Assert.assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode());
@@ -83,7 +83,7 @@ public Void run() throws Exception {
@Test
public void testPingWithoutSubject() throws Exception {
- final URL url = new URL("http://"+ SERVER_HOST + ":" + webServerPort + "/ping");
+ final URL url = new URL("http://"+ SentryServiceIntegrationBase.SERVER_HOST + ":" + SentryServiceIntegrationBase.webServerPort + "/ping");
try {
new AuthenticatedURL(new KerberosAuthenticator()).openConnection(url, new AuthenticatedURL.Token());
fail("Here should fail.");
@@ -96,7 +96,7 @@ public void testPingWithoutSubject() throws Exception {
@Test
public void testPingUsingHttpURLConnection() throws Exception {
- final URL url = new URL("http://"+ SERVER_HOST + ":" + webServerPort + "/ping");
+ final URL url = new URL("http://"+ SentryServiceIntegrationBase.SERVER_HOST + ":" + SentryServiceIntegrationBase.webServerPort + "/ping");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
Assert.assertEquals(HttpURLConnection.HTTP_UNAUTHORIZED, conn.getResponseCode());
String errorMessage = IOUtils.toString(conn.getErrorStream());
@@ -106,19 +106,19 @@ public void testPingUsingHttpURLConnection() throws Exception {
@Test
public void testPingWithUnauthorizedUser() throws Exception {
// create an unauthorized User with Kerberos
- String userPrinciple = "user/" + SERVER_HOST;
- String userKerberosName = userPrinciple + "@" + REALM;
+ String userPrinciple = "user/" + SentryServiceIntegrationBase.SERVER_HOST;
+ String userKerberosName = userPrinciple + "@" + SentryServiceIntegrationBase.REALM;
Subject userSubject = new Subject(false, Sets.newHashSet(
new KerberosPrincipal(userKerberosName)), new HashSet
-
- org.apache.sentry
- sentry-core-common
-
org.apache.sentry
sentry-core-model-search
diff --git a/sentry-solr/solr-sentry-handlers/pom.xml b/sentry-solr/solr-sentry-handlers/pom.xml
index 4073359b6..5503b1e30 100644
--- a/sentry-solr/solr-sentry-handlers/pom.xml
+++ b/sentry-solr/solr-sentry-handlers/pom.xml
@@ -53,10 +53,6 @@ limitations under the License.
org.apache.sentry
sentry-core-model-search
-
- org.apache.sentry
- sentry-provider-common
-
org.apache.sentry
sentry-provider-file
diff --git a/sentry-tests/sentry-tests-hive-v2/pom.xml b/sentry-tests/sentry-tests-hive-v2/pom.xml
index 680395206..b20991fa5 100644
--- a/sentry-tests/sentry-tests-hive-v2/pom.xml
+++ b/sentry-tests/sentry-tests-hive-v2/pom.xml
@@ -283,11 +283,6 @@ limitations under the License.
sentry-hdfs-namenode-plugin
test
-
- org.apache.sentry
- sentry-policy-db
- test
-
org.apache.hadoop
hadoop-minicluster
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java
index d843829fd..955924bb6 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java
@@ -32,7 +32,7 @@
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.sentry.binding.hive.v2.SentryHiveAuthorizationTaskFactoryImplV2;
import org.apache.sentry.provider.db.SimpleDBProviderBackend;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.SentryService;
import org.apache.sentry.service.thrift.SentryServiceFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestColumnEndToEnd.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestColumnEndToEnd.java
index 32d0a6138..22d4cf85d 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestColumnEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestColumnEndToEnd.java
@@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java
index bf871f01a..c9c263712 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.dbprovider;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
index dadbbe8c0..0012a8ae4 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
@@ -34,9 +34,9 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
-import org.apache.sentry.provider.db.SentryAlreadyExistsException;
-import org.apache.sentry.provider.db.SentryNoSuchObjectException;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
+import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
+import org.apache.sentry.core.common.exception.SentryNoSuchObjectException;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.BeforeClass;
import org.junit.Ignore;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java
index 8ee93ccb0..79139440f 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java
index 65103fc61..053c854ad 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java
@@ -22,9 +22,9 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
-import org.apache.sentry.provider.db.SentryAlreadyExistsException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
+import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
index d9f30e0d7..a0a5afeff 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
@@ -26,8 +26,8 @@
import java.sql.ResultSet;
import java.sql.Statement;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbSentryOnFailureHookLoading.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbSentryOnFailureHookLoading.java
index 8cb04f763..212c4650d 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbSentryOnFailureHookLoading.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbSentryOnFailureHookLoading.java
@@ -29,7 +29,7 @@
import org.apache.hadoop.hive.ql.plan.HiveOperation;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.tests.e2e.hive.DummySentryOnFailureHook;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.After;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithGrantOption.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithGrantOption.java
index 65ece8f4b..c67910a08 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithGrantOption.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithGrantOption.java
@@ -26,7 +26,7 @@
import org.apache.hadoop.hive.ql.plan.HiveOperation;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.apache.sentry.tests.e2e.hive.DummySentryOnFailureHook;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithHAGrantOption.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithHAGrantOption.java
index d837a85a2..5b0755d0d 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithHAGrantOption.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestPrivilegeWithHAGrantOption.java
@@ -26,7 +26,7 @@
import org.apache.hadoop.hive.ql.plan.HiveOperation;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.tests.e2e.hive.DummySentryOnFailureHook;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.Assume;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java
index 6ad70cf3f..36f0471b5 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java
@@ -23,8 +23,8 @@
import java.sql.ResultSet;
import java.sql.Statement;
-import org.apache.sentry.provider.db.SentryAccessDeniedException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.HAClientInvocationHandler;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
index 4d0c4b5aa..a440caeba 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
@@ -72,10 +72,10 @@
import org.apache.sentry.binding.hive.v2.metastore.SentryMetastorePostEventListenerV2;
import org.apache.sentry.hdfs.PathsUpdate;
import org.apache.sentry.hdfs.SentryAuthorizationProvider;
-import org.apache.sentry.provider.db.SentryAlreadyExistsException;
+import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
import org.apache.sentry.provider.db.SimpleDBProviderBackend;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.sentry.tests.e2e.hive.fs.MiniDFS;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
index 12135265a..218807c11 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
@@ -16,9 +16,9 @@
*/
package org.apache.sentry.tests.e2e.hive;
-import static org.apache.sentry.policy.common.PolicyConstants.AUTHORIZABLE_SPLITTER;
-import static org.apache.sentry.policy.common.PolicyConstants.PRIVILEGE_PREFIX;
-import static org.apache.sentry.policy.common.PolicyConstants.ROLE_SPLITTER;
+import static org.apache.sentry.core.common.utils.SentryConstants.AUTHORIZABLE_SPLITTER;
+import static org.apache.sentry.core.common.utils.SentryConstants.PRIVILEGE_PREFIX;
+import static org.apache.sentry.core.common.utils.SentryConstants.ROLE_SPLITTER;
import java.io.File;
import java.io.IOException;
@@ -49,10 +49,10 @@
import org.apache.sentry.binding.hive.v2.metastore.SentryMetastorePostEventListenerV2;
import org.apache.sentry.core.model.db.DBModelAction;
import org.apache.sentry.core.model.db.DBModelAuthorizable;
-import org.apache.sentry.policy.db.DBModelAuthorizables;
+import org.apache.sentry.core.model.db.DBModelAuthorizables;
import org.apache.sentry.provider.db.SimpleDBProviderBackend;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.KerberosConfiguration;
import org.apache.sentry.service.thrift.SentryServiceClientFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java
index ac0a9cdd6..e4c9b2757 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java
@@ -30,9 +30,9 @@
import org.apache.sentry.binding.hive.authz.SentryConfigTool;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.core.common.SentryConfigurationException;
+import org.apache.sentry.core.common.exception.SentryConfigurationException;
import org.apache.sentry.core.common.Subject;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java
index b123dcd00..95ef8f0cb 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java
index 2851ed6e6..9a3018935 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java
@@ -21,7 +21,7 @@
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java
index 23577c20a..c5560a690 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java
@@ -22,7 +22,7 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java
index 5242bb12c..b38eaaf35 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java
@@ -16,7 +16,7 @@
*/
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertTrue;
import java.io.File;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java
index bc5c08be4..41ea86f41 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java
@@ -27,7 +27,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java
index 0e403d854..d9415c5b8 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java
@@ -27,7 +27,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java
index 3c23dc4b9..677802405 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java
index 05420d1e7..524fa1c9d 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java
@@ -21,7 +21,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
index a6edf03a6..b8907de4d 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
index 06a5752ca..4e57138fb 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
@@ -27,7 +27,7 @@
import java.util.Map;
import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java
index 985f96987..3b62cead2 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java
@@ -26,8 +26,8 @@
import java.sql.SQLException;
import java.sql.Statement;
-import org.apache.sentry.policy.db.SimpleDBPolicyEngine;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.SentryConstants;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -116,7 +116,7 @@ protected static void prepareDBDataForTest() throws Exception {
@After
public void teardown() throws Exception {
// one test turns this on so let's disable it in the teardown method
- System.setProperty(SimpleDBPolicyEngine.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "false");
+ System.setProperty(SentryConstants.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "false");
}
@Test
@@ -261,7 +261,7 @@ public void testPerDBPolicyFileWithURI() throws Exception {
// ugly hack: needs to go away once this becomes a config property. Note that this property
// will not be set with external HS and this test will fail. Hope is this fix will go away
// by then.
- System.setProperty(SimpleDBPolicyEngine.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "true");
+ System.setProperty(SentryConstants.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "true");
// test execution
Connection connection = context.createConnection(USER1_1);
Statement statement = context.createStatement(connection);
@@ -290,11 +290,11 @@ public void testPerDBPolicyFileWithURI() throws Exception {
context.assertAuthzException(statement, "USE " + DB1);
// once we disable this property all queries should fail
- System.setProperty(SimpleDBPolicyEngine.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "false");
+ System.setProperty(SentryConstants.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "false");
context.assertAuthzException(statement, "USE " + DB2);
// re-enable for clean
- System.setProperty(SimpleDBPolicyEngine.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "true");
+ System.setProperty(SentryConstants.ACCESS_ALLOW_URI_PER_DB_POLICYFILE, "true");
statement.close();
connection.close();
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java
index c8712e772..0e82660f5 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java
@@ -18,7 +18,7 @@
package org.apache.sentry.tests.e2e.hive;
import com.google.common.io.Resources;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImportExport.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImportExport.java
index c72aea323..388e71dc7 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImportExport.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImportExport.java
@@ -28,8 +28,8 @@
import org.apache.sentry.binding.hive.SentryPolicyFileFormatFactory;
import org.apache.sentry.binding.hive.SentryPolicyFileFormatter;
import org.apache.sentry.binding.hive.authz.SentryConfigTool;
-import org.apache.sentry.policy.common.PolicyConstants;
-import org.apache.sentry.provider.common.PolicyFileConstants;
+import org.apache.sentry.core.common.utils.SentryConstants;
+import org.apache.sentry.core.common.utils.PolicyFileConstants;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -183,8 +183,8 @@ private void validateRolePrivilegesMap(Map> actualMap,
for (String actualPrivilege : actualPrivileges) {
boolean isFound = exceptedPrivileges.contains(actualPrivilege);
if (!isFound) {
- String withOptionPrivilege = PolicyConstants.AUTHORIZABLE_JOINER.join(actualPrivilege,
- PolicyConstants.KV_JOINER.join(PolicyFileConstants.PRIVILEGE_GRANT_OPTION_NAME,
+ String withOptionPrivilege = SentryConstants.AUTHORIZABLE_JOINER.join(actualPrivilege,
+ SentryConstants.KV_JOINER.join(PolicyFileConstants.PRIVILEGE_GRANT_OPTION_NAME,
"false"));
isFound = exceptedPrivileges.contains(withOptionPrivilege);
}
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java
index 310610ee0..030425601 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java
@@ -24,7 +24,7 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java
index 9aac78c5e..5f64e1e9a 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java
@@ -25,7 +25,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java
index b28b6f464..5df46271b 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java
index bb8d61d86..d04c25f4c 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java
@@ -28,7 +28,7 @@
import java.sql.SQLException;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScope.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScope.java
index 4c1cd8e80..b5dea449c 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScope.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScope.java
@@ -30,7 +30,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java
index 6d4e8d303..bd9a70b59 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java
@@ -21,7 +21,7 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java
index efb588ee2..de74f5dde 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java
@@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.List;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java
index da3b90fff..79f17922c 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java
@@ -27,7 +27,7 @@
import java.sql.Statement;
import org.apache.hadoop.fs.Path;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.provider.file.PolicyFiles;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java
index f1fd15eb1..00ce08a2b 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java
@@ -32,7 +32,7 @@
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.After;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java
index f489b6344..0a8da1462 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java
@@ -34,7 +34,7 @@
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
import org.apache.sentry.binding.hive.v2.HiveAuthzBindingSessionHookV2;
import org.apache.sentry.binding.hive.v2.SentryAuthorizerFactory;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.After;
import org.junit.Assert;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java
index a1b89ae1f..a2850b987 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java
@@ -25,7 +25,7 @@
import com.google.common.io.Resources;
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java
index 02ac51454..c18a839f8 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java
@@ -29,7 +29,7 @@
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hive.service.cli.HiveSQLException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java
index 32da2aea3..783b4d610 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java
@@ -31,7 +31,7 @@
import org.junit.Assert;
import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java
index f1e6d75b2..9f35991b5 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java
@@ -40,7 +40,7 @@
import org.apache.hadoop.hive.serde.serdeConstants;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.pig.PigServer;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory.HiveServer2Type;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java
index 2507f83ad..2463a2f49 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java
@@ -16,9 +16,9 @@
*/
package org.apache.sentry.tests.e2e.metastore;
-import static org.apache.sentry.policy.common.PolicyConstants.AUTHORIZABLE_SPLITTER;
-import static org.apache.sentry.policy.common.PolicyConstants.PRIVILEGE_PREFIX;
-import static org.apache.sentry.policy.common.PolicyConstants.ROLE_SPLITTER;
+import static org.apache.sentry.core.common.utils.SentryConstants.AUTHORIZABLE_SPLITTER;
+import static org.apache.sentry.core.common.utils.SentryConstants.PRIVILEGE_PREFIX;
+import static org.apache.sentry.core.common.utils.SentryConstants.ROLE_SPLITTER;
import java.io.File;
import java.io.IOException;
@@ -26,15 +26,15 @@
import java.util.Map.Entry;
import java.util.Set;
-import org.apache.sentry.SentryUserException;
+import org.apache.sentry.core.common.exception.SentryUserException;
import org.apache.sentry.core.model.db.AccessConstants;
import org.apache.sentry.core.model.db.DBModelAction;
import org.apache.sentry.core.model.db.DBModelAuthorizable;
import org.apache.sentry.core.model.db.DBModelAuthorizable.AuthorizableType;
-import org.apache.sentry.policy.db.DBModelAuthorizables;
+import org.apache.sentry.core.model.db.DBModelAuthorizables;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
import org.apache.sentry.provider.db.service.thrift.TSentryRole;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.tools.ant.util.StringUtils;
import org.mortbay.log.Log;
@@ -76,7 +76,7 @@ public void write(File file) throws Exception {
}
// create roles and add privileges
- for (Entry> roleEntry : rolesToPermissions
+ for (Entry> roleEntry : getRolesToPermissions()
.asMap().entrySet()) {
sentryClient.createRole(StaticUserGroup.ADMIN1, roleEntry.getKey());
for (String privilege : roleEntry.getValue()) {
@@ -85,7 +85,7 @@ public void write(File file) throws Exception {
}
// grant roles to groups
- for (Entry> groupEntry : groupsToRoles.asMap()
+ for (Entry> groupEntry : getGroupsToRoles().asMap()
.entrySet()) {
for (String roleNames : groupEntry.getValue()) {
for (String roleName : roleNames.split(",")) {
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java
index 815c38ef6..e26e3b0b8 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java
@@ -29,7 +29,7 @@
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.Table;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.thrift.TException;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java
index f406fd7fc..3e9abd504 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java
@@ -27,7 +27,7 @@
import org.apache.hive.hcatalog.pig.HCatStorer;
import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java
index a9ff95d62..b25307caf 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java
@@ -35,7 +35,7 @@
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.Table;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.Context;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
diff --git a/sentry-tests/sentry-tests-hive/pom.xml b/sentry-tests/sentry-tests-hive/pom.xml
index 02bfa49c9..2979b4581 100644
--- a/sentry-tests/sentry-tests-hive/pom.xml
+++ b/sentry-tests/sentry-tests-hive/pom.xml
@@ -220,7 +220,7 @@ limitations under the License.
org.apache.sentry
- sentry-provider-db
+ sentry-service-server
test
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java
index a31584335..e7cccbfb7 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java
@@ -31,7 +31,7 @@
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.sentry.binding.hive.SentryHiveAuthorizationTaskFactoryImpl;
import org.apache.sentry.provider.db.SimpleDBProviderBackend;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.SentryService;
import org.apache.sentry.service.thrift.SentryServiceFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java
index 13b6e6272..224691e5c 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestConcurrentClients.java
@@ -21,7 +21,7 @@
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege;
import org.apache.sentry.provider.db.service.thrift.TSentryRole;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java
index 35f41c6ef..baba166ec 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbComplexView.java
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java
index f3bca9ccf..24bbf6f21 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbConnections.java
@@ -24,7 +24,7 @@
import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import static org.junit.Assume.assumeThat;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
index a0450af5b..a0a5afeff 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
@@ -27,7 +27,7 @@
import java.sql.Statement;
import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java
index 07d74b55b..36f0471b5 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/TestHaEnd2End.java
@@ -24,7 +24,7 @@
import java.sql.Statement;
import org.apache.sentry.core.common.exception.SentryAccessDeniedException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.HAClientInvocationHandler;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
index 1606b6d97..52e6fe4f3 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
@@ -71,7 +71,7 @@
import org.apache.sentry.core.common.exception.SentryAlreadyExistsException;
import org.apache.sentry.provider.db.SimpleDBProviderBackend;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.sentry.tests.e2e.hive.fs.MiniDFS;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
index ced9d1c08..fede2a8ed 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
@@ -64,7 +64,7 @@
import org.apache.sentry.core.model.db.DBModelAuthorizables;
import org.apache.sentry.provider.db.SimpleDBProviderBackend;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.KerberosConfiguration;
import org.apache.sentry.service.thrift.SentryServiceClientFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java
index 653156004..e4c9b2757 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestConfigTool.java
@@ -32,7 +32,7 @@
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
import org.apache.sentry.core.common.exception.SentryConfigurationException;
import org.apache.sentry.core.common.Subject;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java
index b123dcd00..95ef8f0cb 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCrossDbOps.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java
index 27238154b..d74c1830f 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestCustomSerdePrivileges.java
@@ -19,7 +19,7 @@
import com.google.common.collect.Maps;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java
index 23577c20a..c5560a690 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestEndToEnd.java
@@ -22,7 +22,7 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java
index 5242bb12c..b38eaaf35 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestExportImportPrivileges.java
@@ -16,7 +16,7 @@
*/
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertTrue;
import java.io.File;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java
index bc5c08be4..41ea86f41 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestJDBCInterface.java
@@ -27,7 +27,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java
index 0e403d854..d9415c5b8 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestLockPrivileges.java
@@ -27,7 +27,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java
index fb0ef19a5..51267c337 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataObjectRetrieval.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java
index 05420d1e7..524fa1c9d 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMetadataPermissions.java
@@ -21,7 +21,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
index a6edf03a6..b8907de4d 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart1.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart1.java
index a13aef5ac..39f136df5 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart1.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart1.java
@@ -26,7 +26,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart2.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart2.java
index 8eb2851eb..3f9a631fe 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart2.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperationsPart2.java
@@ -27,7 +27,7 @@
import java.util.Map;
import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java
index d1a34a85e..3b62cead2 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDBConfiguration.java
@@ -27,7 +27,7 @@
import java.sql.Statement;
import org.apache.sentry.core.common.utils.SentryConstants;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java
index c8712e772..0e82660f5 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPerDatabasePolicyFile.java
@@ -18,7 +18,7 @@
package org.apache.sentry.tests.e2e.hive;
import com.google.common.io.Resources;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java
index 310610ee0..030425601 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegeAtTransform.java
@@ -24,7 +24,7 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java
index c2fee2af1..793dc4a27 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtColumnScope.java
@@ -25,7 +25,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java
index b28b6f464..5df46271b 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtDatabaseScope.java
@@ -17,7 +17,7 @@
package org.apache.sentry.tests.e2e.hive;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java
index ef7a86c0d..cb3922ae1 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtFunctionScope.java
@@ -29,7 +29,7 @@
import java.sql.SQLException;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart1.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart1.java
index 5e8ed79d2..7e6e11193 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart1.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart1.java
@@ -29,7 +29,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart2.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart2.java
index 0cd272e4f..8eb0bd691 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart2.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPrivilegesAtTableScopePart2.java
@@ -26,7 +26,7 @@
import java.sql.ResultSet;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java
index 6d4e8d303..bd9a70b59 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestReloadPrivileges.java
@@ -21,7 +21,7 @@
import java.sql.Connection;
import java.sql.Statement;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java
index efb588ee2..de74f5dde 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestRuntimeMetadataRetrieval.java
@@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.List;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java
index da3b90fff..79f17922c 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSandboxOps.java
@@ -27,7 +27,7 @@
import java.sql.Statement;
import org.apache.hadoop.fs.Path;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.provider.file.PolicyFiles;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java
index 4a64072f9..ecd199ff6 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestSentryOnFailureHookLoading.java
@@ -31,7 +31,7 @@
import org.junit.Assert;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.After;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java
index 56e0e009d..b566ee8f9 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestServerConfiguration.java
@@ -33,7 +33,7 @@
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.sentry.binding.hive.HiveAuthzBindingSessionHook;
import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.After;
import org.junit.Assert;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java
index a1b89ae1f..a2850b987 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUriPermissions.java
@@ -25,7 +25,7 @@
import com.google.common.io.Resources;
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java
index 02ac51454..c18a839f8 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestUserManagement.java
@@ -29,7 +29,7 @@
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hive.service.cli.HiveSQLException;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java
index 79e9548f4..24fbe7e25 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestViewPrivileges.java
@@ -30,7 +30,7 @@
import org.junit.Assert;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java
index f1e6d75b2..9f35991b5 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/AbstractMetastoreTestWithStaticConfiguration.java
@@ -40,7 +40,7 @@
import org.apache.hadoop.hive.serde.serdeConstants;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.pig.PigServer;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.AbstractTestWithStaticConfiguration;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory.HiveServer2Type;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java
index 875e9aa92..2463a2f49 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/SentryPolicyProviderForDb.java
@@ -34,7 +34,7 @@
import org.apache.sentry.core.model.db.DBModelAuthorizables;
import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
import org.apache.sentry.provider.db.service.thrift.TSentryRole;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.tools.ant.util.StringUtils;
import org.mortbay.log.Log;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java
index 3c28fd088..d8e45b5a4 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java
@@ -29,7 +29,7 @@
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.Table;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.thrift.TException;
import org.junit.Before;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java
index f406fd7fc..3e9abd504 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetaStoreWithPigHCat.java
@@ -27,7 +27,7 @@
import org.apache.hive.hcatalog.pig.HCatStorer;
import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.junit.Before;
import org.junit.BeforeClass;
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java
index 98ec814a6..c0f5fe8a3 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java
@@ -35,7 +35,7 @@
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.Table;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.tests.e2e.hive.Context;
import org.apache.sentry.tests.e2e.hive.StaticUserGroup;
import org.apache.sentry.tests.e2e.hive.hiveserver.HiveServerFactory;
diff --git a/sentry-tests/sentry-tests-kafka/pom.xml b/sentry-tests/sentry-tests-kafka/pom.xml
index 44ee04581..4c0ae777f 100644
--- a/sentry-tests/sentry-tests-kafka/pom.xml
+++ b/sentry-tests/sentry-tests-kafka/pom.xml
@@ -58,7 +58,8 @@ limitations under the License.
org.apache.sentry
- sentry-provider-db
+ sentry-service-server
+ test
diff --git a/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java b/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
index 74fe4214d..10d6af73d 100644
--- a/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
+++ b/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
@@ -34,7 +34,7 @@
import org.apache.sentry.provider.db.generic.service.thrift.TSentryPrivilege;
import org.apache.sentry.provider.db.generic.tools.KafkaTSentryPrivilegeConverter;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.SentryService;
import org.apache.sentry.service.thrift.SentryServiceFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
diff --git a/sentry-tests/sentry-tests-solr/pom.xml b/sentry-tests/sentry-tests-solr/pom.xml
index 2f802ab10..a60b4eed4 100644
--- a/sentry-tests/sentry-tests-solr/pom.xml
+++ b/sentry-tests/sentry-tests-solr/pom.xml
@@ -45,7 +45,7 @@ limitations under the License.
org.apache.sentry
- sentry-provider-db
+ sentry-service-server
test
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
index ccea82ee8..2abd9d2e4 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
@@ -47,7 +47,7 @@
import org.apache.sentry.provider.db.generic.service.thrift.TSentryGrantOption;
import org.apache.sentry.provider.db.generic.service.thrift.TSentryPrivilege;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.SentryService;
import org.apache.sentry.service.thrift.SentryServiceFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
diff --git a/sentry-tests/sentry-tests-sqoop/pom.xml b/sentry-tests/sentry-tests-sqoop/pom.xml
index c494b5a14..f70c5c326 100644
--- a/sentry-tests/sentry-tests-sqoop/pom.xml
+++ b/sentry-tests/sentry-tests-sqoop/pom.xml
@@ -74,7 +74,7 @@ limitations under the License.
org.apache.sentry
- sentry-provider-db
+ sentry-service-server
test
diff --git a/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java b/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
index 8a01e1c5c..67de5acb3 100644
--- a/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
+++ b/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
@@ -41,7 +41,7 @@
import org.apache.sentry.provider.db.generic.service.thrift.TAuthorizable;
import org.apache.sentry.provider.db.generic.service.thrift.TSentryPrivilege;
import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
-import org.apache.sentry.provider.file.PolicyFile;
+import org.apache.sentry.core.common.utils.PolicyFile;
import org.apache.sentry.service.thrift.SentryService;
import org.apache.sentry.service.thrift.SentryServiceFactory;
import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;