Class RpIdValidator
Pure string validation: it never resolves DNS. It accepts a DNS hostname with at least two labels and
nothing else, which is what rules out the SSRF-shaped inputs: IP literals (including the decimal and hex
forms such as 2130706433 and 0x7f.1), localhost, internal-only suffixes,
credentials, ports, paths, queries and fragments.
IDN rule. An internationalized name is converted with IDN.toASCII(String) and the result
is what is returned. A label whose letters come from more than one script (for example Latin mixed with
Cyrillic) is rejected, whether it was written as Unicode or as xn-- punycode: the punycode form
is decoded and checked too, so it cannot be used to smuggle a homograph through. This is deliberately
conservative; a legitimate name that mixes scripts, such as Japanese Han with Kana, is rejected too.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy a value was rejected.static final classOutcome ofvalidate(String): either an accepted ID or a rejection reason. -
Method Summary
-
Method Details
-
validate
-