sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amis...@apache.org
Subject sentry git commit: SENTRY-2375: Fix API typos on SentryPolicyServiceClient (Morio Ramdenbourg reviewed by Arjun Mishra)
Date Thu, 06 Sep 2018 14:11:30 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 2492be15d -> 4e6305e89


SENTRY-2375: Fix API typos on SentryPolicyServiceClient (Morio Ramdenbourg reviewed by Arjun
Mishra)

Change-Id: I43f5e354ce6b9c01d5a23fa64799a2b8ad6d67a1


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/4e6305e8
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/4e6305e8
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/4e6305e8

Branch: refs/heads/master
Commit: 4e6305e891442e55db6e9c0e463f789a53959b6a
Parents: 2492be1
Author: amishra <amishra@cloudera.com>
Authored: Thu Sep 6 09:10:57 2018 -0500
Committer: amishra <amishra@cloudera.com>
Committed: Thu Sep 6 09:11:04 2018 -0500

----------------------------------------------------------------------
 .../authz/DefaultSentryAccessController.java    |  6 ++--
 .../thrift/SentryPolicyServiceClient.java       |  6 ++--
 .../SentryPolicyServiceClientDefaultImpl.java   |  8 ++---
 .../thrift/TestSentryServiceIntegration.java    | 38 ++++++++++----------
 4 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/4e6305e8/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/DefaultSentryAccessController.java
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/DefaultSentryAccessController.java
b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/DefaultSentryAccessController.java
index 5db796d..94783fa 100644
--- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/DefaultSentryAccessController.java
+++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/DefaultSentryAccessController.java
@@ -311,7 +311,7 @@ public class DefaultSentryAccessController extends SentryHiveAccessController
{
       if (authorizableSet != null && !authorizableSet.isEmpty()) {
         hiveAuthzBinding = new HiveAuthzBinding(hiveHook, this.conf, authzConf);
         sentryObjectPrivileges = sentryClient
-            .getAllPrivilegsbyAuthorizable(authenticator.getUserName(), authorizableSet,
null, users, hiveAuthzBinding.getActiveRoleSet());
+            .getAllPrivilegesbyAuthorizable(authenticator.getUserName(), authorizableSet,
null, users, hiveAuthzBinding.getActiveRoleSet());
       } else {
         String msg =
             SentryHiveConstants.SHOW_NOT_SUPPORTED_FOR_PRINCIPAL + "object name [" + privObj.getObjectName()
+ "] does not exist";
@@ -327,10 +327,10 @@ public class DefaultSentryAccessController extends SentryHiveAccessController
{
       HiveOperation hiveOp = HiveOperation.SHOW_GRANT;
       executeOnFailureHooks(hiveOp, e);
     } catch (SentryUserException e) {
-      String msg = "Error when sentryClient listPrivilegsbyAuthorizable: " + e;
+      String msg = "Error when sentryClient listPrivilegesbyAuthorizable: " + e;
       executeOnErrorHooks(msg, e);
     } catch (Exception e) {
-      String msg = "Error when sentryClient listPrivilegsbyAuthorizable: " + e;
+      String msg = "Error when sentryClient listPrivilegesbyAuthorizable: " + e;
       executeOnErrorHooks(msg, e);
     } finally {
       closeClient();

http://git-wip-us.apache.org/repos/asf/sentry/blob/4e6305e8/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClient.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClient.java
b/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClient.java
index 3ef1624..5fc299b 100644
--- a/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClient.java
+++ b/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClient.java
@@ -216,7 +216,7 @@ public interface SentryPolicyServiceClient extends AutoCloseable {
       List<? extends Authorizable> oldAuthorizables, List<? extends Authorizable>
newAuthorizables)
       throws SentryUserException;
 
-  Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegsbyAuthorizable(
+  Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegesbyAuthorizable(
       String requestorUserName, Set<List<? extends Authorizable>> authorizables,
       Set<String> groups, ActiveRoleSet roleSet) throws SentryUserException;
 
@@ -238,7 +238,7 @@ public interface SentryPolicyServiceClient extends AutoCloseable {
    * @return A list of privileges on the specified authorizable object.
    * @throws SentryUserException In case an error occurs while getting the list of privileges.
    */
-  Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegsbyAuthorizable(
+  Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegesbyAuthorizable(
     String requestorUserName, Set<List<? extends Authorizable>> authorizables,
     Set<String> groups, Set<String> users, ActiveRoleSet roleSet) throws SentryUserException;
 
@@ -260,7 +260,7 @@ public interface SentryPolicyServiceClient extends AutoCloseable {
    * @return A an instance of SentryObjectPrivileges on the specified authorizable object.
    * @throws SentryUserException In case an error occurs while getting the list of privileges.
    */
-  SentryObjectPrivileges getAllPrivilegsbyAuthorizable(
+  SentryObjectPrivileges getAllPrivilegesbyAuthorizable(
       String requestorUserName, Set<List<? extends Authorizable>> authorizables,
       Set<String> groups, Set<String> users, ActiveRoleSet roleSet) throws SentryUserException;
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/4e6305e8/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClientDefaultImpl.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClientDefaultImpl.java
b/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClientDefaultImpl.java
index a2213ae..68d864c 100644
--- a/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClientDefaultImpl.java
+++ b/sentry-service/sentry-service-api/src/main/java/org/apache/sentry/api/service/thrift/SentryPolicyServiceClientDefaultImpl.java
@@ -927,14 +927,14 @@ public class SentryPolicyServiceClientDefaultImpl implements SentryPolicyService
   }
 
   @Override
-  public Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegsbyAuthorizable(
+  public Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegesbyAuthorizable(
     String requestorUserName, Set<List<? extends Authorizable>> authorizables,
Set<String> groups,
     ActiveRoleSet roleSet) throws SentryUserException {
-    return listPrivilegsbyAuthorizable(requestorUserName, authorizables, groups, null, roleSet);
+    return listPrivilegesbyAuthorizable(requestorUserName, authorizables, groups, null, roleSet);
   }
 
   @Override
-  public Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegsbyAuthorizable
+  public Map<TSentryAuthorizable, TSentryPrivilegeMap> listPrivilegesbyAuthorizable
     (
       String requestorUserName,
       Set<List<? extends Authorizable>> authorizables, Set<String> groups,
@@ -947,7 +947,7 @@ public class SentryPolicyServiceClientDefaultImpl implements SentryPolicyService
   }
 
   @Override
-  public SentryObjectPrivileges getAllPrivilegsbyAuthorizable
+  public SentryObjectPrivileges getAllPrivilegesbyAuthorizable
   (
     String requestorUserName,
     Set<List<? extends Authorizable>> authorizables, Set<String> groups,

http://git-wip-us.apache.org/repos/asf/sentry/blob/4e6305e8/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryServiceIntegration.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryServiceIntegration.java
b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryServiceIntegration.java
index 73fca84..bfafa7d 100644
--- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryServiceIntegration.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryServiceIntegration.java
@@ -700,37 +700,37 @@ public class TestSentryServiceIntegration extends SentryServiceIntegrationBase
{
 
         // verify for null group and null roleset
         Map<TSentryAuthorizable, TSentryPrivilegeMap> authPrivMap = client
-            .listPrivilegsbyAuthorizable(requestorUserName, authorizableSet, null, null);
+            .listPrivilegesbyAuthorizable(requestorUserName, authorizableSet, null, null);
         assertEquals(expectedResults, authPrivMap);
 
         // verify for null group and specific roleset
-        authPrivMap = client.listPrivilegsbyAuthorizable(requestorUserName, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(requestorUserName, authorizableSet,
             null, new ActiveRoleSet(testRoleSet));
         assertEquals(expectedResults, authPrivMap);
 
         // verify for null group and specific roleset
-        authPrivMap = client.listPrivilegsbyAuthorizable(requestorUserName, authorizableSet,
null,
+        authPrivMap = client.listPrivilegesbyAuthorizable(requestorUserName, authorizableSet,
null,
             ActiveRoleSet.ALL);
         assertEquals(expectedResults, authPrivMap);
 
         // verify for specific group and null roleset
-        authPrivMap = client.listPrivilegsbyAuthorizable(requestorUserName, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(requestorUserName, authorizableSet,
             testGroupSet, null);
         assertEquals(expectedResults, authPrivMap);
 
         // verify for specific group and specific roleset
-        authPrivMap = client.listPrivilegsbyAuthorizable(requestorUserName, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(requestorUserName, authorizableSet,
             testGroupSet, new ActiveRoleSet(testRoleSet));
         assertEquals(expectedResults, authPrivMap);
 
         // verify for specific group and ALL roleset
-        authPrivMap = client.listPrivilegsbyAuthorizable(requestorUserName, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(requestorUserName, authorizableSet,
             testGroupSet, ActiveRoleSet.ALL);
         assertEquals(expectedResults, authPrivMap);
 
         // verify users not belonging to any group are not shown anything
         authPrivMap = client
-            .listPrivilegsbyAuthorizable("random", authorizableSet,
+            .listPrivilegesbyAuthorizable("random", authorizableSet,
                 new HashSet<String>(), ActiveRoleSet.ALL);
         expectedResults.clear();
         expectedResults.put(
@@ -798,7 +798,7 @@ public class TestSentryServiceIntegration extends SentryServiceIntegrationBase
{
         Set<List<? extends Authorizable>> authorizableSet = Sets.newHashSet();
         authorizableSet.add(db2TabAuthrizable);
         Map<TSentryAuthorizable, TSentryPrivilegeMap> authPrivMap = client
-            .listPrivilegsbyAuthorizable(requestorUserName, authorizableSet, null, null);
+            .listPrivilegesbyAuthorizable(requestorUserName, authorizableSet, null, null);
 
         assertEquals(expectedResults, authPrivMap);
       }});
@@ -862,7 +862,7 @@ public class TestSentryServiceIntegration extends SentryServiceIntegrationBase
{
         Set<List<? extends Authorizable>> authorizableSet = Sets.newHashSet();
         authorizableSet.add(uri1Authrizable);
         Map<TSentryAuthorizable, TSentryPrivilegeMap> authPrivMap = client
-            .listPrivilegsbyAuthorizable(requestorUserName, authorizableSet, null, null);
+            .listPrivilegesbyAuthorizable(requestorUserName, authorizableSet, null, null);
 
         assertEquals(expectedResults, authPrivMap);
       }});
@@ -933,38 +933,38 @@ public class TestSentryServiceIntegration extends SentryServiceIntegrationBase
{
 
         // list privileges with null group and roles
         Map<TSentryAuthorizable, TSentryPrivilegeMap> authPrivMap = client
-            .listPrivilegsbyAuthorizable(user1, authorizableSet, null, null);
+            .listPrivilegesbyAuthorizable(user1, authorizableSet, null, null);
         assertEquals(expectedResults, authPrivMap);
 
         // list privileges with empty group set and null roles
-        authPrivMap = client.listPrivilegsbyAuthorizable(user1, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(user1, authorizableSet,
             new HashSet<String>(), null);
         assertEquals(expectedResults, authPrivMap);
 
         // list privileges with null group set and ALL roleset
-        authPrivMap = client.listPrivilegsbyAuthorizable(user1, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(user1, authorizableSet,
             null, new ActiveRoleSet(true));
         assertEquals(expectedResults, authPrivMap);
 
         // list privileges with user1's group set and null roles
-        authPrivMap = client.listPrivilegsbyAuthorizable(user1, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(user1, authorizableSet,
             userGroupNames1, null);
         assertEquals(expectedResults, authPrivMap);
 
         // list privileges with user1's group set and ALL roles
-        authPrivMap = client.listPrivilegsbyAuthorizable(user1, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(user1, authorizableSet,
             userGroupNames1, new ActiveRoleSet(true));
         assertEquals(expectedResults, authPrivMap);
 
         // list privileges with null group and user's specific roles with uppercase name
-        authPrivMap = client.listPrivilegsbyAuthorizable(user1, authorizableSet,
+        authPrivMap = client.listPrivilegesbyAuthorizable(user1, authorizableSet,
             null, new ActiveRoleSet(Sets.newHashSet(roleName1.toUpperCase())));
         assertEquals(expectedResults, authPrivMap);
 
         // verify that user1 can't query group2
         try {
-          client.listPrivilegsbyAuthorizable(user1, authorizableSet, userGroupNames2, null);
-          fail("listPrivilegsbyAuthorizable() should fail for user1 accessing " + group2);
+          client.listPrivilegesbyAuthorizable(user1, authorizableSet, userGroupNames2, null);
+          fail("listPrivilegesbyAuthorizable() should fail for user1 accessing " + group2);
         } catch (SentryAccessDeniedException e) {
           // expected
         }
@@ -972,8 +972,8 @@ public class TestSentryServiceIntegration extends SentryServiceIntegrationBase
{
         // verify that user1 can't query role2
         ActiveRoleSet roleSet2 = new ActiveRoleSet(Sets.newHashSet(roleName2));
         try {
-          client.listPrivilegsbyAuthorizable(user1, authorizableSet, null, roleSet2);
-          fail("listPrivilegsbyAuthorizable() should fail for user1 accessing " + roleName2);
+          client.listPrivilegesbyAuthorizable(user1, authorizableSet, null, roleSet2);
+          fail("listPrivilegesbyAuthorizable() should fail for user1 accessing " + roleName2);
         } catch (SentryAccessDeniedException e) {
           // expected
         }


Mime
View raw message