AO3-7444 Implement Unicode's confusable check between guest names and banned usernames - #6004
Open
omerfaruk-pseud wants to merge 19 commits into
Open
AO3-7444 Implement Unicode's confusable check between guest names and banned usernames#6004omerfaruk-pseud wants to merge 19 commits into
omerfaruk-pseud wants to merge 19 commits into
Conversation
added 16 commits
July 14, 2026 00:52
omerfaruk-pseud
marked this pull request as ready for review
August 27, 2026 21:17
redsummernight
requested changes
Sep 2, 2026
| # character, join each of those arrays (or codepoint of source character if | ||
| # it's not confusable) after converting them to a string. Also normalize | ||
| # before and after as described by the standard. | ||
| def self.internal_skeleton(string) |
Member
There was a problem hiding this comment.
You should move all the confusable internal logic into a concern (app/models/concerns), where everything is kept private except for the confusable? method. This should be similar to how we set up Filterable etc.
The corresponding tests should be in spec/models/concerns.
Member
Author
There was a problem hiding this comment.
Thank you
Did I do alright? I'm not sure, I don't really understand how I should be using ActiveSupport::Concern. Looking at Concern on api docs, I don't see a use for included or class_methods? Filterable or the other concerns we have work on objects, what should be the object here, the validation? Also right now private isn't privating too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7444
Purpose
With a script, download the Unicode's confusables list (which I also added to git), create and cache a hash from it. Produce internal representations of the guest name from that hash and compare against the banned usernames', with an algorithm stricter than Unicode's.
Testing Instructions
In addition to the steps on the Jira issue, make sure that allowed usernames don't raise any error.
References
https://www.unicode.org/reports/tr39#Confusable_Detection
Credit
ömer faruk (he/him)