Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Plugins endpoint was unauthenticated #14570

Merged
merged 1 commit into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2982,6 +2982,11 @@ class PluginView(AirflowBaseView):
]

@expose('/plugin')
@auth.has_access(
[
(permissions.ACTION_CAN_READ, permissions.RESOURCE_PLUGIN),
]
)
def list(self):
"""List loaded plugins."""
plugins_manager.ensure_plugins_loaded()
Expand Down
6 changes: 6 additions & 0 deletions tests/www/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ def test_should_list_entrypoint_plugins_on_page_with_details(self):
self.check_content_in_response("source", resp)
self.check_content_in_response("<em>test-entrypoint-testpluginview==1.0.0:</em> <Mock id=", resp)

def test_endpoint_should_not_be_unauthenticated(self):
self.logout()
resp = self.client.get('/plugin', follow_redirects=True)
self.check_content_not_in_response("test_plugin", resp)
self.check_content_in_response("Sign In - Airflow", resp)


class TestPoolModelView(TestBase):
def setUp(self):
Expand Down