Problem/Motivation
Lets remove usage of "blacklist" and "whitelist", they are:
- An historic bad labelling of people
- Provide no context: "what is listed in them"?
See also
- https://mobile.twitter.com/s_bergmann/status/1269917026107248641
- https://github.com/php/php-src/pull/5685
- “Blacklists” and “whitelists”: a salutary warning concerning the prevalence of racist language in discussions of predatory publishing
- Terminology: it's not black and white
- UK Cybersecurity Agency Drops 'Blacklist' and 'Whitelist' Terms Over Racial Stereotyping:
- Everyday words and phrases that have racist connotations
- No More Inflammatory Jargon: Change Blacklist To Blocklist
Proposed resolution
Fix the child issues
Configure the coder rule to scan for blacklist and whitelist
Remaining tasks
Issues completed
- #3470895: Add blacklist and whitelist to the list of flagwords
- #3517489: Replace use of blacklist from jsonapi tests
- #3151097: Replace use of whitelist/blacklist in core/misc/autocomplete.js and LinkWidget.php
- #3151086: Replace use of whitelist/blacklist in the path_alias module
- #3151087: Replace use of whitelist/blacklist in file_munge_filename() and its tests
- #3151091: Replace use of whitelist/blacklist in \Drupal\Component\Utility\Xss and its test and core/lib/Drupal/Core/Render/theme.api.php
- #3151092: Replace use of whitelist/blacklist in \Drupal\Core\Extension classes
- #3151093: Replace use of whitelist/blacklist in \Drupal\Core\Security\RequestSanitizer and its test
- #3151094: Replace use of whitelist/blacklist in \Drupal\Core\Template classes and their tests
- #3151095: Replace use of whitelist/blacklist in \Drupal\Core\Utility\Error and its test
- #3151096: Replace use of whitelist in \Drupal\Core\Utility\ProjectInfo
- #3151098: Replace use of whitelist/blacklist in Big Pipe module
- #3151101: Replace use of whitelist/blacklist in Filter module
- #3439270: Replace use of whitelist/blacklist in the editor module
- #3470890: Remove misc usage of whitelist in tests and comments
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Comments
Comment #2
damienmckennaI've a feeling this might need to be a D9 thing as I think it might involve API changes.
Comment #3
damienmckennaPer a suggestion from timplunkett, here's an attempt to avoid breaking backwards compatibility - the renamed classes are *coped* and then the old ones changed to just extend the new ones.
Comment #4
damienmckennaSorry, that last one missed a file.
Comment #6
dawehnerThank you so much for opening the issue! 👏🏽I would kind of argue this is more of a task than a feature request.
We need to keep the old service around. You can use something like ``` deprecated: The "%service_id%" service is deprecated. You should use the 'router.no_access_checks' service instead.``` though to mark it as deprecated
For sake of reviewing I could imagine that a core committer would suggest to to the variable/string renaming after renaming of classes, given the review scope / risk is different
Note: Protected variables can be just renamed in a minor release, which seems to be the right focus for this anyway :)
I could imagine that we would like to have a BC layer for this renamed function as well
Let's trigger a deprecation notice + document the deprecation, see https://www.drupal.org/core/deprecation
We could introduce an additional constant as well, and somehow deprecate the old one
Comment #7
jibranAn issue summary would be nice so adding the tag.
I have one question though 'blacklist' and 'whitelist' can be used as verbs like 'blacklisted' and 'whitelisted' now the verb form for 'allowlist' would be allowedlist or 'allowlisted' and 'denylist' would be 'denylisted' or 'deniedlist'? All I'm trying to say is, 'black' and 'white' are nouns and 'allow' and 'deny' are verbs we should be replacing those words with nouns. FWIW, my browser is underlining 'allowlist' and 'denylist' because they are not real words. Is it time to update the dictionary?
Comment #8
xano@jibran Good to bring up writing guidelines! I stared at your comment for a few seconds, baffled, and then your own very simple explanation hit me: can we just use "allow" and "deny" for the verbs? The list itself is more of an implementation detail than a description of what's supposed to happen. So we'd get something like "Anyone/anything on the allowlist is granted/allowed access, and anyone on the denylist is denied access".
Considering the complexity of rewriting such anchored terms (you may remember our efforts to improve on "master" and "slave"), what can we do to communicate this to translators too? In Dutch, for example, the term "blacklist" is used, but "whitelist" is not. It may be less obvious to Dutch translators that they may want to find an alternative anyway, despite the difference in perception across languages and cultures. This is also why I added the Needs change record tag. We can use that to explain the rationale, and provide people with information and instructions to address this issue in their code and translations.
Comment #9
jibran@Xano I think you missed my point. All I meant was, how do we rephrase something like
Comment #10
xanoAt the risk of missing it again: "IP address: %s has been denied. Please contact admin for access."? Admittedly, I cheated by avoiding having to translate "whitelist" altogether.
Comment #11
dawehnerWhile talking with @alexpott about this particular issue we concluded that instead of introducing "denylist" and "allowlist", which are not real worlds, we could instead find real words depending on the domain.
For example
whitelistin the context of XSS could beallowedTags.Comment #13
dawehnerThis updated all remaining entries.
Comment #15
volkswagenchickTagging for DrupalNorth 2019
Comment #16
volkswagenchickTagging for DrupalCamp Colorado Contrib day (Sunday August 4)
Comment #17
volkswagenchickTagging for badcamp2019, thanks! (October 2-5)
Comment #20
alexpottI think in order to do this we need to break this issue up into separate manageable tasks.
This issue can then enable the updated PHPCS rule for core.
Comment #21
alexpottComment #22
alexpottComment #23
dwwSad I never found this issue earlier, and happy to see it getting new life now! Very timely. Huge +1000 to this.
Let's hope we've evolved enough as a community that there's no aggressive pushback on this like there was at #343414: Rename "master/slave" terminology to "client/server" or #2275877: Replace "master/slave" terminology with "primary/replica". 🤞🖤✊
I'll help as many child issues as I can.
Thanks!
-Derek
Comment #24
dwwSadly, we are starting to get some pushback. Amazing. So it's more easily shared across this whole effort, here's a copy of my reply:
- - -
So the burden of explaining the racist implications of "whitelist" equaling the good things you want to keep and the "blacklist" being the bad things you want to skip or prohibit doesn't have to fall to someone of color, I'll take a moment to provide some references for further reading:
“Blacklists” and “whitelists”: a salutary warning concerning the prevalence of racist language in discussions of predatory publishing:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6148600
Terminology: it's not black and white:
https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white
UK Cybersecurity Agency Drops 'Blacklist' and 'Whitelist' Terms Over Racial Stereotyping:
https://www.pcmag.com/news/uk-cybersecurity-agency-drops-blacklist-and-w...
Everyday words and phrases that have racist connotations:
https://www.cnn.com/2020/07/06/us/racism-words-phrases-slavery-trnd/inde...
No More Inflammatory Jargon: Change Blacklist To Blocklist:
https://www.adexchanger.com/data-driven-thinking/no-more-inflammatory-ja...
Hope you take time to try to imagine the world through someone else's eyes and see if that might change your perspective.
Thanks,
-Derek
Comment #25
quietone commented@dww, thanks for the links.
Adding the links to resources from the previous comment to the IS.
Comment #26
damienmckennaThat's an excellent response, thank you dww!
Comment #27
alexpottPressing save so the issues in the issue summary are the right status.
Comment #28
dwwRe-saving since #3151093: Replace use of whitelist/blacklist in \Drupal\Core\Security\RequestSanitizer and its test is no longer postponed.
We're getting close!
Yay,
-Derek
Comment #29
volkswagenchickTagging for upcoming contribution day at GovCon2020, dates Sept 23-25.
Thanks!
Comment #31
webchickCurrent stats of the 9.2.x branch for anyone curious:
After applying the patches in #3151086: Replace use of whitelist/blacklist in the path_alias module, #3151097: Replace use of whitelist/blacklist in core/misc/autocomplete.js and LinkWidget.php, #3151100: Replace use of whitelist/blacklist in CkEditor and Editor modules:
Remaining for "whitelist" are:
Remaining for "blacklist" are:
Some of these are covered by and just missing from other issues, but it looks like we might need more sub-issues here:
- Core security tests
- Kernel tests
- JSON API
- Workspaces
- etc.
I notice a couple of upstream problems, for example PHPUnit. It looks like PHPUnit deprecated "whitelist" and "blacklist" in 9.3.0 https://github.com/sebastianbergmann/phpunit/blob/a0d6b21c6c8f6564212a1a... ... but I think I read elsewhere that we need to continue to support PHPUnit 8 until we don't support PHP 7.3 anymore...
Anyway, hope that helps. Thanks to everyone contributing to this initiative!
Comment #36
mgiffordGreat to see the progress on this. Thanks for making Drupal more inclusive.
Comment #37
jonathan1055 commentedIt's actually been two years since any progress. I've split the child issues into 'to do' and 'done' to make it easier to focus on what is still remaining.
Comment #39
quietone commentedComment #40
quietone commentedComment #41
quietone commentedComment #42
quietone commentedComment #43
quietone commentedComment #44
quietone commentedThe last child issue has been committed! The related task, #3151102: Rename GenderNeutralCommentSniff to InclusiveLanguageSniff and scan code and make wordlist configurable, has a wider scope than this name change. Core is now using cspell to prevent future usages creeping back in. So, everything is done here.
Thank you to everyone who participated in having core use more inclusive language.
Comment #45
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
Comment #46
dwwHuzzah!
Comment #47
alexpottVery cool that #3470895: Add blacklist and whitelist to the list of flagwords has landed - imo that means this is fixed.
Comment #48
jonathan1055 commentedIt is also "fixed" in Contrib too, see #3524087: Add blacklist and whitelist to flagWords for all Contrib CI