sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject sentry git commit: SENTRY-2262: Sentry client is not compatible when connecting to Sentry 2.0 (Sergio Pena, reviewed by Na Li)
Date Tue, 12 Jun 2018 18:18:54 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 4f75cc1c4 -> cfd4962c8


SENTRY-2262: Sentry client is not compatible when connecting to Sentry 2.0 (Sergio Pena, reviewed
by Na Li)


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

Branch: refs/heads/master
Commit: cfd4962c851b896c263de6ed05c5abf5a3a0e59b
Parents: 4f75cc1
Author: Sergio Pena <sergio.pena@cloudera.com>
Authored: Tue Jun 12 13:18:18 2018 -0500
Committer: Sergio Pena <sergio.pena@cloudera.com>
Committed: Tue Jun 12 13:18:18 2018 -0500

----------------------------------------------------------------------
 .../thrift/SentryPolicyServiceClientDefaultImpl.java        | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/cfd4962c/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 4e605ae..f0f08ea 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
@@ -232,8 +232,13 @@ public class SentryPolicyServiceClientDefaultImpl implements SentryPolicyService
     TListSentryPrivilegesRequest request = new TListSentryPrivilegesRequest();
     request.setProtocol_version(ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT);
     request.setRequestorUserName(requestorUserName);
-    request.setRoleName(""); // 'roleName' is required but it is deprecated by 'entityName'
-    request.setEntityName(roleName);
+
+    // TODO: Switch from setRoleName() to setEntityName()
+    // The 'roleName' parameter is deprecated in Sentry 2.x, but it is still required by
older
+    // versions of Sentry 2.0. To keep compatibility when connecting to older versions of
Sentry 2.x,
+    // then we'll use this parameter, but it will be switched for setEntityName once the
roleName
+    // is removed.
+    request.setRoleName(roleName);
     if (authorizable != null && !authorizable.isEmpty()) {
       TSentryAuthorizable tSentryAuthorizable = setupSentryAuthorizable(authorizable);
       request.setAuthorizableHierarchy(tSentryAuthorizable);


Mime
View raw message