mirror of
https://github.com/google/nomulus
synced 2026-08-28 03:46:30 +00:00
Export Premium names to Drive
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=212509587
This commit is contained in:
@@ -1057,6 +1057,13 @@ public final class RegistryConfig {
|
||||
return config.registryPolicy.allocationTokenCustomLogicClass;
|
||||
}
|
||||
|
||||
/** Returns the disclaimer text for the exported premium terms. */
|
||||
@Provides
|
||||
@Config("premiumTermsExportDisclaimer")
|
||||
public static String providePremiumTermsExportDisclaimer(RegistryConfigSettings config) {
|
||||
return formatComments(config.registryPolicy.reservedTermsExportDisclaimer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the header text at the top of the reserved terms exported list.
|
||||
*
|
||||
@@ -1065,13 +1072,7 @@ public final class RegistryConfig {
|
||||
@Provides
|
||||
@Config("reservedTermsExportDisclaimer")
|
||||
public static String provideReservedTermsExportDisclaimer(RegistryConfigSettings config) {
|
||||
return Splitter.on('\n')
|
||||
.omitEmptyStrings()
|
||||
.trimResults()
|
||||
.splitToList(config.registryPolicy.reservedTermsExportDisclaimer)
|
||||
.stream()
|
||||
.map(s -> "# " + s)
|
||||
.collect(Collectors.joining("\n"));
|
||||
return formatComments(config.registryPolicy.reservedTermsExportDisclaimer);
|
||||
}
|
||||
|
||||
/** Returns the clientId of the registrar used by the {@code CheckApiServlet}. */
|
||||
@@ -1412,5 +1413,11 @@ public final class RegistryConfig {
|
||||
static final Supplier<RegistryConfigSettings> CONFIG_SETTINGS =
|
||||
memoize(YamlUtils::getConfigSettings);
|
||||
|
||||
private static String formatComments(String text) {
|
||||
return Splitter.on('\n').omitEmptyStrings().trimResults().splitToList(text).stream()
|
||||
.map(s -> "# " + s)
|
||||
.collect(Collectors.joining("\n"));
|
||||
}
|
||||
|
||||
private RegistryConfig() {}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public class RegistryConfigSettings {
|
||||
public String tmchMarksDbUrl;
|
||||
public String checkApiServletClientId;
|
||||
public String registryAdminClientId;
|
||||
public String premiumTermsExportDisclaimer;
|
||||
public String reservedTermsExportDisclaimer;
|
||||
public String whoisDisclaimer;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,12 @@ registryPolicy:
|
||||
# registrar
|
||||
registryAdminClientId: TheRegistrar
|
||||
|
||||
# Disclaimer at the top of the exported premium terms list.
|
||||
premiumTermsExportDisclaimer: |
|
||||
This list contains domains for the TLD offered at a premium price. This
|
||||
list is subject to change. The most up-to-date source is always the
|
||||
registry itself, by sending domain check EPP commands.
|
||||
|
||||
# Disclaimer at the top of the exported reserved terms list.
|
||||
reservedTermsExportDisclaimer: |
|
||||
This list contains reserved terms for the TLD. Other terms may be reserved
|
||||
|
||||
Reference in New Issue
Block a user