From 29c9ce0d641014c7bf0dca350230aa6c2772839c Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Tue, 23 Dec 2025 22:49:39 -0500 Subject: [PATCH] Add Augmented Latin IDN table to IDN enums This was added in https://github.com/google/nomulus/pull/2884 , but now as of this PR it can actually be configured and used on a TLD. --- .../registry/tldconfig/idn/IdnTableEnum.java | 9 +++++++++ .../registry/tldconfig/idn/augmented_latin.txt | 2 +- .../google/registry/bsa/IdnCheckerTest.java | 18 +++++++++++++++--- .../google/registry/beam/rde/reducer_rde.xml | 7 ++++++- .../registry/beam/rde/reducer_rde_report.xml | 2 +- ...apReduce_withDomain_producesExpectedXml.xml | 2 +- ...tMapReduce_withDomain_producesReportXml.xml | 2 +- .../xn--q9jyb4c_2010-10-17_full_S1_R0.xml | 2 +- 8 files changed, 35 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/google/registry/tldconfig/idn/IdnTableEnum.java b/core/src/main/java/google/registry/tldconfig/idn/IdnTableEnum.java index cba8b1865f9..1b47b24c2df 100644 --- a/core/src/main/java/google/registry/tldconfig/idn/IdnTableEnum.java +++ b/core/src/main/java/google/registry/tldconfig/idn/IdnTableEnum.java @@ -43,6 +43,15 @@ public enum IdnTableEnum { */ UNCONFUSABLE_LATIN("unconfusable_latin.txt"), + /** + * ICANN LGR 2025 Latin, but with confusable characters removed. + * + *

This is based on ICANN's + * LGR table, but is simpler. + */ + AUGMENTED_LATIN("augmented_latin.txt"), + /** * Japanese, as used on our existing TLD launches prior to 2023. * diff --git a/core/src/main/java/google/registry/tldconfig/idn/augmented_latin.txt b/core/src/main/java/google/registry/tldconfig/idn/augmented_latin.txt index 187f2a91451..abd64a2c06f 100644 --- a/core/src/main/java/google/registry/tldconfig/idn/augmented_latin.txt +++ b/core/src/main/java/google/registry/tldconfig/idn/augmented_latin.txt @@ -1,4 +1,4 @@ -# URL: https://www.iana.org/domains/idn-tables/tables/google_latn_1.0.txt +# URL: https://www.iana.org/domains/idn-tables/tables/google_latn_3.0.txt # Policy: https://www.registry.google/about/policies/domainabuse/ U+002D # HYPHEN-MINUS U+0030 # DIGIT ZERO diff --git a/core/src/test/java/google/registry/bsa/IdnCheckerTest.java b/core/src/test/java/google/registry/bsa/IdnCheckerTest.java index 6f0695c83e4..ec764a41c89 100644 --- a/core/src/test/java/google/registry/bsa/IdnCheckerTest.java +++ b/core/src/test/java/google/registry/bsa/IdnCheckerTest.java @@ -17,6 +17,7 @@ import static com.google.common.truth.Truth.assertThat; import static google.registry.testing.DatabaseHelper.createTld; import static google.registry.testing.DatabaseHelper.persistResource; +import static google.registry.tldconfig.idn.IdnTableEnum.AUGMENTED_LATIN; import static google.registry.tldconfig.idn.IdnTableEnum.EXTENDED_LATIN; import static google.registry.tldconfig.idn.IdnTableEnum.JA; import static google.registry.tldconfig.idn.IdnTableEnum.UNCONFUSABLE_LATIN; @@ -43,6 +44,7 @@ public class IdnCheckerTest { Tld jaonly; Tld jandelatin; Tld strictlatin; + Tld auglatin; IdnChecker idnChecker; @BeforeEach @@ -50,6 +52,7 @@ void setup() { jaonly = createTld("jaonly"); jandelatin = createTld("jandelatin"); strictlatin = createTld("strictlatin"); + auglatin = createTld("auglatin"); jaonly = persistResource( @@ -72,6 +75,13 @@ void setup() { .setBsaEnrollStartTime(Optional.of(fakeClock.nowUtc())) .setIdnTables(ImmutableSet.of(UNCONFUSABLE_LATIN)) .build()); + auglatin = + persistResource( + auglatin + .asBuilder() + .setBsaEnrollStartTime(Optional.of(fakeClock.nowUtc())) + .setIdnTables(ImmutableSet.of(AUGMENTED_LATIN)) + .build()); fakeClock.advanceOneMilli(); idnChecker = new IdnChecker(fakeClock); } @@ -79,12 +89,13 @@ void setup() { @Test void getAllValidIdns_allTlds() { assertThat(idnChecker.getAllValidIdns("all")) - .containsExactly(EXTENDED_LATIN, JA, UNCONFUSABLE_LATIN); + .containsExactly(EXTENDED_LATIN, JA, UNCONFUSABLE_LATIN, AUGMENTED_LATIN); } @Test void getAllValidIdns_notJa() { - assertThat(idnChecker.getAllValidIdns("à")).containsExactly(EXTENDED_LATIN, UNCONFUSABLE_LATIN); + assertThat(idnChecker.getAllValidIdns("à")) + .containsExactly(EXTENDED_LATIN, UNCONFUSABLE_LATIN, AUGMENTED_LATIN); } @Test @@ -116,6 +127,7 @@ void getSupportingTlds_multiTld_success() { @Test void getForbiddingTlds_success() { - assertThat(idnChecker.getForbiddingTlds(ImmutableSet.of("JA"))).containsExactly(strictlatin); + assertThat(idnChecker.getForbiddingTlds(ImmutableSet.of("JA"))) + .containsExactly(strictlatin, auglatin); } } diff --git a/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml b/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml index d08ea65e061..335ba420aa4 100644 --- a/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml +++ b/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml @@ -26,6 +26,11 @@ https://www.registry.google/about/policies/domainabuse/ + + https://www.iana.org/domains/idn-tables/tables/google_latn_3.0.txt + https://www.registry.google/about/policies/domainabuse/ + + https://www.iana.org/domains/idn-tables/tables/google_ja_1.0.txt https://www.registry.google/about/policies/domainabuse/ @@ -37,7 +42,7 @@ 1 1 1 - 3 + 4 diff --git a/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml b/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml index 9c56086614e..e25b28ee114 100644 --- a/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml +++ b/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml @@ -14,6 +14,6 @@ 1 1 1 - 3 + 4 diff --git a/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesExpectedXml.xml b/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesExpectedXml.xml index 402859c2f35..cad1fb0f0eb 100644 --- a/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesExpectedXml.xml +++ b/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesExpectedXml.xml @@ -261,7 +261,7 @@ 1 2 2 - 3 + 4 diff --git a/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesReportXml.xml b/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesReportXml.xml index 7032ee59b16..81c6d4fe80e 100644 --- a/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesReportXml.xml +++ b/core/src/test/resources/google/registry/rde/testMapReduce_withDomain_producesReportXml.xml @@ -37,6 +37,6 @@ 1 2 2 - 3 + 4 diff --git a/core/src/test/resources/google/registry/tools/server/xn--q9jyb4c_2010-10-17_full_S1_R0.xml b/core/src/test/resources/google/registry/tools/server/xn--q9jyb4c_2010-10-17_full_S1_R0.xml index 0df8bb82f20..f1ae7157f1a 100644 --- a/core/src/test/resources/google/registry/tools/server/xn--q9jyb4c_2010-10-17_full_S1_R0.xml +++ b/core/src/test/resources/google/registry/tools/server/xn--q9jyb4c_2010-10-17_full_S1_R0.xml @@ -135,7 +135,7 @@ 0 1 2 - 3 + 4