Skip to content

AO3-7444 Implement Unicode's confusable check between guest names and banned usernames - #6004

Open
omerfaruk-pseud wants to merge 19 commits into
otwcode:masterfrom
omerfaruk-pseud:AO3-7444
Open

AO3-7444 Implement Unicode's confusable check between guest names and banned usernames#6004
omerfaruk-pseud wants to merge 19 commits into
otwcode:masterfrom
omerfaruk-pseud:AO3-7444

Conversation

@omerfaruk-pseud

@omerfaruk-pseud omerfaruk-pseud commented Aug 27, 2026

Copy link
Copy Markdown
Member

Pull Request Checklist

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)

@omerfaruk-pseud omerfaruk-pseud changed the title AO3-7444 AO3-7444 Implement Unicode's confusable check between guest names and banned usernames Aug 27, 2026
@omerfaruk-pseud
omerfaruk-pseud marked this pull request as ready for review August 27, 2026 21:17
Comment thread app/validators/not_forbidden_name_validator.rb Outdated
# 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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants