From e1a5797a14f53e607d2295d045b676e11c0d4803 Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Mon, 8 Feb 2021 16:01:18 -0500 Subject: [PATCH] Rename some overlooked uses of "white-list" and "blacklist" (#960) * Rename some overlooked uses of "white-list" and "blacklist" --- .../main/java/google/registry/flows/ExtensionManager.java | 6 +++--- core/src/main/javascript/soyutils_usegoog.js | 4 ++-- .../java/google/registry/flows/ExtensionManagerTest.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/google/registry/flows/ExtensionManager.java b/core/src/main/java/google/registry/flows/ExtensionManager.java index cee53b9a7..8f393e69c 100644 --- a/core/src/main/java/google/registry/flows/ExtensionManager.java +++ b/core/src/main/java/google/registry/flows/ExtensionManager.java @@ -47,8 +47,8 @@ public final class ExtensionManager { private static final FluentLogger logger = FluentLogger.forEnclosingClass(); - /** Blacklist of extension URIs that cause an error if they are used without being declared. */ - private static final ImmutableSet UNDECLARED_URIS_BLACKLIST = FEE_EXTENSION_URIS; + /** Denylist of extension URIs that cause an error if they are used without being declared. */ + private static final ImmutableSet UNDECLARED_URIS_DENYLIST = FEE_EXTENSION_URIS; private final ImmutableSet.Builder> implementedBuilder = new ImmutableSet.Builder<>(); @@ -95,7 +95,7 @@ public final class ExtensionManager { if (undeclaredUris.isEmpty()) { return; } - Set undeclaredUrisThatError = intersection(undeclaredUris, UNDECLARED_URIS_BLACKLIST); + Set undeclaredUrisThatError = intersection(undeclaredUris, UNDECLARED_URIS_DENYLIST); if (!undeclaredUrisThatError.isEmpty()) { throw new UndeclaredServiceExtensionException(undeclaredUrisThatError); } diff --git a/core/src/main/javascript/soyutils_usegoog.js b/core/src/main/javascript/soyutils_usegoog.js index 53d434445..544836487 100644 --- a/core/src/main/javascript/soyutils_usegoog.js +++ b/core/src/main/javascript/soyutils_usegoog.js @@ -938,7 +938,7 @@ soy.$$HTML5_VOID_ELEMENTS_ = new RegExp( */ soy.$$stripHtmlTags = function(value, opt_tagAllowList) { if (!opt_tagAllowList) { - // If we have no white-list, then use a fast track which elides all tags. + // If we have no allowlist, then use a fast track which elides all tags. return String(value) .replace(soy.esc.$$HTML_TAG_REGEX_, '') // This is just paranoia since callers should normalize the result @@ -1003,7 +1003,7 @@ soy.$$stripHtmlTags = function(value, opt_tagAllowList) { // Now html contains no tags or less-than characters that could become // part of a tag via a replacement operation and tags only contains // approved tags. - // Reinsert the white-listed tags. + // Reinsert the allowlisted tags. html = html.replace(/\[(\d+)\]/g, function(_, index) { if (attrs[index] && tags[index]) { return tags[index].substr(0, tags[index].length - 1) + attrs[index] + '>'; diff --git a/core/src/test/java/google/registry/flows/ExtensionManagerTest.java b/core/src/test/java/google/registry/flows/ExtensionManagerTest.java index c9b13b92e..81afe37a0 100644 --- a/core/src/test/java/google/registry/flows/ExtensionManagerTest.java +++ b/core/src/test/java/google/registry/flows/ExtensionManagerTest.java @@ -86,7 +86,7 @@ class ExtensionManagerTest { } @Test - void testBlacklistedExtensions_forbiddenWhenUndeclared() { + void testDenylistedExtensions_forbiddenWhenUndeclared() { ExtensionManager manager = new TestInstanceBuilder() .setEppRequestSource(EppRequestSource.TOOL) @@ -100,7 +100,7 @@ class ExtensionManagerTest { } @Test - void testBlacklistedExtensions_allowedWhenDeclared() throws Exception { + void testDenylistedExtensions_allowedWhenDeclared() throws Exception { ExtensionManager manager = new TestInstanceBuilder() .setEppRequestSource(EppRequestSource.TOOL)