Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use axum-client-ip to get the real client IP #240

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

geekbrother
Copy link
Contributor

Description

This PR adds using of axum-client-ip to get a real client IP which is included in the X-Forwarded by calling SecureClientIp. The AWS ELB uses X-Forwarded-for and SecureClientIp sourced it for a real IP.

Following changes are made:

  • axum-client-ip is added to the Cargo.toml as a dependency. We already have it as a relative dependency in the Cargo.lock so it will not add additional dependency weight.
  • ConnectInfo replaced with SecureClientIp.

Resolves #225

How Has This Been Tested?

Successfully built and run with analytics feature enabled.

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this Oct 6, 2023
@arein arein added the accepted The issue has been accepted into the project label Oct 6, 2023
@geekbrother geekbrother marked this pull request as ready for review October 6, 2023 22:02
@geekbrother geekbrother requested review from xav and arein October 6, 2023 22:02
Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

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

LGTM

@arein
Copy link
Member

arein commented Oct 6, 2023

Nice vendor agnostic solution!

src/lib.rs Outdated Show resolved Hide resolved
@chris13524 chris13524 removed their request for review October 8, 2023 13:43
@geekbrother geekbrother merged commit 591effe into main Oct 9, 2023
4 checks passed
@chris13524 chris13524 deleted the max/fix/geoip_grey_ip_errors branch October 9, 2023 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been accepted into the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: geoip lookup errors for the grey IP networks
3 participants