Uploaded image for project: 'Hue (READ ONLY)'
  1. Hue (READ ONLY)
  2. HUE-964

[core] 500 error page is dependent monkey patched method

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: core.api
    • Labels:
      None

      Description

      The 500 error page is dependent on user.has_hue_permission, which is monkey patched onto the user object via the user augmentor system. The monkey patching occurs during authentication and get_user calls:

      class DesktopBackendBase(object):
        """
        Abstract base class for providing external authentication schemes.
      
        Extend this class and implement check_auth
        """
        def authenticate(self, username, password):
          if self.check_auth(username, password):
            user = find_or_create_user(username)
            user = rewrite_user(user)
            return user
          else:
            return None
      
        def get_user(self, user_id):
          try:
            user = User.objects.get(pk=user_id)
            user = rewrite_user(user)
            return user
          except User.DoesNotExist:
            return None
      
        def check_auth(self, username, password):
          """
          Implementors should return a boolean value which determines
          whether the given username and password pair is valid.
          """
          raise Exception("Abstract class - must implement check_auth")
      

      There should be no such dependencies in the 500 page.

        Attachments

          Activity

            People

            • Assignee:
              abe Abraham Elmahrek
              Reporter:
              abe Abraham Elmahrek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: