Skip to content

Better logic for determining client IP addresses from incoming requests.#2477

Open
zyro wants to merge 5 commits intomasterfrom
aim-ip-check-fix
Open

Better logic for determining client IP addresses from incoming requests.#2477
zyro wants to merge 5 commits intomasterfrom
aim-ip-check-fix

Conversation

@zyro
Copy link
Member

@zyro zyro commented Mar 18, 2026

No description provided.

Copy link

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 aims to improve how the server determines and records the client IP address from inbound HTTP/gRPC requests (especially when behind proxies), and reduces noisy logging when storage operations are canceled via context.

Changes:

  • Update client address extraction to consider multiple candidate addresses (e.g., X-Forwarded-For lists) and attempt to skip loopback proxy addresses.
  • Suppress storage read error logs when the underlying error is context.Canceled.
  • Document both changes in the Unreleased changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
server/api.go Reworks client IP/port extraction logic from request/context sources.
server/core_storage.go Avoids logging storage read errors when the context is canceled.
CHANGELOG.md Notes the changed IP extraction behavior and the storage logging fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

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 refines server-side request handling by improving client IP extraction logic (used for tracing/metrics/auditing) and reducing noisy logging on canceled storage operations.

Changes:

  • Update client address extraction to consider multiple X-Forwarded-For / peer candidates and skip loopback proxy addresses.
  • Suppress error logging for context.Canceled during storage object reads.
  • Document both changes in the unreleased changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
server/api.go Reworks client IP/port extraction to process multiple candidate addresses rather than a single value.
server/core_storage.go Avoids logging expected context.Canceled errors when iterating storage read rows.
CHANGELOG.md Adds entries describing the client IP logic change and cancellation log noise reduction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

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

Updates request/client address extraction to better handle multi-hop forwarding headers and reduces noise from expected cancellation errors during storage reads.

Changes:

  • Update client IP/port extraction to consider multiple X-Forwarded-For candidates and skip empty/loopback entries.
  • Suppress error logs for context.Canceled during storage object reads.
  • Document both changes in the Unreleased changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
server/api.go Reworks client address extraction from context/request headers and peer/RemoteAddr.
server/core_storage.go Avoids logging expected context-cancellation errors from rows.Err().
CHANGELOG.md Notes the updated client IP logic and storage cancellation logging change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

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 refines how the server determines the client IP/port for incoming gRPC/HTTP requests and reduces noisy logging when storage reads are canceled, with corresponding changelog updates.

Changes:

  • Update client address extraction to consider multiple candidate addresses (e.g., X-Forwarded-For chain) rather than a single value.
  • Suppress storage read error logs when the operation ends due to context.Canceled.
  • Document both changes in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
server/api.go Reworks client IP/port extraction from request/context metadata using a candidate-address list.
server/core_storage.go Avoids logging for context-canceled storage read operations.
CHANGELOG.md Adds entries describing the updated client IP logic and reduced cancellation logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

3 participants