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 means foo/bar/baz/3qux is banned, but foo/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.

Process

edit

/msg wmopbot cloak

The web UI allows only selection of:

  1. change vs new
  2. original casing vs lower casing
  3. project prefix

Any issues within the username part of the cloak cannot be corrected by the user.

Bot cloaks are managed by doing cloak from the main account, and then running botcloak <token> from the bot account.

Footnotes

edit
  1. ^ This is a concern for staff, not GCs

Source code references

edit