Skip to content

feat: add support for reverse proxy header handling - #835

Draft
razvan wants to merge 13 commits into
mainfrom
feat/trusted-proxies
Draft

feat: add support for reverse proxy header handling#835
razvan wants to merge 13 commits into
mainfrom
feat/trusted-proxies

Conversation

@razvan

@razvan razvan commented Aug 5, 2026

Copy link
Copy Markdown
Member

Description

Fixes #816

Depends on the decision https://github.com/stackabletech/decisions/issues/93

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

razvan added 12 commits August 4, 2026 16:38
…le, and error causes

Reject CIDR entries with host bits set (e.g. 10.244.0.5/16), which uvicorn
silently treats as an opaque literal that matches no peer -- disabling proxy
trust entirely without any error. Also reject "*" combined with other
entries in the list, since uvicorn only always-trusts when the value is
exactly "*". Keep the underlying AddrParseError/ParseIntError as snafu
sources, correct the InvalidPrefixLength message for out-of-range values,
make proxy_headers_argument take &self instead of hard-coding Webserver,
and warn (not error) when trustedProxies is set on an Airflow 2.x cluster
where it has no effect.
The Pod-IP jsonpath example previously read as producing a CIDR, but Pod IPs
are host addresses, not network addresses -- following it literally could
produce a CIDR with host bits set, which is now rejected. Clarify that
entries must be network addresses or bare host IPs, state the
"* must be the only entry" rule, and note that an envOverrides override for
FORWARDED_ALLOW_IPS only takes effect while trustedProxies is non-empty.
Rust's u8::from_str accepts a leading '+' (e.g. "10.0.0.0/+16"), but
Python's ipaddress prefix parser used by uvicorn only accepts ASCII
digits. Such entries used to pass CRD validation but were silently
filed by uvicorn as dead literals matching no peer, disabling proxy
trust with no error anywhere -- exactly the failure class this type
exists to prevent.

Require the prefix-length substring to be a non-empty run of ASCII
digits before parsing, routed through the existing
InvalidPrefixLength error. As a side effect, "10.0.0.0/+0" now
reports an invalid prefix length instead of the misleading "did you
mean 0.0.0.0/0" host-bits suggestion. Leading zeros ("10.0.0.0/016")
remain accepted, matching Python's parser.

Also simplify masked_network to return IpAddr directly (the None
case was unreachable) and correct a comment that mischaracterized a
full-width shift guard as preventing undefined behaviour -- it's an
overflow panic in debug and a masked shift in release, not UB.
@razvan razvan self-assigned this Aug 5, 2026
@razvan razvan changed the title feat: add support for revere proxy header handling feat: add support for reverse proxy header handling Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

airflow api-server --proxy-headers flag not configurable without podOverrides

1 participant