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.
henry3260
marked this pull request as ready for review
October 20, 2026 09:12
henry3260
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
October 20, 2026 09:12
1 task done
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
next_run_assetsscopes the asset scheduling expression it serves to the caller: anassetleaf whoseid the caller may not read keeps its place in the boolean tree, so the shape of the schedule stays
honest, but its
uri,nameandidare blanked andhiddenis set (#72864). The UI dependenciesgraph followed the same rule (#73008).
Four endpoints still served
DagModel.asset_expressionverbatim:GET /api/v2/dags/{dag_id}/detailsGETonlycurl— no UI neededGET /ui/dagsGETonlyGET /ui/partitioned_dag_runsGET, all-or-nothingGET /ui/pending_partitioned_dag_run/{dag_id}GETDag access and asset access are separate resources in the auth manager (
is_authorized_dagvsis_authorized_asset, withfilter_authorized_assetsas the batch API), and Dag source code is aseparate access entity again (
DagAccessEntity.CODE), so a caller holding DagGETis not entitled tothe identity of the assets that Dag waits on. Asset names and uris commonly encode bucket, table or
dataset names, which is why the rest of the asset API already scopes them.
Reachability is the same as for the endpoints already fixed: the FAB auth manager returns every asset
id and the simple auth manager grants all or nothing above its lowest role, so nothing is redacted
there. Deployments whose auth manager authorizes assets individually are the ones affected.
What
routes/public/dags.py—get_dag_detailstakesReadableAssetsFilterDepand redacts theexpression on the response. The redaction deliberately does not touch
dag_model: that is a liveORM instance whose session commits when the request ends, so assigning the blanked leaves onto it
would persist them.
datamodels/common.py— newvalidate_asset_expression. FastAPI does not validate the nestedmodels of an already-built response, so an expression rewritten after
model_validatehas to bevalidated explicitly; without it the rewritten tree bypasses
MaybeAssetExpressionand a legacystored shape would reach the client verbatim instead of as
null.routes/ui/dags.py— the Dag-list builder redacts each Dag's expression. The readable-asset id setis resolved once per request, not per Dag.
routes/ui/partitioned_dag_runs.py— both endpoints redact (the collection's per-Dagasset_expressionsmap and the detail's singleasset_expression).back blanked with
hidden. All four fail againstmain. The Dag details test also asserts thestored expression is unchanged after the request, which is what pins the ORM caveat above. Two
query-count assertions in the partitioned tests move up by the one
AssetModel.idselect the newdependency adds, and the comment enumerating them is updated.
related: #72864, #73008
Was generative AI tooling used to co-author this PR?