Validation of IP/range in forms
When dealing with lots of IP, IP ranges, etc., it will be great to have some validation (some forms.widget or just a regex expression) to attach to IP form fields.
Blueprint information
- Status:
- Complete
- Approver:
- Devin Carlen
- Priority:
- Medium
- Drafter:
- Tihomir Trifonov
- Direction:
- Approved
- Assignee:
- Tihomir Trifonov
- Definition:
- Approved
- Series goal:
- Accepted for folsom
- Implementation:
- Implemented
- Milestone target:
- 2012.2
- Started by
- Gabriel Hurley
- Completed by
- Devin Carlen
Related branches
Related bugs
Sprints
Whiteboard
The idea behind this blueprint is to have some universal class to handle different kind of IP addresses, entered through web forms. In general, we will need of the following validations:
1. IPv4 - e.g. 10.10.10.10
2. IPv6 - e.g. fe80::204, fe80:0:
3. Subnet/mask - 10.10.10.10/24, fe80::204/16
4. Subnet ranges - i.e. if we want to limit only to certain class of network (B, C ..)
5. Allowing more flexible input from users(no matter what the user inputs, as long as it is a valid value - it will be passed through in its full form):
a) short CIDR notation forms - e.g. 10/8 instead of 10.0.0.0/8.
b) Skipping subnet mask will default to max mask - e.g. 10.0.0.1 will be automatically converted to 10.0.0.1/32, fe80::0 will become fe80::0/128.
Gerrit topic: https:/
Addressed by: https:/
Implementation of bp/ip-validation
Work Items
Work items:
[ttrifonov] First draft: INPROGRESS
[ttrifonov] New review uploaded - using netaddr: INPROGRESS