User:Stwalkerster/Notes on cloaks
The documentation on Meta states:
All cloaks must conform to the DNS hostname specification as described in RFC 1034 and RFC 1035. They may include upper- and lower-case Latin characters, Arabic numerals and dashes. They may not include spaces or underscores; hyphens should be used instead.
Begin only with a letter and contain only DNS compliant characters a–z, A–Z, 0–9 and the hyphen (-)
However, this doesn't seem to paint the entire picture. This is what requirements actually seem to exist in the source code:
- Cloaks cannot be set on MARKed accounts (easily, can be overridden)[note 1]
- Cloaks cannot contain certain special characters (
@
,!
,?
,*
, space,'
,"
)[src 1] - Cloaks cannot be exactly
:
,/
,.
, or empty (NUL first byte) [src 2][src 3] - Cloaks cannot contain ASCII control chars (<32) [src 4][src 5]
- Cloaks must contain at least one of
:
,/
,.
[src 6] - Cloaks cannot be longer than 63 characters[src 7][src 8]
- The character after the last
/
cannot be a digit.[src 9] This meansfoo/bar/baz/3qux
is banned, butfoo/3/2/3/4/.
is technically allowed. (char after last / is not a digit). - The cloak can only contain characters a–z, A–Z, 0–9 and the hyphen (-)[src 10]
- The cloak cannot end in a trailing
/
[src 11]
We don't allow multi-part cloaks (wikipedia/role/user or wikipedia/user/extra) unless it's a bot cloak (wikipedia/user/bot/botname or wikipedia/bot/botname).
This boils down to the following requirements that we as a project care about:
- Cloaks cannot be longer than 63 characters, including the project prefix
- The character after the
/
cannot be a digit. - The cloak can only contain characters a–z, A–Z, 0–9 and the hyphen (-)
Our project prefix is around 10-12 characters (commons is 18!), so this leaves usernames of about 50 characters.
Footnotes
- ^ This is a concern for staff, not GCs
Source code references
- ^ https://github.com/atheme/atheme/blob/master/libathemecore/services.c#L1236-L1239
- ^ https://github.com/atheme/atheme/blob/master/libathemecore/services.c#LL1238C25-L1238C54
- ^ https://github.com/atheme/atheme/blob/master/modules/protocol/solanum.c#L91-L92
- ^ https://github.com/atheme/atheme/blob/master/libathemecore/services.c#L1239
- ^ https://github.com/atheme/atheme/blob/master/libathemecore/function.c#L482-L493
- ^ https://github.com/atheme/atheme/blob/master/modules/protocol/solanum.c#L107
- ^ https://github.com/atheme/atheme/blob/master/libathemecore/services.c#L1244
- ^ https://github.com/atheme/atheme/blob/master/include/atheme/constants.h#L49
- ^ https://github.com/atheme/atheme/blob/master/libathemecore/services.c#L1249-L1254
- ^ https://github.com/atheme/atheme/blob/master/modules/protocol/solanum.c#L94-L101
- ^ https://github.com/atheme/atheme/blob/master/modules/protocol/solanum.c#L103-L105