Allow <project_id>, <project_name>, <user_id> and <user_name> as DNS label

A DNS label is a alphanumerical text seperated by period(s).
(i.e. label1.label2.label2.com.)
Here we allow a label to be equal keywords defined which will be eval later

Related-Bug: #1843218
Needed-By: https://review.opendev.org/#/c/686343/
Change-Id: I6a1b983cf1bb0d6d04ec75b4725f39f29dc4c2ba
This commit is contained in:
Gregoire Mahe 2019-10-02 09:48:42 +02:00
parent b72d2d1b53
commit b27c012972
1 changed files with 4 additions and 1 deletions

View File

@ -328,8 +328,11 @@ VXLAN_ENCAP_OVERHEAD = 30
# For DNS extension
DNS_DOMAIN_DEFAULT = 'openstacklocal.'
DNS_LABEL_KEYWORDS = ['project_id', 'project_name', 'user_name', 'user_id']
DNS_LABEL_MAX_LEN = 63
DNS_LABEL_REGEX = "^[a-z0-9-]{1,%d}$" % DNS_LABEL_MAX_LEN
DNS_LABEL_REGEX = "^([a-z0-9-]{1,%d}|%s)$" % (
DNS_LABEL_MAX_LEN,
'<' + '>|<'.join(DNS_LABEL_KEYWORDS) + '>')
# max value for TCP, UDP, SCTP ports
PORT_MAX = 2**16 - 1