Repository navigation
Separate JWT secret env var from the standard Airflow environment helper - #70896
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
`AIRFLOW__API_AUTH__JWT_SECRET` was rendered from inside `standard_airflow_environment` behind an `IncludeJwtSecret` flag, so every component had to opt out of it explicitly with `(merge (dict "IncludeJwtSecret" false) .)`. Move the variable into its own `jwt_secret_environment` helper, following the shape of the existing `keda_airflow_environment` helper, and include it only in the API server and scheduler containers that need it. Every other caller of `standard_airflow_environment` passes a plain context again, and the `IncludeJwtSecret` context mutation is gone. No behavioural change: the same containers receive the same variable, still gated on `enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET`, preserving the least-privilege exposure introduced in apache#63204. Only the position of the variable within the rendered env list changes, so the ordered assertion in `test_have_all_variables` is updated to match. Closes: apache#70843
2b3c9ac to
5609a83
Compare
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
|
Congrats and welcome to the community! |
Backport failed to create: chart/v1-2x-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 562cc3e chart/v1-2x-testThis should apply the commit to the chart/v1-2x-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
|
@rohan9446, could you create manual backport of it to |
|
Thanks @Miretpl! Backport is up: #71129 The automated one failed because |
…low environment helper (#70896) (#71129) `AIRFLOW__API_AUTH__JWT_SECRET` was rendered from inside `standard_airflow_environment` behind an `IncludeJwtSecret` flag, so every component had to opt out of it explicitly with `(merge (dict "IncludeJwtSecret" false) .)`. Move the variable into its own `jwt_secret_environment` helper, following the shape of the existing `keda_airflow_environment` helper, and include it only in the API server and scheduler containers that need it. Every other caller of `standard_airflow_environment` passes a plain context again, and the `IncludeJwtSecret` context mutation is gone. No behavioural change: the same containers receive the same variable, still gated on `enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET`, preserving the least-privilege exposure introduced in #63204. Only the position of the variable within the rendered env list changes, so the ordered assertion in `test_have_all_variables` is updated to match. Closes: #70843 (cherry picked from commit 562cc3e) Co-authored-by: rohan9446 <bandaru04052004@gmail.com>
…per (apache#70896) `AIRFLOW__API_AUTH__JWT_SECRET` was rendered from inside `standard_airflow_environment` behind an `IncludeJwtSecret` flag, so every component had to opt out of it explicitly with `(merge (dict "IncludeJwtSecret" false) .)`. Move the variable into its own `jwt_secret_environment` helper, following the shape of the existing `keda_airflow_environment` helper, and include it only in the API server and scheduler containers that need it. Every other caller of `standard_airflow_environment` passes a plain context again, and the `IncludeJwtSecret` context mutation is gone. No behavioural change: the same containers receive the same variable, still gated on `enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET`, preserving the least-privilege exposure introduced in apache#63204. Only the position of the variable within the rendered env list changes, so the ordered assertion in `test_have_all_variables` is updated to match. Closes: apache#70843 Co-authored-by: rohan9446 <bandaru04052004@gmail.com>
…per (apache#70896) `AIRFLOW__API_AUTH__JWT_SECRET` was rendered from inside `standard_airflow_environment` behind an `IncludeJwtSecret` flag, so every component had to opt out of it explicitly with `(merge (dict "IncludeJwtSecret" false) .)`. Move the variable into its own `jwt_secret_environment` helper, following the shape of the existing `keda_airflow_environment` helper, and include it only in the API server and scheduler containers that need it. Every other caller of `standard_airflow_environment` passes a plain context again, and the `IncludeJwtSecret` context mutation is gone. No behavioural change: the same containers receive the same variable, still gated on `enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET`, preserving the least-privilege exposure introduced in apache#63204. Only the position of the variable within the rendered env list changes, so the ordered assertion in `test_have_all_variables` is updated to match. Closes: apache#70843 Co-authored-by: rohan9446 <bandaru04052004@gmail.com>
AIRFLOW__API_AUTH__JWT_SECRETwas rendered from inside thestandard_airflow_environmenthelper behind anIncludeJwtSecretflag, whichmeant every component had to opt out of it explicitly with
(merge (dict "IncludeJwtSecret" false) .).This moves the variable into its own
jwt_secret_environmenthelper, followingthe shape of the existing
keda_airflow_environmenthelper, and includes itonly in the two containers that actually need it — the API server and the
scheduler. Every other caller of
standard_airflow_environmentpasses a plaincontext again, and the
IncludeJwtSecretcontext mutation is gone entirely.What this changes:
IncludeJwtSecretplumbing fromstandard_airflow_environmentand from all ten call sites.
rather than implicit in a shared helper.
containers, workers, the triggerer and the DAG processor still do not receive
the raw signing secret.
scheduler containers exactly once, and never in sidecars or init containers.
No behavioural change: the same containers receive the same variable, still
gated on
enableBuiltInSecretEnvVars.AIRFLOW__API_AUTH__JWT_SECRET. The onlydifference in rendered output is the position of the variable within the env
list, so the ordered assertion in
test_have_all_variablesis updated to match.Tested locally with helm v3.21.3:
pytest chart/tests/helm_tests/→ 2108 passed.closes: #70843
Was generative AI tooling used to co-author this PR?
Generated-by: Claude (Cowork) following the guidelines