Explorar el Código

HUE-8498 [core] Add whitelist to Spnego middleware

Ying Chen hace 7 años
padre
commit
09dc8598b2
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      desktop/core/src/desktop/middleware.py

+ 5 - 1
desktop/core/src/desktop/middleware.py

@@ -566,9 +566,13 @@ class SpnegoMiddleware(object):
       Negotiate. This will cause the browser to re-try the request with the
       AUTHORIZATION header set.
     """
+    view_func = resolve(request.path)[0]
+    if view_func in DJANGO_VIEW_AUTH_WHITELIST:
+      return
+
     # AuthenticationMiddleware is required so that request.user exists.
     if not hasattr(request, 'user'):
-      raise ImproperlyConfigured(
+      raise exceptions.ImproperlyConfigured(
         "The Django remote user auth middleware requires the"
         " authentication middleware to be installed.  Edit your"
         " MIDDLEWARE_CLASSES setting to insert"