Add IP Whitelist Plugin and corresponding tests
- Introduced `IpWhitelistPlugin` (DOMAIN): Restricts access to specific IP addresses or CIDR ranges. - Added configuration options: `enabled`, `allowed_ips`, and `status_code`. - Updated `plugins.md` and `plugin-development.md` to document `IpWhitelistPlugin`. - Created fixtures for `services-with-ip-whitelist`. - Added extensive test cases for `IpWhitelistPlugin` to validate configuration and HAProxy output generation. - Ensured seamless integration into the plugin framework alongside other domain plugins.
This commit is contained in:
parent
91f8ff5d08
commit
57387f3e32
5 changed files with 1549 additions and 428 deletions
10
src/tests/fixtures/services-with-ip-whitelist
vendored
Normal file
10
src/tests/fixtures/services-with-ip-whitelist
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"192.168.1.40": {
|
||||
"easyhaproxy.http.host": "secure.example.com",
|
||||
"easyhaproxy.http.port": "80",
|
||||
"easyhaproxy.http.localport": "8080",
|
||||
"easyhaproxy.http.plugins": "ip_whitelist",
|
||||
"easyhaproxy.http.plugin.ip_whitelist.allowed_ips": "192.168.1.0/24,10.0.0.5",
|
||||
"easyhaproxy.http.plugin.ip_whitelist.status_code": "403"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue