tanujdargan commented on code in PR #52408: URL: https://github.com/apache/airflow/pull/52408#discussion_r2175341071
########## airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py: ########## @@ -20,7 +20,7 @@ from tests_common.test_utils.config import conf_vars -pytestmark = pytest.mark.db_test +pytestmark = [pytest.mark.db_test, pytest.mark.mock_plugin_manager(plugins=[])] Review Comment: I agree, just pushed a fix for this! https://github.com/apache/airflow/pull/52408/commits/f41d1c9efa12ca32dd8d692b83c083cbbd44365d ########## airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py: ########## @@ -46,17 +48,29 @@ responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]), dependencies=[Depends(requires_authenticated())], ) -def get_configs() -> ConfigResponse: +async def get_configs(user: GetUserDep) -> ConfigResponse: """Get configs for UI.""" config = {key: conf.get("api", key) for key in API_CONFIG_KEYS} task_log_reader = TaskLogReader() + plugins_manager.initialize_ui_plugins() + + auth_manager = get_auth_manager() + authorized_plugins = [] + if plugins_manager.external_views: + for view in plugins_manager.external_views: + if auth_manager.is_authorized_custom_view(method="GET", resource_name=view["name"], user=user): + authorized_plugins.append(view) Review Comment: Yup https://github.com/apache/airflow/pull/52408/commits/f41d1c9efa12ca32dd8d692b83c083cbbd44365d -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
