Skip to content

Commit 83b21dc

Browse files
fix: Replace with respectful terms (#801)
Replace blacklist and whitelist with disallowlist and allowlist when possible.
1 parent 6525220 commit 83b21dc

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

javascript/widgets/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,19 +459,19 @@ class Config {
459459
(!Array.isArray(blacklistedCountries))) {
460460
throw new Error('BlacklistedCountries must be an array.');
461461
}
462-
// If both whitelist and blacklist are provided, throw error.
462+
// If both allowlist and disallowlist are provided, throw error.
463463
if (whitelistedCountries && blacklistedCountries) {
464464
throw new Error(
465465
'Both whitelistedCountries and blacklistedCountries are provided.');
466466
}
467-
// If no whitelist or blacklist provided, return all available countries.
467+
// If no allowlist or disallowlist provided, return all available countries.
468468
if (!whitelistedCountries && !blacklistedCountries) {
469469
return country.COUNTRY_LIST;
470470
}
471471
let countries = [];
472472
const availableCountries = [];
473473
if (whitelistedCountries) {
474-
// Whitelist is provided.
474+
// Allowlist is provided.
475475
const whitelistedCountryMap = {};
476476
for (let i = 0; i < whitelistedCountries.length; i++) {
477477
countries = country

javascript/widgets/config_test.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,20 @@ testSuite({
442442
assertArrayEquals([], warningLogMessages);
443443

444444
// Phone config with blacklisted reCAPTCHA parameters.
445-
const blacklist = {
445+
const disallowlist = {
446446
'sitekey': 'SITEKEY',
447447
'tabindex': 0,
448448
'callback': function(token) {},
449449
'expired-callback': function() {},
450450
};
451451
config.update(
452-
'signInOptions',
453-
['github.com', {'provider': 'google.com'},
454-
{'provider': 'phone', 'recaptchaParameters': blacklist}, 'password']);
452+
'signInOptions',
453+
['github.com', {'provider': 'google.com'},
454+
{
455+
'provider': 'phone',
456+
'recaptchaParameters': disallowlist
457+
},
458+
'password']);
455459
assertObjectEquals({}, config.getRecaptchaParameters());
456460
// Expected warning should be logged.
457461
assertArrayEquals(
@@ -958,7 +962,7 @@ testSuite({
958962
},
959963

960964
testUpdateConfig_phoneSignInOption_error() {
961-
// Tests when both whitelist and blacklist are provided.
965+
// Tests when both allowlist and disallowlist are provided.
962966
let error = assertThrows(() => {
963967
config.update('signInOptions', [{
964968
'provider': 'phone',
@@ -969,7 +973,7 @@ testSuite({
969973
assertEquals(
970974
'Both whitelistedCountries and blacklistedCountries are provided.',
971975
error.message);
972-
// Tests when empty whitelist is provided.
976+
// Tests when empty allowlist is provided.
973977
error = assertThrows(() => {
974978
config.update('signInOptions', [{
975979
'provider': 'phone',
@@ -1022,7 +1026,7 @@ testSuite({
10221026
},
10231027

10241028
testSetConfig_phoneSignInOption_error() {
1025-
// Tests when both whitelist and blacklist are provided.
1029+
// Tests when both allowlist and disallowlist are provided.
10261030
let error = assertThrows(() => {
10271031
config.setConfig({
10281032
'signInOptions': [{
@@ -1035,7 +1039,7 @@ testSuite({
10351039
assertEquals(
10361040
'Both whitelistedCountries and blacklistedCountries are provided.',
10371041
error.message);
1038-
// Tests when empty whitelist is provided.
1042+
// Tests when empty allowlist is provided.
10391043
error = assertThrows(() => {
10401044
config.setConfig({
10411045
'signInOptions': [{

0 commit comments

Comments
 (0)