Skip to content

fix(middleware): do not build the XFF middleware without trusted proxies - #3937

Merged
butonic merged 1 commit into
mainfrom
fix/client-ip-no-trusted-proxies
Nov 10, 2026
Merged

butonic merged 1 commit into
mainfrom
fix/client-ip-no-trusted-proxies

Conversation

@butonic

@butonic butonic commented Nov 10, 2026

Copy link
Copy Markdown
Member

Starting with chi v5.4.0, ClientIPFromXFF panics when it gets no trusted prefix. ClientIP always built it, so once chi is bumped, the proxy and collaboration services crash at startup when no trusted proxies are configured. TestClientIPWithoutTrustedProxies catches it.

Without trusted proxies every request already took the network address path, so ClientIP now returns ClientIPFromRemoteAddr in that case and skips the header middlewares entirely.

reva main already requires chi v5.4.0, so this has to land before the next reva bump. It showed up in #3934.

Assisted by Claude Code (claude-opus-5-5): it traced the unit test failure to the chi bump, wrote the change and this description.

Starting with chi v5.4.0, ClientIPFromXFF panics when no trusted prefix
is given, so ClientIP would crash the proxy and collaboration services at
startup when no trusted proxies are configured. Without trusted proxies
every request uses the network address anyway, so return
ClientIPFromRemoteAddr.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@codacy-production

codacy-production Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.01% coverage variation

Metric Results
Coverage variation ✅ +0.01% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a7970e7) 93579 26829 28.67%
Head commit (73bfeb0) 93584 (+5) 26844 (+15) 28.68% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3937) 5 5 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@butonic
butonic requested a review from micbar November 10, 2026 12:03
@butonic butonic self-assigned this Nov 10, 2026
@butonic
butonic merged commit 39493c1 into main Nov 10, 2026
62 checks passed
@butonic
butonic deleted the fix/client-ip-no-trusted-proxies branch November 10, 2026 16:24
@openclouders openclouders mentioned this pull request Nov 10, 2026
butonic added a commit that referenced this pull request Nov 11, 2026
Brings in opencloud-eu/reva#986: storage
drivers return typed results from write operations and the events
middleware reads the space owner, deleted ids and final space members
from those instead of a context channel and response opaques. Setting a
new space image now also deletes the old one.

chi, validator, go-jose, go-urn and locales are bumped to the minimum
versions reva main requires. The chi v5.4.0 ClientIP panic is already
fixed on main by #3937

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants