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

Added as simple callback with the filter object so it can be dynamically changed #85

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

shmul
Copy link

@shmul shmul commented Aug 16, 2023

Hi,

I noticed that the implementation of the ipfilter middleware, while very useful, lacks the option to dynamically control the filter object. This is a desirable functionality that enables a running service to blacklist a network address based on whatever logic (for example, using some IP blocklist).
I added a simple mechanism for the caller to get hold of the filter object after it is created. Then, the underlying implementation allows for changing it during runtime.

I hope you'll find it useful to add to your implementation.

Cheers,
Shmul

@shmul shmul requested a review from crazy-max as a code owner August 16, 2023 16:24
@crazy-max
Copy link
Owner

SGTM, can you add a basic test please? Thx!

@shmul
Copy link
Author

shmul commented Aug 16, 2023

SGTM, can you add a basic test please? Thx!

sure. added

Copy link
Owner

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@crazy-max crazy-max merged commit fc52437 into crazy-max:master Aug 16, 2023
5 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.

3 participants