Nebo15 / annon.api

Configurable API gateway that acts as a reverse proxy with a plugin system.
http://docs.annon.apiary.io/
MIT License
332 stars 26 forks source link

IP Restriction plugin: support range IP format #264

Open gmile opened 7 years ago

gmile commented 7 years ago

It would be useful to support IP format with network mask like this:

gmile commented 7 years ago

@AndrewDryga this was done in a fork, https://github.com/edenlabllc/annon.api/pull/3. Maybe it can get merged upstream too? Here's the patch you can apply manually: https://github.com/edenlabllc/annon.api/pull/3.patch

I stumbled upon the fact that we supported 127.0.*.1 format. I didn't rip it off. But I think mask format will cover the case when someone wants to provide a range of IPs. Also, mask format is used in kong – https://getkong.org/plugins/ip-restriction/.