mirror of
https://github.com/google/nomulus
synced 2026-09-19 14:34:18 +00:00
Add validation to ROID suffixes
I could've sworn we were already doing this, but apparently not? Anyway,
ROID suffixes have a number of requirements on them that weren't being
enforced, so this enforces them. All existing production data is compliant
with these requirements; the only existing bad data we have is in alpha and
sandbox.
ROID suffixes are now required to match the regex ^[A-Z0-9_]{1,8}$
See also https://tools.ietf.org/html/rfc5730
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173400001
This commit is contained in:
@@ -418,10 +418,11 @@ public class DatastoreHelper {
|
||||
}
|
||||
|
||||
public static void createTld(String tld, ImmutableSortedMap<DateTime, TldState> tldStates) {
|
||||
createTld(
|
||||
tld,
|
||||
Ascii.toUpperCase(tld.replaceFirst(ACE_PREFIX_REGEX, "").replace('.', '_')),
|
||||
tldStates);
|
||||
// Coerce the TLD string into a valid ROID suffix.
|
||||
String roidSuffix =
|
||||
Ascii.toUpperCase(tld.replaceFirst(ACE_PREFIX_REGEX, "").replace('.', '_'))
|
||||
.replace('-', '_');
|
||||
createTld(tld, roidSuffix.length() > 8 ? roidSuffix.substring(0, 8) : roidSuffix, tldStates);
|
||||
}
|
||||
|
||||
public static void createTld(
|
||||
|
||||
Reference in New Issue
Block a user