Skip to content

Conversation

battermann
Copy link
Contributor

@battermann battermann commented Oct 1, 2025

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

Revert "Revert "WPB-20209 Forward IP address by federator (#4787)" (#4798)"

This reverts commit 2a308ce.
@battermann battermann marked this pull request as ready for review October 1, 2025 09:32
@battermann battermann requested review from a team as code owners October 1, 2025 09:32
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Oct 1, 2025
@battermann battermann requested a review from Copilot October 1, 2025 12:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements IP address forwarding from federator to backend components for federation requests. It extracts the remote peer IP address during federation communication and forwards it to upstream services for audit logging purposes.

  • Enhances federator to capture and forward remote IP addresses from federation connections
  • Updates cargohold's asset audit logging to include remote backend IP information
  • Adds nginx configuration to properly forward IP headers to upstream services

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/federator/src/Federator/Remote.hs Captures peer IP during HTTP2 connections and adds it to response headers
services/federator/src/Federator/ExternalServer.hs Extracts and forwards origin IP from request headers to upstream services
libs/wire-api-federation/src/Wire/API/Federation/Endpoint.hs Adds new header types and streaming endpoint with remote IP support
services/cargohold/src/CargoHold/API/AuditLog.hs Updates audit logging functions to include optional IP address parameter
services/cargohold/src/CargoHold/API/Federation.hs Modifies federation endpoints to handle and pass remote IP for audit logging
services/nginz/integration-test/conf/nginz/nginx.conf Adds IP normalization and forwarding configuration for test environment
charts/nginz/templates/conf/_nginx.conf.tpl Updates production nginx config to forward IP headers to upstreams
Comments suppressed due to low confidence (1)

services/federator/src/Federator/Remote.hs:1

  • The isDigit function is not in scope. You need to import Data.Char (isDigit) or use Data.Char.isDigit.
{-# LANGUAGE RecordWildCards #-}

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants