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

SentryPolicyServiceClientDefaultImpl setupSentryAuthorizable methods always returns a single TSentryAuthorizable for a list of authorizable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.1.0
    • 2.1.0
    • Sentry
    • None

    Description

      Looking at the current implementation of SentryPolicyServiceClientDefaultImpl#setupSentryAuthorizable we get a list of authorizables but only have a single instance of TSentryAuthorizable which wrongly overwrites values in the for loop

      public static TSentryAuthorizable setupSentryAuthorizable(
          List<? extends Authorizable> authorizable) {
          TSentryAuthorizable tSentryAuthorizable = new TSentryAuthorizable();
      
          for (Authorizable authzble : authorizable) {
            if (authzble.getTypeName().equalsIgnoreCase(
              DBModelAuthorizable.AuthorizableType.Server.toString())) {
              tSentryAuthorizable.setServer(authzble.getName());
            } else if (authzble.getTypeName().equalsIgnoreCase(
              DBModelAuthorizable.AuthorizableType.URI.toString())) {
              tSentryAuthorizable.setUri(authzble.getName());
            } else if (authzble.getTypeName().equalsIgnoreCase(
              DBModelAuthorizable.AuthorizableType.Db.toString())) {
              tSentryAuthorizable.setDb(authzble.getName());
            } else if (authzble.getTypeName().equalsIgnoreCase(
              DBModelAuthorizable.AuthorizableType.Table.toString())) {
              tSentryAuthorizable.setTable(authzble.getName());
            } else if (authzble.getTypeName().equalsIgnoreCase(
              DBModelAuthorizable.AuthorizableType.Column.toString())) {
              tSentryAuthorizable.setColumn(authzble.getName());
            }
          }
          return tSentryAuthorizable;
        }
      

      Attachments

        Activity

          People

            arjunmishra13 Arjun Mishra
            arjunmishra13 Arjun Mishra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: