Skip to content

Add scoped Execution API access for Dag processors - #74370

Merged
ephraimbuddy merged 6 commits into
apache:mainfrom
astronomer:dag-processor-api-foundation
Oct 14, 2026
Merged

ephraimbuddy merged 6 commits into
apache:mainfrom
astronomer:dag-processor-api-foundation

Conversation

@ephraimbuddy

Copy link
Copy Markdown
Contributor

Give Dag processors scoped access to the Execution API without giving them the API signing key. Trusted provisioning issues a bundle-scoped session token, registration exchanges it for a Job credential, and the processor exchanges that credential for individual parsing-attempt tokens.

This PR provides Job registration, heartbeat and completion, credential renewal, bundle/team authorization, and the processor-side HTTP client. It also adds the Job identity migration and versioned API contracts.

This is the foundation for #74233, which adds the processor integration, result publication and deployment support. The normal airflow dag-processor command keeps its existing behavior in this PR.


Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-6)

Generated-by: Codex (GPT-6) following the guidelines

Comment thread airflow-core/docs/security/jwt_token_authentication.rst Outdated

@ashb ashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Only skimmed first 25% of PR so far)

Comment thread airflow-core/src/airflow/api_fastapi/execution_api/dag_processor_tokens.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/execution_api/datamodels/token.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/execution_api/datamodels/token.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/execution_api/routes/jobs.py Outdated

@kaxil kaxil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. I would sort out the rotator restart (dag_processor_token_command.py L67) before #74233 lands, and the naming question on routes/jobs.py before the 0143 migration goes out in a release. The rest are small.

Comment thread airflow-core/src/airflow/cli/commands/dag_processor_token_command.py Outdated
Comment thread airflow-core/src/airflow/cli/commands/dag_processor_token_command.py Outdated
Comment thread airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_jobs.py Outdated
Comment thread airflow-core/src/airflow/dag_processing/api_client.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/execution_api/AGENTS.md Outdated
Comment thread airflow-core/src/airflow/api_fastapi/execution_api/app.py Outdated
Comment thread airflow-core/src/airflow/jobs/job.py Outdated
Comment thread airflow-core/tests/unit/dag_processing/test_api_client.py
@ephraimbuddy

Copy link
Copy Markdown
Contributor Author

Please don't merge until main is 3.5.0

@ashb ashb changed the title Add scoped Execution API access for Dag processors 🚧 Add scoped Execution API access for Dag processors Oct 9, 2026
@kaxil kaxil added this to the Airflow 3.5.0 milestone Oct 9, 2026
@ephraimbuddy
ephraimbuddy force-pushed the dag-processor-api-foundation branch from 7f41241 to 3a7e258 Compare October 12, 2026 13:41
@ephraimbuddy ephraimbuddy changed the title 🚧 Add scoped Execution API access for Dag processors Add scoped Execution API access for Dag processors Oct 14, 2026
Dag processors need credentials tied to their registered Job and granted bundles before they can communicate with a remote Execution API. Keep this foundation independently reviewable while the processor command retains its existing database-backed behavior.
The heading warning prevents the security documentation from building successfully.
New Dags can query execution state while parsing, before they have a DagModel row. Rejecting those requests prevents their initial parse from completing.
Task and processor credentials need distinct validation so task-only routes cannot receive processor identities. Expired provisioning credentials must not leave a registered Job behind, while trusted in-process task identities must remain usable without JWT expiry.
Provisioner restarts and transient write failures must not interrupt running processors. Failed registration must not leave an incomplete Job that a retry can adopt.
Slow CI responses can exceed the best-effort renewal deadline, while the authentication guidance must reflect the scoped Execution API contract.
@ephraimbuddy
ephraimbuddy force-pushed the dag-processor-api-foundation branch from 3a7e258 to c0699b3 Compare October 14, 2026 06:42
@ephraimbuddy
ephraimbuddy merged commit a73ffae into apache:main Oct 14, 2026
108 checks passed
@ephraimbuddy
ephraimbuddy deleted the dag-processor-api-foundation branch October 14, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants