Repository navigation
Conversation
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
6701c49 to
663b67f
Compare
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
7b846d1 to
28ea2c6
Compare
I feel like it's going nowhere... Backend logic is messy and unclear, buffers are needlessly kept alive, borrowing subsets of the HTTP session is harder and harder, reseting default answers request is way too hard for what it's worth (it's probably broken right now), gauges are desynched and we are cloning again and again String ids... Signed-off-by: Eloi DEMOLIS <[email protected]>
28ea2c6 to
33513c4
Compare
Signed-off-by: Eloi DEMOLIS <[email protected]>
- Fix non idempotent connect_to_backend (probably suboptimal) - Explicitely exclude body when no length info is received, add a `Content-Length: 0` to avoid message smuggling (may break some apps?) Signed-off-by: Eloi DEMOLIS <[email protected]>
- Use Sha256 hashes - Add WWW_AUTHENTICATE variable to 401 templates Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
- set default frontend rule position to TREE for config - remove debug warnings - apply clippy suggestions Signed-off-by: Eloi DEMOLIS <[email protected]>
- Move tags from L7 listeners to L7 frontends - Keep tags on L4 listeners assuming a single frontend Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
- fix path regex captures indexes - replace missing optional captures by empty string (instead of panic) - skip first dot in host subdomain regex - force full match on host regex - use cluster https port for custom https redirections - add a config to test regex rewrites Signed-off-by: Eloi DEMOLIS <[email protected]>
7a10d20 to
448ece3
Compare
|
Closing as superseded by the unified-mux re-implementation that landed on Where the proposal landed on
|
Four gaps identified after the redirect/rewrite/answer-template/auth stack landed on `main`. PR #1162 ("Redirection and URL rewrite", @Wonshtrum, base `main`) is structurally superseded by the unified mux implementation but its last commit `448ece33 Rewriting fixes` carried two genuine correctness fixes that did not make it to `main`. The clusterless-redirect ordering bug and the doc/code drift on `%STATUS_CODE` are independent gaps surfaced by the same review pass. * Clusterless `RedirectPolicy::Permanent` now reachable. In `lib/src/protocol/mux/router.rs::route_from_request` the `RedirectPolicy::Permanent` branch is moved ahead of the `Unauthorized || cluster_id.is_none()` deny, so a frontend declared with `redirect = permanent` and no backing cluster (the canonical "this hostname has moved, no service remains" shape from #1161) emits 301 instead of 401. The `Permanent` block does not read `cluster_id`; the cluster-derived knobs already default to safe sentinels at the cluster lookup when `cluster_id` is `None`. The `let Some(cluster_id) = cluster_id else { unreachable!() }` binding moves below the deny block; its invariant still holds. * Non-trie host regex anchored at both ends. In `lib/src/router/mod.rs::convert_regex_domain_rule` the compiled regex now opens with `\A` and closes with `\z`. Without anchors, `Regex::is_match` is unanchored, so an operator's `/example\.com/` matched any hostname containing `example.com` as a substring, including `attacker.example.com.evil.org` — letting an attacker-controlled domain reach a frontend that should only serve `example.com` (CWE-1023, routing bypass). The trie path (`lib/src/router/pattern_trie.rs`) was already anchored. * Inner `/`-finding loop terminates on first match. Same function; the inner loop now `break`s after `found = true`, so a multi-segment regex hostname like `/seg1/.foo./seg2/.com` no longer overwrites `index` on every later `/` and the literal `.` separators between regex segments are kept in their correct position (`\Aseg1\.foo\.seg2\.com\z`). * `%STATUS_CODE` doc/code drift removed. The placeholder was advertised in `doc/configure.md`, the `redirect-template` CLI help in `bin/src/cli.rs`, and the `redirect_template` doc comments in `command/src/command.proto` and `command/src/config.rs`, but `lib/src/protocol/kawa_h1/answers.rs::HttpAnswers::template` never defined a `STATUS_CODE` variable. References are stripped so operators no longer see a promised variable that silently no-ops. Implementation deferred to the same change that adds 302/308 for #1009. Tests: `convert_regex` (updated for the anchored shape) plus three new unit / e2e regressions — `regex_domain_rule_rejects_suffix_and_prefix`, `regex_domain_rule_multi_segment_segments_are_isolated`, and `try_clusterless_permanent_redirect_emits_301` (asserts 301 + Location on the rewritten host). Closes parts of #1161 (proposal — clusterless permanent redirect was the last reachable gap) and #1154 (modify Host header — already addressed by `rewrite_host`, now closeable). Leaves #1009 partially open: 302 (`Temporary`) and 308 are still missing on `main`. Validation: * cargo build --all-features --locked * cargo clippy --all-targets --locked * cargo +nightly fmt --all -- --check * cargo test --workspace --locked (955 passed, 7 ignored) * cargo test -p sozu-e2e -- redirect (19 passed) Signed-off-by: Florentin Dubois <[email protected]>
The CHANGELOG previously carried three concurrent Unreleased blocks — `## [Unreleased]` (main-scoped post-1.1.1 fixes from PRs #1162, #1191, #1192, #1193, #1194, #1196, #1202, #1223), `## feat/answer-templates-rewrite-auth - Unreleased` (answer templates, URL rewrite, basic auth), and `## feat/h2-mux - Unreleased` (the H2 multiplexer rewrite from PR #1209). All three feature stacks are on `main`; the per-branch dividers were release- engineering staging that no longer reflects current state. Changes: - Drop the `## feat/answer-templates-rewrite-auth - Unreleased` and `## feat/h2-mux - Unreleased` dividers; their bodies now appear under `## [Unreleased]` with provenance markers (`### Added — Answer templates / ...`, `### Added — H2 multiplexer (PR #1209)`). - Promote the breaking changes (proto-tag renumbers, dashboard metric renames, `http.errors` labelling, pattern-trie regex anchoring, empty-val del-header semantic, sub-16393 `buffer_size` rejection, cipher-list constant rename) to a top-level `### Breaking changes (v1.1.x → v2.0.0)` paragraph at the top of the section so operators see them first. - Drop emoji from top-level subheaders (🌟 → Added, 🔄 → Changed, ⛑️ → Fixed, ✍️ → Changed, 📚 → Documentation, 🤖 → CI,⚠️ → Behaviour-affecting). Per- commit-log subsection at depth ≥ 4 keeps minor emoji ornaments where they don't conflict with Keep-a-Changelog vocabulary. - Preserve historical release entries (`## 1.1.1`, `## 1.1.0`, …) verbatim; they are released and immutable. Net effect: a single `## [Unreleased]` block ready for the v2.0.0 release-cut in §3.4.c of `tasks/todo.md`. Future passes can de-duplicate the multiple `### Added`/`### Changed`/`### Fixed` sub-blocks into one each per Keep-a-Changelog strict shape; this commit is the structural collapse only. Refs: tasks/todo.md §3.1.a; codex M12 amendment (3-way not 2-way collapse). Signed-off-by: Florentin Dubois <[email protected]>
Four gaps identified after the redirect/rewrite/answer-template/auth stack landed on `main`. PR sozu-proxy#1162 ("Redirection and URL rewrite", @Wonshtrum, base `main`) is structurally superseded by the unified mux implementation but its last commit `448ece33 Rewriting fixes` carried two genuine correctness fixes that did not make it to `main`. The clusterless-redirect ordering bug and the doc/code drift on `%STATUS_CODE` are independent gaps surfaced by the same review pass. * Clusterless `RedirectPolicy::Permanent` now reachable. In `lib/src/protocol/mux/router.rs::route_from_request` the `RedirectPolicy::Permanent` branch is moved ahead of the `Unauthorized || cluster_id.is_none()` deny, so a frontend declared with `redirect = permanent` and no backing cluster (the canonical "this hostname has moved, no service remains" shape from sozu-proxy#1161) emits 301 instead of 401. The `Permanent` block does not read `cluster_id`; the cluster-derived knobs already default to safe sentinels at the cluster lookup when `cluster_id` is `None`. The `let Some(cluster_id) = cluster_id else { unreachable!() }` binding moves below the deny block; its invariant still holds. * Non-trie host regex anchored at both ends. In `lib/src/router/mod.rs::convert_regex_domain_rule` the compiled regex now opens with `\A` and closes with `\z`. Without anchors, `Regex::is_match` is unanchored, so an operator's `/example\.com/` matched any hostname containing `example.com` as a substring, including `attacker.example.com.evil.org` — letting an attacker-controlled domain reach a frontend that should only serve `example.com` (CWE-1023, routing bypass). The trie path (`lib/src/router/pattern_trie.rs`) was already anchored. * Inner `/`-finding loop terminates on first match. Same function; the inner loop now `break`s after `found = true`, so a multi-segment regex hostname like `/seg1/.foo./seg2/.com` no longer overwrites `index` on every later `/` and the literal `.` separators between regex segments are kept in their correct position (`\Aseg1\.foo\.seg2\.com\z`). * `%STATUS_CODE` doc/code drift removed. The placeholder was advertised in `doc/configure.md`, the `redirect-template` CLI help in `bin/src/cli.rs`, and the `redirect_template` doc comments in `command/src/command.proto` and `command/src/config.rs`, but `lib/src/protocol/kawa_h1/answers.rs::HttpAnswers::template` never defined a `STATUS_CODE` variable. References are stripped so operators no longer see a promised variable that silently no-ops. Implementation deferred to the same change that adds 302/308 for sozu-proxy#1009. Tests: `convert_regex` (updated for the anchored shape) plus three new unit / e2e regressions — `regex_domain_rule_rejects_suffix_and_prefix`, `regex_domain_rule_multi_segment_segments_are_isolated`, and `try_clusterless_permanent_redirect_emits_301` (asserts 301 + Location on the rewritten host). Closes parts of sozu-proxy#1161 (proposal — clusterless permanent redirect was the last reachable gap) and sozu-proxy#1154 (modify Host header — already addressed by `rewrite_host`, now closeable). Leaves sozu-proxy#1009 partially open: 302 (`Temporary`) and 308 are still missing on `main`. Validation: * cargo build --all-features --locked * cargo clippy --all-targets --locked * cargo +nightly fmt --all -- --check * cargo test --workspace --locked (955 passed, 7 ignored) * cargo test -p sozu-e2e -- redirect (19 passed) Signed-off-by: Florentin Dubois <[email protected]> Co-authored-by: Eloi Démolis <[email protected]> Co-authored-by: hcaumeil <[email protected]>
The CHANGELOG previously carried three concurrent Unreleased blocks — `## [Unreleased]` (main-scoped post-1.1.1 fixes from PRs sozu-proxy#1162, sozu-proxy#1191, sozu-proxy#1192, sozu-proxy#1193, sozu-proxy#1194, sozu-proxy#1196, sozu-proxy#1202, sozu-proxy#1223), `## feat/answer-templates-rewrite-auth - Unreleased` (answer templates, URL rewrite, basic auth), and `## feat/h2-mux - Unreleased` (the H2 multiplexer rewrite from PR sozu-proxy#1209). All three feature stacks are on `main`; the per-branch dividers were release- engineering staging that no longer reflects current state. Changes: - Drop the `## feat/answer-templates-rewrite-auth - Unreleased` and `## feat/h2-mux - Unreleased` dividers; their bodies now appear under `## [Unreleased]` with provenance markers (`### Added — Answer templates / ...`, `### Added — H2 multiplexer (PR sozu-proxy#1209)`). - Promote the breaking changes (proto-tag renumbers, dashboard metric renames, `http.errors` labelling, pattern-trie regex anchoring, empty-val del-header semantic, sub-16393 `buffer_size` rejection, cipher-list constant rename) to a top-level `### Breaking changes (v1.1.x → v2.0.0)` paragraph at the top of the section so operators see them first. - Drop emoji from top-level subheaders (🌟 → Added, 🔄 → Changed, ⛑️ → Fixed, ✍️ → Changed, 📚 → Documentation, 🤖 → CI,⚠️ → Behaviour-affecting). Per- commit-log subsection at depth ≥ 4 keeps minor emoji ornaments where they don't conflict with Keep-a-Changelog vocabulary. - Preserve historical release entries (`## 1.1.1`, `## 1.1.0`, …) verbatim; they are released and immutable. Net effect: a single `## [Unreleased]` block ready for the v2.0.0 release-cut in §3.4.c of `tasks/todo.md`. Future passes can de-duplicate the multiple `### Added`/`### Changed`/`### Fixed` sub-blocks into one each per Keep-a-Changelog strict shape; this commit is the structural collapse only. Refs: tasks/todo.md §3.1.a; codex M12 amendment (3-way not 2-way collapse). Signed-off-by: Florentin Dubois <[email protected]>
Implement redirections and URL rewrite proposal of #1161.