def _aa_search_domain(self): """ The domain-search option specifies a 'search list' of Domain Names to be used by the client to locate not-fully-qualified domain names. The difference between this option and historic use of the domain-name option for the same ends is that this option is encoded in RFC1035 compressed labels on the wire. For example: option domain-search "example.com", "sales.example.com"; """ self.is_option = True self.is_statement = False self.has_validator = True value = self.value.strip(';') value = value.strip(' ') for name in value.split(','): # Bug here. Ex: "asf, "'asdf"' name = name.strip(' ') if not name: raise ValidationError("Each name needs to be a non empty " "domain name surrounded by \"\"") if name[0] != '"' and name[len(name) - 1] != '"': raise ValidationError("Each name needs to be a non empty " "domain name surrounded by \"\"") validate_name(name.strip('"'))
def _domain_list_validator(self): value = self._get_value() for name in value.split(','): # Bug here. Ex: "asf, "'asdf"' name = name.strip(' ') if not name: raise ValidationError("Each name needs to be a non empty " "domain name surrounded by \"\"") if name[0] != '"' and name[len(name) - 1] != '"': raise ValidationError("Each name needs to be a non empty " "domain name surrounded by \"\"") validate_name(name.strip('"'))
def _aa_domain_name(self): """ option domain-name text; The 'text' should be a space seperated domain names. I.E.: phx.mozilla.com phx1.mozilla.com This option specifies the domain name that client should use when resolving hostnames via the Domain Name System. """ self.is_option = True self.is_statement = False self.has_validator = True value = self._get_value() for name in value.split(' '): validate_name(name) self.value = value