mirror of
https://github.com/fuckpiracyshield/data-model.git
synced 2024-05-19 21:46:18 +02:00
34 lines
841 B
Python
34 lines
841 B
Python
from piracyshield_component.validation.rules.required import Required
|
|
from piracyshield_component.validation.rules.string import String
|
|
from piracyshield_component.validation.rules.length import Length
|
|
from piracyshield_component.validation.rules.as_code import ASCode
|
|
from piracyshield_component.validation.rules.cidr_syntax_ipv4 import CIDRSyntaxIPv4
|
|
from piracyshield_component.validation.rules.cidr_syntax_ipv6 import CIDRSyntaxIPv6
|
|
|
|
class WhitelistRule:
|
|
|
|
"""
|
|
Set of rules for new whitelist items.
|
|
"""
|
|
|
|
REGISTRAR = [
|
|
Required(),
|
|
String(allowed = ' .,-_'),
|
|
Length(minimum = 3, maximum = 255)
|
|
]
|
|
|
|
AS_CODE = [
|
|
Required(),
|
|
ASCode()
|
|
]
|
|
|
|
CIDR_IPV4 = [
|
|
Required(),
|
|
CIDRSyntaxIPv4()
|
|
]
|
|
|
|
CIDR_IPV6 = [
|
|
Required(),
|
|
CIDRSyntaxIPv6()
|
|
]
|