mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02:00
Add more BSA configs (#2230)
* Add more BSA configs Added urls for reporting order and domains to BSA. Also added operational configs.
This commit is contained in:
parent
9b79f5af2c
commit
853e571d01
3 changed files with 73 additions and 0 deletions
|
@ -1397,6 +1397,47 @@ public final class RegistryConfig {
|
|||
return config.bulkPricingPackageMonitoring.bulkPricingPackageDomainLimitUpgradeEmailBody;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Config("bsaGcsBucket")
|
||||
public static String provideBsaGcsBucket(@Config("projectId") String projectId) {
|
||||
return projectId + "-bsa";
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Config("bsaChecksumAlgorithm")
|
||||
public static String provideBsaChecksumAlgorithm(RegistryConfigSettings config) {
|
||||
return config.bsa.bsaChecksumAlgorithm;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Config("bsaLockLeaseExpiry")
|
||||
public static Duration provideBsaLockLeaseExpiry(RegistryConfigSettings config) {
|
||||
return Duration.standardMinutes(config.bsa.bsaLockLeaseExpiryMinutes);
|
||||
}
|
||||
|
||||
/** Returns the desired interval between successive BSA downloads. */
|
||||
@Provides
|
||||
@Config("bsaDownloadInterval")
|
||||
public static Duration provideBsaDownloadInterval(RegistryConfigSettings config) {
|
||||
return Duration.standardMinutes(config.bsa.bsaDownloadIntervalMinutes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum period when a BSA download can be skipped due to the checksum-based
|
||||
* equality check with the previous download.
|
||||
*/
|
||||
@Provides
|
||||
@Config("bsaMaxNopInterval")
|
||||
public static Duration provideBsaMaxNopInterval(RegistryConfigSettings config) {
|
||||
return Duration.standardHours(config.bsa.bsaMaxNopIntervalHours);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Config("bsaLabelTxnBatchSize")
|
||||
public static int provideBsaLabelTxnBatchSize(RegistryConfigSettings config) {
|
||||
return config.bsa.bsaLabelTxnBatchSize;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Config("bsaAuthUrl")
|
||||
public static String provideBsaAuthUrl(RegistryConfigSettings config) {
|
||||
|
@ -1415,6 +1456,27 @@ public final class RegistryConfig {
|
|||
return ImmutableMap.copyOf(config.bsa.dataUrls);
|
||||
}
|
||||
|
||||
/** Provides the BSA Http endpoint for reporting order processing status. */
|
||||
@Provides
|
||||
@Config("bsaOrderStatusUrl")
|
||||
public static String provideBsaOrderStatusUrls(RegistryConfigSettings config) {
|
||||
return config.bsa.orderStatusUrl;
|
||||
}
|
||||
|
||||
/** Provides the BSA Http endpoint for reporting new unblockable domains. */
|
||||
@Provides
|
||||
@Config("bsaAddUnblockableDomainsUrl")
|
||||
public static String provideBsaAddUnblockableDomainsUrls(RegistryConfigSettings config) {
|
||||
return String.format("%s?%s", config.bsa.unblockableDomainsUrl, "action=add");
|
||||
}
|
||||
|
||||
/** Provides the BSA Http endpoint for reporting domains that have become blockable. */
|
||||
@Provides
|
||||
@Config("bsaRemoveUnblockableDomainsUrl")
|
||||
public static String provideBsaRemoveUnblockableDomainsUrls(RegistryConfigSettings config) {
|
||||
return String.format("%s?%s", config.bsa.unblockableDomainsUrl, "action=remove");
|
||||
}
|
||||
|
||||
private static String formatComments(String text) {
|
||||
return Splitter.on('\n').omitEmptyStrings().trimResults().splitToList(text).stream()
|
||||
.map(s -> "# " + s)
|
||||
|
|
|
@ -267,8 +267,15 @@ public class RegistryConfigSettings {
|
|||
|
||||
/** Configurations for integration with Brand Safety Alliance (BSA) API. */
|
||||
public static class Bsa {
|
||||
public String bsaChecksumAlgorithm;
|
||||
public int bsaLockLeaseExpiryMinutes;
|
||||
public int bsaDownloadIntervalMinutes;
|
||||
public int bsaMaxNopIntervalHours;
|
||||
public int bsaLabelTxnBatchSize;
|
||||
public String authUrl;
|
||||
public int authTokenExpirySeconds;
|
||||
public Map<String, String> dataUrls;
|
||||
public String orderStatusUrl;
|
||||
public String unblockableDomainsUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -617,3 +617,7 @@ bsa:
|
|||
dataUrls:
|
||||
"BLOCK": "https://"
|
||||
"BLOCK_PLUS": "https://"
|
||||
# Http endpoint for reporting order processing status
|
||||
orderStatusUrl: "https://"
|
||||
# Http endpoint for reporting changes in the set of unblockable domains.
|
||||
unblockableDomainsUrl: "https://"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue