Skip to content

Commit

Permalink
expose results
Browse files Browse the repository at this point in the history
(cherry picked from commit 8464ffc)
(cherry picked from commit 4f58845)
(cherry picked from commit d697ae9)
(cherry picked from commit 7bd6b48)
(cherry picked from commit 8ded83f)
  • Loading branch information
jordanpatton authored and xtinec committed Mar 26, 2019
1 parent 22edad8 commit 1524510
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,9 @@ def cache_key_exist(self, key):
@expose('/results/<key>/')
@log_this
def results(self, key):
return self.results_call(key)

def results_call(self, key):
"""Serves a key off of the results backend"""
if not results_backend:
return json_error_response("Results backend isn't configured")
Expand Down
9 changes: 9 additions & 0 deletions superset/views/lyft.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,14 @@ def queries(self, last_updated_ms):
return json_error_response('{}'.format(e))
return self.queries_call(last_updated_ms)

@expose('/results/<key>')
@log_this
def results(self, key):
try:
self.authorize()
except (UserDontExistException, SupersetException) as e:
return json_error_response('{}'.format(e))
return self.results_call(key)


appbuilder.add_view_no_menu(Lyft)
1 change: 1 addition & 0 deletions tests/security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def test_views_are_secured(self):
['Lyft', 'welcome'],
['Lyft', 'sql_json'],
['Lyft', 'queries'],
['Lyft', 'results'],
]
unsecured_views = []
for view_class in appbuilder.baseviews:
Expand Down

0 comments on commit 1524510

Please sign in to comment.