mirror of
https://github.com/google/nomulus.git
synced 2025-06-20 11:20:47 +02:00
Rename some overlooked uses of "white-list" and "blacklist" (#960)
* Rename some overlooked uses of "white-list" and "blacklist"
This commit is contained in:
parent
3f97372011
commit
e1a5797a14
3 changed files with 7 additions and 7 deletions
|
@ -47,8 +47,8 @@ public final class ExtensionManager {
|
||||||
|
|
||||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||||
|
|
||||||
/** Blacklist of extension URIs that cause an error if they are used without being declared. */
|
/** Denylist of extension URIs that cause an error if they are used without being declared. */
|
||||||
private static final ImmutableSet<String> UNDECLARED_URIS_BLACKLIST = FEE_EXTENSION_URIS;
|
private static final ImmutableSet<String> UNDECLARED_URIS_DENYLIST = FEE_EXTENSION_URIS;
|
||||||
|
|
||||||
private final ImmutableSet.Builder<Class<? extends CommandExtension>> implementedBuilder =
|
private final ImmutableSet.Builder<Class<? extends CommandExtension>> implementedBuilder =
|
||||||
new ImmutableSet.Builder<>();
|
new ImmutableSet.Builder<>();
|
||||||
|
@ -95,7 +95,7 @@ public final class ExtensionManager {
|
||||||
if (undeclaredUris.isEmpty()) {
|
if (undeclaredUris.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Set<String> undeclaredUrisThatError = intersection(undeclaredUris, UNDECLARED_URIS_BLACKLIST);
|
Set<String> undeclaredUrisThatError = intersection(undeclaredUris, UNDECLARED_URIS_DENYLIST);
|
||||||
if (!undeclaredUrisThatError.isEmpty()) {
|
if (!undeclaredUrisThatError.isEmpty()) {
|
||||||
throw new UndeclaredServiceExtensionException(undeclaredUrisThatError);
|
throw new UndeclaredServiceExtensionException(undeclaredUrisThatError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -938,7 +938,7 @@ soy.$$HTML5_VOID_ELEMENTS_ = new RegExp(
|
||||||
*/
|
*/
|
||||||
soy.$$stripHtmlTags = function(value, opt_tagAllowList) {
|
soy.$$stripHtmlTags = function(value, opt_tagAllowList) {
|
||||||
if (!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)
|
return String(value)
|
||||||
.replace(soy.esc.$$HTML_TAG_REGEX_, '')
|
.replace(soy.esc.$$HTML_TAG_REGEX_, '')
|
||||||
// This is just paranoia since callers should normalize the result
|
// 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
|
// Now html contains no tags or less-than characters that could become
|
||||||
// part of a tag via a replacement operation and tags only contains
|
// part of a tag via a replacement operation and tags only contains
|
||||||
// approved tags.
|
// approved tags.
|
||||||
// Reinsert the white-listed tags.
|
// Reinsert the allowlisted tags.
|
||||||
html = html.replace(/\[(\d+)\]/g, function(_, index) {
|
html = html.replace(/\[(\d+)\]/g, function(_, index) {
|
||||||
if (attrs[index] && tags[index]) {
|
if (attrs[index] && tags[index]) {
|
||||||
return tags[index].substr(0, tags[index].length - 1) + attrs[index] + '>';
|
return tags[index].substr(0, tags[index].length - 1) + attrs[index] + '>';
|
||||||
|
|
|
@ -86,7 +86,7 @@ class ExtensionManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testBlacklistedExtensions_forbiddenWhenUndeclared() {
|
void testDenylistedExtensions_forbiddenWhenUndeclared() {
|
||||||
ExtensionManager manager =
|
ExtensionManager manager =
|
||||||
new TestInstanceBuilder()
|
new TestInstanceBuilder()
|
||||||
.setEppRequestSource(EppRequestSource.TOOL)
|
.setEppRequestSource(EppRequestSource.TOOL)
|
||||||
|
@ -100,7 +100,7 @@ class ExtensionManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testBlacklistedExtensions_allowedWhenDeclared() throws Exception {
|
void testDenylistedExtensions_allowedWhenDeclared() throws Exception {
|
||||||
ExtensionManager manager =
|
ExtensionManager manager =
|
||||||
new TestInstanceBuilder()
|
new TestInstanceBuilder()
|
||||||
.setEppRequestSource(EppRequestSource.TOOL)
|
.setEppRequestSource(EppRequestSource.TOOL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue