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

Rename TrustedProxyFilter class #2176

Open
jtuttle opened this issue May 17, 2021 · 1 comment
Open

Rename TrustedProxyFilter class #2176

jtuttle opened this issue May 17, 2021 · 1 comment

Comments

@jtuttle
Copy link
Member

jtuttle commented May 17, 2021

(copied over on behalf of Jonah):

I think the name TrustedProxyFilter is subtly inaccurate. A filter is something that takes a list, and returns a sublist (the filtered list) back.

In contrast, this (via the call method) takes a single IP and tells you if it's valid. It's essentially a big configurable function whose input is an IP and whose output is a boolean value. What would you name such a function?

Probably something like valid_ip?. However, since this is a class name (which can't end in ?) I'd consider something like class IsIpValid or class IsIpTrusted.

In client code:

is_trusted = IsIpTrusted.new(...)
if is_trusted(suspicious_ip)
   # etc....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants