HUE-9478 [api] Job browser proxy

Review Request #15448 — Created Sept. 17, 2020 and submitted

Sreenath
hue
master
HUE-9478
hue
johan, romain
commit 140117c50ca3057fb3e0da680c289eeba87689e6
Author: sreenaths <sree@apache.org>
Date:   Fri Sep 18 00:38:28 2020 +0530

    HUE-9478. [api] Job browser proxy

:100644 100644 f31fd37b57 e9e284dc32 M	apps/jobbrowser/src/jobbrowser/conf.py
:100644 100644 6fc44f9088 d4c3d74185 M	apps/jobbrowser/src/jobbrowser/urls.py
:100644 100644 3294fd1d14 a5af2901e5 M	desktop/conf.dist/hue.ini
:100644 100644 3dca8321b2 184d84db5a M	desktop/conf/pseudo-distributed.ini.tmpl
:100644 100644 fbf0b5cb46 74351f6a64 M	desktop/core/src/desktop/settings.py

Manually tested, the proxy is created when configuration is set and requests are getting proxied.

  • 0
  • 0
  • 10
  • 0
  • 10
Description From Last Updated
romain
  1. For this one, how do we handle the authentication?

  2. apps/jobbrowser/src/jobbrowser/urls.py (Diff revision 1)
     
     

    Avoid the new line?

  3. apps/jobbrowser/src/jobbrowser/urls.py (Diff revision 1)
     
     

    upstreamURL --> upstream_url

    (Python standard case)

    (also actually probably no need to have the variable)

  4. desktop/core/src/desktop/settings.py (Diff revision 1)
     
     

    If we go this way, would need to check the license and add it to desktop/ext-py and requirements.txt

  5. desktop/core/src/desktop/settings.py (Diff revision 1)
     
     

    If not enabled, we should not load the app

  6. 
      
Sreenath
romain
  1. Nice!

    And we can easily add the Kerberos auth flag in a follow-up

  2. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 2)
     
     
     

    To combine

  3. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 2)
     
     
     

    Combine + move above other import on line 26

  4. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 2)
     
     
     
     
     
     
     
     
     

    Move to bottom of file?

  5. apps/jobbrowser/src/jobbrowser/urls.py (Diff revision 2)
     
     

    One more new line

  6. apps/jobbrowser/src/jobbrowser/urls.py (Diff revision 2)
     
     

    nit: proxy --> query-proxy?

  7. 
      
Sreenath
Sreenath
romain
  1. 
      
  2. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 4)
     
     

    PS: `content_type='application/json; charset=UTF-8'` can be moved down the function as hardcoded, and later can be auto detected based on the content type of the `request` headers

    https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.META

  3. 
      
Sreenath
Sreenath
Sreenath
Review request changed

Status: Closed (submitted)

Loading...