github-actions[bot] opened a new pull request, #71090: URL: https://github.com/apache/airflow/pull/71090
* Resolve backfill_id in the access dependency with the type the routes declare The backfill routes declare `backfill_id: NonNegativeInt`, but `requires_access_backfill` parsed the raw path value with `int()` and swallowed the failure. The two parsers do not agree: pydantic's lax mode validates "1.0" and "1.00" to 1, while `int()` rejects both. Dependencies resolve before the endpoint's own parameter validation, so for those spellings the dependency left the Dag unresolved on a request the handler then served against backfill 1 -- the two disagreed about which Dag the request concerned. Parse with the same TypeAdapter the routes declare so they cannot diverge. * Use spec'd mocks in the backfill authorization dependency test An unspecced Mock accepts any attribute, so the test would keep passing if the dependency started reading something the real Request, Session or Backfill does not have. * Point at the tracking issue for the unknown-backfill fallback A backfill_id that parses but matches no row falls through to the body's dag_id, so an unknown backfill answers 404 where an unauthorized one answers 403 and a caller can tell which ids exist. That is a separate fix from the parser divergence this change closes, and it has to keep the three body-authorized routes working, so it is tracked rather than folded in here. The comment above the adapter also loses the history that led to it; what matters going forward is the rule it states. (cherry picked from commit a6265b77cf57be4d59fd736cdc2554f94db9e2a2) Co-authored-by: Jarek Potiuk <[email protected]> -- 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]
