Support IP CIDR masks in allowed IPs

Created on 7 January 2019, over 5 years ago
Updated 23 May 2023, about 1 year ago

Problem/Motivation

I'm trying out Warden against a site that is running behind Cloudflare. As such, the allowed IPs need to match Cloudflare's range of IPs, but the existing code does an exact match against a list of individual IPs.

Proposed resolution

I've attached a patch that uses Symfony's http-foundation to support masks, which has sorted things out for me. It's just a quick patch without taking the service and DI approach, and I'll also add that it could be tidied a bit further, since the checkIp function accepts a list of IPs / subnets to check against.

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom BryanGullan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024