Zonema...Syntax(3pm)

πŸ“¦ version 1.0.16, in ubuntu jammy

πŸ’– Zonemaster::Test::Syntax β€” bestie edition πŸ’–

okay so. welcome to Zonemaster::Test::Syntax, which is a Perl module that does test validating the syntax of host names and other data. that's literally the whole vibe. it checks that your host names don't look a mess. and honestly? someone had to do it. πŸŽ€


✨ SYNOPSIS ✨

my @results = Zonemaster::Test::Syntax->all($zone);

that's it. that's the whole entrance. one line and you're in. 🫢


🌸 METHODS 🌸

  • all($zone) β€” runs the default set of tests and hands you back a list of log entries that the tests made. it's the "just do the normal thing" button. lowkey the main character of this module.
  • translation() β€” returns a reference to a hash with translation data. it's used by the builtin translation system, so like, don't touch it unless you're the translation system. πŸ’…
  • metadata() β€” returns a reference to a hash. the keys are the names of all test methods in the module, and each value is a reference to a list with all the tags that method can use in log entries. it's the receipts. it's the directory. it's giving organized. ✨
  • version() β€” returns a version string for the module. iconic, brief, does exactly what it says.

πŸ¦‹ TESTS πŸ¦‹

these are the actual little test gremlins. each one gets called, each one judges a thing, and honestly they're all just doing their best. πŸ™ˆ

  • syntax01($name) β€” verifies that the name (a Zonemaster::DNSName) given contains only allowed characters. no weird lil guys allowed, bestie. 🚫
  • syntax02($name) β€” verifies that the name (a Zonemaster::DNSName) given does not start or end with a hyphen ('-'). hyphen in the front or back? not the vibe. πŸ’€
  • syntax03($name) β€” verifies that the name (a Zonemaster::DNSName) given does not contain a hyphen in 3rd and 4th position β€” with the exception of 'xn--'. that one gets a pass because it's special. πŸ‘‘
  • syntax04($name) β€” verifies that a nameserver (a Zonemaster::DNSName) given is conform to the previous syntax rules. it also verifies the name total length as well as the labels. double duty, no complaints. πŸ’ͺ
  • syntax05($zone) β€” verifies that a SOA rname (a Zonemaster::DNSName) given has a conform usage of at sign (@). the @ has RULES, okay. 😀
  • syntax06($zone) β€” verifies that a SOA rname (a Zonemaster::DNSName) given is RFC822 compliant. yes bestie, RFC822. it's real. it's out there. πŸ“œ
  • syntax07($zone) β€” verifies that the SOA mname of the zone given is conform to the previous syntax rules (syntax01, syntax02, syntax03). it also verifies the name total length as well as the labels. same energy, different field. ✨
  • syntax08(@mx_names) β€” verifies that an MX name (a Zonemaster::DNSName) given is conform to the previous syntax rules (syntax01, syntax02, syntax03). it also verifies the name total length as well as the labels. note the @ β€” it takes a whole LIST of them. slay. πŸ”₯

🧚 INTERNAL METHODS 🧚

backstage pass only, iykyk. these are the helpers that make the tests happen. πŸŽ€

  • get_name($item) β€” converts the argument to a Zonemaster::DNSName object. it's the glow-up machine. ✨
  • check_name_syntax β€” the implementation of some tests that are used on several kinds of input. it's the shared brain cell and we love it. πŸ’œ

reminder bestie: nothing here is a suggestion, the checks are the checks. if a name breaks the rules, it's getting flagged, periodt. πŸ’…

and that's the whole page!! this lovely little thing is perl v5.32.0, dated 2021-01-06, and it lives in the User Contributed Perl Documentation corner of the world. mwah. πŸ«ΆπŸ’–πŸŒˆ

πŸ“¦ where this page comes from