Skip to content

feat: ip-based verification#20

Merged
86667 merged 15 commits into
masterfrom
ip_verification
Apr 29, 2026
Merged

feat: ip-based verification#20
86667 merged 15 commits into
masterfrom
ip_verification

Conversation

@86667
Copy link
Copy Markdown
Contributor

@86667 86667 commented Mar 25, 2026

This PR contains a simply /ip_verification endpoint which creates users with ip-based rate limiting.

refactor

Alongside the added endpoint we also implement 2 refactors:

  • Use toml config for clear separation of services. If a service's config exists, it will be created. If not, it wont be created.
  • Improve IP extractor to correctly fallback to socket address and added config var to specify accepting of x-forwarded-for. (Suggested here)

Copy link
Copy Markdown
Collaborator

@SeverinAlexB SeverinAlexB left a comment

Choose a reason for hiding this comment

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

Not bad. Here are some findings:

Clean Code

I strongly recommend running my two clean-code/clean-refactor skills to find issues with the code structure on each PR:

Prompt:

I need to do a code review of this PR. Use /clean-code and /clean-refactor to review the code accordingly

This gives me the following report:
https://gist.github.com/SeverinAlexB/2b2acdf286407dbe5493fd7da641fdbf

I think point 1 to 4 are valid points of improvement (not all caused by you). Others are up to your judgement.

OpenAI

openapi.yaml needs updating

Comment thread src/infrastructure/config.rs Outdated
Comment thread src/infrastructure/config.rs Outdated
Comment thread src/infrastructure/http/extractors/request_origin.rs Outdated
Comment thread src/ip_verification/http.rs
Comment thread src/ip_verification/service.rs Outdated
Comment thread src/ip_verification/service.rs Outdated
@86667 86667 force-pushed the ip_verification branch from e3c3b04 to 345e50e Compare April 24, 2026 16:20
@86667 86667 marked this pull request as ready for review April 24, 2026 16:36
Comment thread src/infrastructure/config.rs
Copy link
Copy Markdown
Collaborator

@SeverinAlexB SeverinAlexB left a comment

Choose a reason for hiding this comment

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

A few remaining things, otherwise it is good to go

Comment thread src/infrastructure/http/extractors/request_origin.rs
Comment thread src/infrastructure/config.rs Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown
Collaborator

@SeverinAlexB SeverinAlexB left a comment

Choose a reason for hiding this comment

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

Let's go

@86667 86667 merged commit b4e7789 into master Apr 29, 2026
2 checks passed
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.

2 participants