Repository navigation
Conversation
`next_run_assets` scopes the asset scheduling expression it serves to the assets the caller may read (apache#72864), and the dependencies graph followed (apache#73008). Four endpoints still served `DagModel.asset_expression` verbatim: the public Dag details endpoint, the UI Dag list, and both partitioned Dag run endpoints. A caller authorized on a Dag but not on its upstream assets could read every name and uri out of them, and the public endpoint needs no UI to reach. Asset names and uris commonly encode bucket, table or dataset names, which is why the rest of the asset API already scopes them. The sibling `assets` array of the pending partitioned Dag run response carries the same names; scoping that is a separate change with its own UI consumers.
The pending partitioned Dag run detail response carries two asset-bearing fields. `asset_expression` is scoped to the assets the caller may read; the sibling `assets` array was not, so one payload could blank an asset inside the boolean tree while spelling its name and uri out one key over. That defeated the redaction on this route, and the route's own asset dependency only checks whether the caller may read assets at all -- there is no asset id in its path for it to authorize against. The counts and partition keys of a blanked asset are kept. They describe the Dag's own schedule, which a caller who reached this endpoint can already read, and dropping them would leave a stuck run with no explanation at all. This endpoint is served only to the UI: the public v2 spec regenerates byte-identical, and no airflow-ctl model references the response.
henry3260
marked this pull request as ready for review
October 20, 2026 16:55
henry3260
requested review from
bbovenzi,
bugraoz93,
choo121600,
ephraimbuddy,
guan404ming,
jason810496,
pierrejeambrun,
rawwar,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
October 20, 2026 16:55
This branch has not been deployed
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
The pending partitioned Dag run detail response (
GET /ui/partitioned_dag_runs/{dag_id}/pending)carries two asset-bearing fields.
asset_expressionis scoped to the assets the caller may read;the sibling
assetsarray was not. The query that builds it(
routes/ui/partitioned_dag_runs.py) filters on nothing butDagScheduleAssetReference.dag_id,so every asset the Dag schedules on comes back with its full name and uri.
That makes one payload contradict itself — it can blank an asset inside the boolean tree while
spelling its name and uri out one key over:
{ "assets": [{"asset_id": 7, "asset_name": "sales_daily", "asset_uri": "s3://bucket/sales"}], "asset_expression": {"asset": {"group": "asset", "hidden": true, "id": null, "name": null, "uri": null}} }The route's own asset dependency does not close the gap:
requires_access_asset(method="GET")reads
asset_idfrom the path (core_api/security.py), and this route has none, so it asks thecoarse "may you read assets at all" question rather than "may you read asset #7".
Reachability is the same as for the expression redaction: with FAB or SimpleAuthManager every
asset id is authorized, so nothing changes in a stock deployment. The gap is reachable by a
third-party auth manager that implements per-asset
filter_authorized_assets.What
Backend —
airflow-core/src/airflow/api_fastapi/core_api/:datamodels/ui/partitioned_dag_runs.py:PartitionedDagRunAssetResponse.asset_id,.asset_nameand
.asset_uribecome nullable and ahiddenflag is added, mirroring the shaperedact_asset_expressionalready produces for the sibling field.routes/ui/partitioned_dag_runs.py: blanks those three fields and setshiddenfor an assetoutside
ReadableAssetsFilterDep. The redaction lands on the response only — the row is stillread in full, because the rollup mapper is keyed by the asset's real name and uri and the
received-key lookup by its real id.
readable_asset_idsis hoisted so theassetsloop and theasset_expressioncall share it; no extra query.Deliberately kept:
received_count,required_count,received_keysandrequired_keysof ablanked asset. They describe the Dag's own schedule, which a caller who reached this endpoint can
already read, and dropping them would leave a stuck run with no explanation at all. The run's
total_required/total_receivedtherefore stay accurate.Frontend —
airflow-core/src/airflow/ui/:src/components/AssetProgressCell.tsxrenders a lock icon and a muted "Hidden asset" label inplace of the asset link for a hidden asset, and drops hidden assets from the
eventslist itfeeds
AssetExpression(a blanked asset has no id to match an expression leaf on, and the leafit would have matched is redacted to
id: nullanyway).public/i18n/locales/en/common.json: addsexpression.hiddenAsset.Was generative AI tooling used to co-author this PR?