usernames 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +39 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +362 -0
  5. data/SECURITY.md +42 -0
  6. data/config/locales/usernames.en.yml +72 -0
  7. data/config/locales/usernames.es.yml +51 -0
  8. data/config/locales/usernames.pt.yml +51 -0
  9. data/data/LICENSES/allprofanity.txt +24 -0
  10. data/data/LICENSES/big-username-blocklist.txt +25 -0
  11. data/data/LICENSES/corpora.txt +128 -0
  12. data/data/LICENSES/cuss.txt +25 -0
  13. data/data/LICENSES/django-registration.txt +33 -0
  14. data/data/LICENSES/dsojevic-profanity-list.txt +24 -0
  15. data/data/LICENSES/forwardemail.txt +24 -0
  16. data/data/LICENSES/friendly-words.txt +24 -0
  17. data/data/LICENSES/gitea.txt +23 -0
  18. data/data/LICENSES/gitlab.txt +31 -0
  19. data/data/LICENSES/iana-well-known-uris.txt +130 -0
  20. data/data/LICENSES/imsky-wordlists.txt +24 -0
  21. data/data/LICENSES/mottie-github-reserved-names.txt +24 -0
  22. data/data/LICENSES/obscenity.txt +27 -0
  23. data/data/LICENSES/petname.txt +218 -0
  24. data/data/LICENSES/rfc2142.txt +9 -0
  25. data/data/LICENSES/shouldbee.txt +25 -0
  26. data/data/LICENSES/usernames.txt +30 -0
  27. data/data/NOTICE +36 -0
  28. data/data/offensive/README.md +90 -0
  29. data/data/offensive/allowlist/en.txt +727 -0
  30. data/data/offensive/allowlist/es.txt +39 -0
  31. data/data/offensive/en.json +5680 -0
  32. data/data/offensive/es.json +1014 -0
  33. data/data/offensive/hate.yml +51 -0
  34. data/data/offensive/leet.yml +27 -0
  35. data/data/reserved/ALLOWLIST_EXCEPTIONS.txt +6 -0
  36. data/data/reserved/impersonation.txt +69 -0
  37. data/data/reserved/mailboxes.txt +77 -0
  38. data/data/reserved/system.txt +124 -0
  39. data/data/reserved/web.txt +962 -0
  40. data/data/words/adjectives.txt +367 -0
  41. data/data/words/animals.txt +253 -0
  42. data/lib/generators/usernames/availability_generator.rb +67 -0
  43. data/lib/generators/usernames/existing_schema.rb +85 -0
  44. data/lib/generators/usernames/install_generator.rb +241 -0
  45. data/lib/generators/usernames/install_messages.rb +63 -0
  46. data/lib/generators/usernames/locale_generator.rb +56 -0
  47. data/lib/generators/usernames/templates/add_username.rb.erb +53 -0
  48. data/lib/generators/usernames/templates/availability/_field.html.erb.tt +25 -0
  49. data/lib/generators/usernames/templates/availability/availability_controller.rb.tt +107 -0
  50. data/lib/generators/usernames/templates/availability/username_check_controller.js.tt +115 -0
  51. data/lib/generators/usernames/templates/usernames.rb +34 -0
  52. data/lib/tasks/usernames.rake +38 -0
  53. data/lib/usernames/adapters/moderate.rb +37 -0
  54. data/lib/usernames/audit/output.rb +51 -0
  55. data/lib/usernames/audit/values.rb +34 -0
  56. data/lib/usernames/audit.rb +230 -0
  57. data/lib/usernames/candidates.rb +64 -0
  58. data/lib/usernames/comparison/index_contract.rb +241 -0
  59. data/lib/usernames/comparison/index_expression.rb +183 -0
  60. data/lib/usernames/comparison.rb +127 -0
  61. data/lib/usernames/configuration.rb +197 -0
  62. data/lib/usernames/data.rb +205 -0
  63. data/lib/usernames/engine.rb +32 -0
  64. data/lib/usernames/errors.rb +16 -0
  65. data/lib/usernames/generator.rb +206 -0
  66. data/lib/usernames/model.rb +397 -0
  67. data/lib/usernames/normalizer.rb +51 -0
  68. data/lib/usernames/offensive/hate.rb +124 -0
  69. data/lib/usernames/offensive/lexicon.rb +156 -0
  70. data/lib/usernames/offensive/name.rb +254 -0
  71. data/lib/usernames/offensive.rb +136 -0
  72. data/lib/usernames/phrase.rb +68 -0
  73. data/lib/usernames/reserved/listing.rb +79 -0
  74. data/lib/usernames/reserved.rb +219 -0
  75. data/lib/usernames/result.rb +52 -0
  76. data/lib/usernames/rules/options.rb +175 -0
  77. data/lib/usernames/rules.rb +257 -0
  78. data/lib/usernames/unique_violation.rb +176 -0
  79. data/lib/usernames/validator.rb +61 -0
  80. data/lib/usernames/version.rb +5 -0
  81. data/lib/usernames/words.rb +13 -0
  82. data/lib/usernames.rb +138 -0
  83. data/sig/usernames.rbs +75 -0
  84. metadata +217 -0
@@ -0,0 +1,51 @@
1
+ # Hate tokens and numbers. Not subject to allowlist exemptions.
2
+ # Meanings follow the ADL hate-symbol database, the Simon Wiesenthal Center and Wikipedia;
3
+ # nothing of theirs is copied — the rules below are this project's own (data/NOTICE: usernames).
4
+ # A bare number is not evidence (Wiesenthal guide): numbers count only in the forms listed here.
5
+ #
6
+ # W = the compact name with separators removed, leet-folded (data/offensive/leet.yml).
7
+ # R0 = the comparison key before folding; digit runs are read from R0.
8
+
9
+ # Blocked anywhere as a substring of W (all >= 4 letters).
10
+ always:
11
+ - wpww # White Pride World Wide
12
+ - rahowa # "racial holy war"
13
+ - heilhitler
14
+ - siegheil
15
+ - sonnenrad # the "black sun" emblem
16
+ - whitepower
17
+ - waffenss
18
+ - goyimdefense # Goyim Defense League
19
+ - goyimknow
20
+
21
+ # Blocked when the digits form a whole digit run of R0, or two parts joined by one separator
22
+ # (14_88, 14.88, 14-88). Never inside a longer run: 31488210 is a phone fragment.
23
+ digit_runs:
24
+ - "1488"
25
+ - "8814"
26
+
27
+ # A number blocked only when it sits next to one of these tokens (before or after, with or
28
+ # without a separator): hh88, heil88, 88_hitler, combat18, 14words, 14_88.
29
+ adjacent:
30
+ "88": [heil, sieg, hitler, nazi, wp, hh, "14", "18"]
31
+ "14": [words, "88"]
32
+ "18": [combat, "88"]
33
+
34
+ # Blocked only when the token is a whole segment, and only in the listed locale.
35
+ # kkk is laughter in pt-BR; zog is also King Zog of Albania (segment only).
36
+ whole_token:
37
+ en: [kkk, zog]
38
+ es: []
39
+
40
+ # Never blocked on their own: birth years (mike88), ham-radio "88" (love and kisses), the
41
+ # Chinese lucky number, the band 311 (explicitly not hate per the ADL), 1312/ACAB (policy, not
42
+ # hate), 420, 69, 100.
43
+ never:
44
+ - "88"
45
+ - "18"
46
+ - "14"
47
+ - "311"
48
+ - "1312"
49
+ - "420"
50
+ - "69"
51
+ - "100"
@@ -0,0 +1,27 @@
1
+ # Leetspeak folding. Applied to the input AND, at load time, to every term, so terms are stored
2
+ # un-folded in <locale>.json.
3
+
4
+ # Digit → letter. Used by BOTH the reserved impersonation check (its folded spelling) and the offensive matcher.
5
+ digits:
6
+ "0": o
7
+ "1": i
8
+ "3": e
9
+ "4": a
10
+ "5": s
11
+ "7": t
12
+
13
+ # Rewrites used by the offensive matcher ONLY, applied after the digit folds, in this order — to
14
+ # each segment, and again to the whole name once its separators are gone, so `p_huck` is `phuck`
15
+ # is `fuck`. `v` → `u` comes after `vv` → `w`: `fvck` is `fuck`, `vvhore` still `whore`. Then
16
+ # every run of three or more of one letter is cut to two (`fuuuuuck` → `fuuck`, which the
17
+ # stretched variants fold to as well).
18
+ # Measured cost on 235,974 web2 words: vv→w and x→ks add 0 innocent hits, ph→f adds 11.
19
+ offensive_only:
20
+ vv: w
21
+ v: u
22
+ ph: f
23
+ x: ks
24
+
25
+ # Deliberately NOT folded (measured): cl→d (+879 innocent words), rn→m (+30), l↔i (+26),
26
+ # ck→k (+24), and collapsing every double letter (8,053 vs 2,798 baseline; `ass`→`as`) — only runs
27
+ # of three or more are cut.
@@ -0,0 +1,6 @@
1
+ # Reserved words that are also a first name or surname in test/corpora/ and are kept on purpose.
2
+ # One entry per line: `<word> # <reason>`. Generated by script/build_reserved_data.rb.
3
+ # Every other name collision is dropped at build time (nick mac page price win old list ping).
4
+
5
+ # source: usernames (MIT) — deliberate exceptions to the no-real-names rule
6
+ root # Unix superuser and a CA validation mailbox; the impersonation risk outweighs the rare given name
@@ -0,0 +1,69 @@
1
+ # Impersonation words: matched on the whole name, every segment, leet-folded, plural
2
+ # Generated by script/build_reserved_data.rb — edit the script, not this file.
3
+
4
+ # source: usernames (MIT) — staff and authority roles (Mastodon, Discourse and Misskey defaults; facts only)
5
+ admin
6
+ administration
7
+ administrator
8
+ ceo
9
+ cofounder
10
+ employee
11
+ founder
12
+ maintainer
13
+ mod
14
+ moderation
15
+ moderator
16
+ official
17
+ operator
18
+ owner
19
+ root
20
+ staff
21
+ superadmin
22
+ superuser
23
+ sysadmin
24
+ sysop
25
+
26
+ # source: usernames (MIT) — support, trust and safety desks a scammer would pose as
27
+ appeals
28
+ billing
29
+ compliance
30
+ customercare
31
+ customerservice
32
+ customersupport
33
+ help
34
+ helpcenter
35
+ helpdesk
36
+ helpline
37
+ payments
38
+ safety
39
+ security
40
+ support
41
+ trust
42
+ trustandsafety
43
+ verification
44
+ verified
45
+
46
+ # source: usernames (MIT) — platform voices: the system itself, its bots and its announcements
47
+ abuse
48
+ announcement
49
+ announcements
50
+ bot
51
+ donotreply
52
+ hostmaster
53
+ mailerdaemon
54
+ noreply
55
+ notification
56
+ notifications
57
+ postmaster
58
+ system
59
+ team
60
+ webmaster
61
+
62
+ # source: usernames (MIT) — joined compounds that segment matching cannot see (admin_team is caught, adminteam is not)
63
+ adminteam
64
+ modteam
65
+ officialaccount
66
+ safetyteam
67
+ securityteam
68
+ staffteam
69
+ supportteam
@@ -0,0 +1,77 @@
1
+ # Mailbox and role names: matched exactly
2
+ # Generated by script/build_reserved_data.rb — edit the script, not this file.
3
+
4
+ # source: rfc2142 (IETF standards facts) — RFC 2142 role mailboxes
5
+ abuse
6
+ ftp
7
+ hostmaster
8
+ info
9
+ marketing
10
+ news
11
+ noc
12
+ postmaster
13
+ sales
14
+ security
15
+ support
16
+ usenet
17
+ uucp
18
+ webmaster
19
+ www
20
+
21
+ # source: django-registration (BSD-3-Clause) — mailboxes Certificate Authorities accept for domain validation
22
+ admin
23
+ administrator
24
+ is
25
+ it
26
+ mis
27
+ root
28
+ ssladmin
29
+ ssladministrator
30
+ sslwebmaster
31
+ sysadmin
32
+
33
+ # source: django-registration (BSD-3-Clause) — protocol hostnames and no-reply addresses
34
+ imap
35
+ mail
36
+ mailer-daemon
37
+ no-reply
38
+ nobody
39
+ noreply
40
+ pop
41
+ pop3
42
+ smtp
43
+ webmail
44
+
45
+ # source: forwardemail (MIT) — role and no-reply mailbox names (ASCII base names; leet/homoglyph variants are the matcher's job)
46
+ administracion
47
+ billing
48
+ boletins
49
+ bounce
50
+ bounces
51
+ conserje
52
+ contabilidad
53
+ contact
54
+ contacto
55
+ contato
56
+ do-not-reply
57
+ do-not-respond
58
+ donotreply
59
+ donotrespond
60
+ email
61
+ help
62
+ mailer.daemon
63
+ mailerdaemon
64
+ naoresponda
65
+ no-replys
66
+ no_reply
67
+ noreplys
68
+ soporte
69
+ ssl
70
+ suporte
71
+ sys.administrator
72
+ sysadministrator
73
+ system-administrator
74
+ system.administrator
75
+ systemadministrator
76
+ tls
77
+ vendas
@@ -0,0 +1,124 @@
1
+ # System words: matched exactly
2
+ # Generated by script/build_reserved_data.rb — edit the script, not this file.
3
+
4
+ # source: usernames (MIT) — code sentinels and JavaScript prototype keys
5
+ __proto__
6
+ constructor
7
+ false
8
+ hasownproperty
9
+ infinity
10
+ nan
11
+ nil
12
+ none
13
+ null
14
+ prototype
15
+ then
16
+ true
17
+ undef
18
+ undefined
19
+ void
20
+
21
+ # source: usernames (MIT) — mention words: @everyone/@here/@channel/@all (Slack, Mattermost, Discourse, Misskey; facts only)
22
+ all
23
+ channel
24
+ everyone
25
+ here
26
+ mention
27
+ mentions
28
+
29
+ # source: usernames (MIT) — placeholders for deleted or absent users (GitHub's ghost, verified; the rest convention)
30
+ anon
31
+ anonymous
32
+ deleted
33
+ deleted_user
34
+ deleteduser
35
+ ghost
36
+ nobody
37
+ removed
38
+ suspended
39
+ unknown
40
+
41
+ # source: usernames (MIT) — pronoun and name placeholders (Discourse and Misskey defaults; facts only)
42
+ host
43
+ instance
44
+ me
45
+ name
46
+ nickname
47
+ random-username
48
+ server
49
+ user
50
+ username
51
+ you
52
+
53
+ # source: usernames (MIT) — Windows reserved device names (Microsoft Learn, file naming; facts only)
54
+ aux
55
+ com1
56
+ com2
57
+ com3
58
+ com4
59
+ com5
60
+ com6
61
+ com7
62
+ com8
63
+ com9
64
+ con
65
+ lpt1
66
+ lpt2
67
+ lpt3
68
+ lpt4
69
+ lpt5
70
+ lpt6
71
+ lpt7
72
+ lpt8
73
+ lpt9
74
+ nul
75
+ prn
76
+
77
+ # source: usernames (MIT) — Windows built-in accounts (Microsoft Learn; facts only)
78
+ defaultaccount
79
+ guest
80
+ helpassistant
81
+ krbtgt
82
+ wdagutilityaccount
83
+
84
+ # source: usernames (MIT) — Debian base-passwd users and groups, systemd service users (facts only)
85
+ _apt
86
+ adm
87
+ backup
88
+ bin
89
+ daemon
90
+ disk
91
+ games
92
+ irc
93
+ mail
94
+ man
95
+ news
96
+ nogroup
97
+ proxy
98
+ sudo
99
+ sync
100
+ sys
101
+ systemd-coredump
102
+ systemd-journal-remote
103
+ systemd-network
104
+ systemd-oom
105
+ systemd-resolve
106
+ systemd-timesync
107
+ tty
108
+ users
109
+ uucp
110
+ www-data
111
+
112
+ # source: django-registration (BSD-3-Clause) — special hostnames: a username turned subdomain must not hijack client auto-configuration
113
+ autoconfig
114
+ autodiscover
115
+ broadcasthost
116
+ isatap
117
+ localdomain
118
+ localhost
119
+ wpad
120
+
121
+ # source: usernames (MIT) — RFC 2606 / RFC 6761 special-use names (facts only)
122
+ example
123
+ invalid
124
+ test