Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-563

The interface listPrivilegesByRoleName may throw thrift exception if Authorizable is empty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • None
    • None

    Description

      public Set<TSentryPrivilege> listPrivilegesByRoleName(String requestorUserName,
            String roleName, List<? extends Authorizable> authorizable)
        throws SentryUserException {
          TListSentryPrivilegesRequest request = new TListSentryPrivilegesRequest();
          request.setProtocol_version(ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT);
          request.setRequestorUserName(requestorUserName);
          request.setRoleName(roleName);
          if (authorizable != null) {   ==> we should add check empty of authorizable here.
            TSentryAuthorizable tSentryAuthorizable = setupSentryAuthorizable(authorizable);
            request.setAuthorizableHierarchy(tSentryAuthorizable);
          }
         ...
      

      Please see my test cases in this patch, before this patch, it will throw exception.
      Sentry client interface should be robustness, it also blocks SHOW GRANT DDL of V2 feature.

      Attachments

        1. SENTRY-563.001.patch
          3 kB
          Xiaomeng Huang
        2. SENTRY-563.002.patch
          3 kB
          Xiaomeng Huang

        Issue Links

          Activity

            People

              Huang Xiaomeng Xiaomeng Huang
              Huang Xiaomeng Xiaomeng Huang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: