Skip to content

Commit 5a02c3e

Browse files
committed
types - dns: add a new dns type with more specific fqdn definitions
This PR introduces a new set of types for validating FQDN's. it creates a type for the more loose rfc definitions of domain names and a stricter and likely more useful iana type. This allows us to create a new type that more does to what most users expect i.e. that a dns name is one that works on the internt, without breaking current uses for users that may be using the Stdlib::Fqdn to validate validate DNS names that don't work with the IANA roots. The intention of this patch would be to deprecate the currnet Stdlib::Fqdn type and encourage users to move to the appropriate Stdlib::DNS::* type which for most users will likely be the stricter Stdlib::DNS::Fqdn type Note: this PR is intentionally a bit rough to first garner thoughts as to if this is the correct direction Fixes #1282 (not sure it fixes but want it tagged)
1 parent a241039 commit 5a02c3e

File tree

6 files changed

+7
-1
lines changed

6 files changed

+7
-1
lines changed

types/dns/fqdn.pp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type Stdlib::DNS::Fqdn = Stdlib::DNS::Fqdn::IANA::ASCII

types/dns/fqdn/iana/ascii.pp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type Stdlib::DNS::Fqdn::IANA::ASCII = Pattern[/\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[a-z0-9]*[a-z]+[a-z0-9]*)\z/]

types/dns/fqdn/iana/unicode.pp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type Stdlib::DNS::Fqdn::IANA::Unicode = Pattern[/\A((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)*[[:alpha:]]+)\z/]

types/dns/fqdn/rfc.pp

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
type Stdlib::DNS::Fqdn::Rfc = Pattern[/\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/]
2+

types/dns/punycode.pp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type Stdlib::DNS::Punycpde = Pattern[/xn--[a-z0-9]+/]

types/fqdn.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# @summary Validate a Fully Qualified Domain Name
2-
type Stdlib::Fqdn = Pattern[/\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/]
2+
type Stdlib::Fqdn = Stdlib::DNS::Rfc::Fqdn

0 commit comments

Comments
 (0)