potiuk opened a new pull request, #69790: URL: https://github.com/apache/airflow/pull/69790
Import errors are authorized per Dag defined in the file. Files with no registered Dag (parse failed before any Dag was defined, or all Dags removed) have no per-Dag key to authorize on. This adds a dedicated `IMPORT_ERRORS_ALL` view -- admin-granted by default, scoped per team via the file's bundle where the auth manager supports multi-team isolation -- and gates such files on it: callers without the permission are denied those import errors (`403` on the single endpoint; excluded from the list endpoint) instead of receiving the raw stack trace. Implements #67461. - New `AccessView.IMPORT_ERRORS_ALL`. - Auth managers gain an `is_authorized_view_for_team` method that defaults to `is_authorized_view`, so auth managers that do not implement it (including out-of-tree ones) keep working unchanged. The simple and Keycloak managers override it to enforce team scoping; the FAB manager grants the new permission to `Admin` by default. - Both Import Errors endpoints resolve the file's team from its bundle and authorize unregistered-file errors on the new view; the list endpoint excludes unauthorized rows from the results and `total_entries` so their existence does not surface. ### Tests - [x] `test_import_error.py` -- with the permission the raw stack trace is returned; without it the single endpoint returns `403` and the list endpoint omits the rows; team scoping is honored; no query-count regression. - [x] `test_base_auth_manager.py` -- `is_authorized_view_for_team` falls back to `is_authorized_view` by default. - [x] simple / FAB / Keycloak auth-manager suites. <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. --> ##### Was generative AI tooling used to co-author this PR? - [X] Yes -- Claude Opus 4.8 (1M context) Generated-by: Claude Opus 4.8 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions -- 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]
