Repository navigation
Hide unreadable assets in the asset expression served by next_run_assets - #72864
Merged
Merged
Conversation
henry3260
requested review from
bbovenzi,
bugraoz93,
choo121600,
dheerajturaga,
ephraimbuddy,
guan404ming,
jason810496,
pierrejeambrun,
potiuk,
rawwar,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
September 10, 2026 05:40
henry3260
marked this pull request as draft
September 10, 2026 05:42
henry3260
marked this pull request as ready for review
September 10, 2026 08:30
1 task done
bbovenzi
approved these changes
Sep 18, 2026
1 task done
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DagModel.asset_expressionnames every upstream asset of a Dag, including their ids, names and uris.GET /ui/next_run_assets/{dag_id}returns it verbatim, so a caller with read access to a Dag can learn the identity of assets a fine-grained auth manager hides from them, even after theeventslist itself is scoped (#72862).The expression is written by the Dag processor with no notion of a caller, and the scheduler needs it complete, so it cannot be filtered at write time. It has to be scoped per request, at the API layer, like the asset list endpoints already are.
This is the first of a small series: it introduces the shared redaction helper and the response-shape change, and wires the first endpoint. Follow-ups will wire the public
GET /dags/{dag_id}/details, the UIGET /ui/dagslist, and the UI rendering of a hidden leaf.What
airflow-core/src/airflow/api_fastapi/common/asset_expression.py: newredact_asset_expressionhelper. It walks theall/anytree and replaces everyassetleaf whose id the caller may not read with{"uri": null, "name": null, "id": null, "group": ..., "hidden": true}. The slot is kept so the shape of the schedule stays honest instead of silently dropping a condition. A leaf without an id fails closed.aliasandasset_refleaves are left as-is (no batch authorization exists for aliases; refs are unresolved names by design). The input is never mutated, since it lives on an ORM row whose session commits on exit.airflow-core/src/airflow/api_fastapi/core_api/datamodels/common.py:AssetExpressionAssetInfogainshidden: bool = False, anduri/namebecome nullable to carry a redacted leaf.airflow-core/src/airflow/api_fastapi/core_api/routes/ui/assets.py:next_run_assetsinjectsReadableAssetsFilterDepand serves the redacted expression on all three return paths.Was generative AI tooling used to co-author this PR?