Skip to content

Commit

Permalink
change FQDN check back slightly to avoid allowing mistyped IPs like 1…
Browse files Browse the repository at this point in the history
…0.0.0.500
  • Loading branch information
indy-independence committed Aug 12, 2024
1 parent 24cf7a4 commit d355b20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cnaas_nms/db/settings_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
r"[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
r":((:[0-9a-fA-F]{1,4}){1,7}|:))"
)
HOSTNAME_REGEX = r"^([a-zA-Z0-9-]{1,63})(\.[a-zA-Z0-9-]{1,63})*$"
HOSTNAME_REGEX = r"^([a-zA-Z0-9-]{1,63})(\.[a-zA-Z-][a-zA-Z0-9-]{0,62})*$"
HOST_REGEX = f"^({IPV4_REGEX}|{IPV6_REGEX}|{HOSTNAME_REGEX})$"
DOMAIN_NAME_REGEX = r"^([a-zA-Z0-9-]{1,63})(\.[a-zA-Z0-9-]{1,63})+$"
host_schema = Field(..., pattern=HOST_REGEX, max_length=253, description="Hostname, FQDN or IP address")
Expand Down

0 comments on commit d355b20

Please sign in to comment.