Why are usernames with uppercase not allowed?

some background:

I am involved in running a small art-community (scanlines.xyz) online. the main ‹ space › is a discourse forum, although now we also have a rocketchat room and a peertube instance too. since the forum is the top level i wanted to use everyones existing accounts from discourse as an identity provider for these subspaces.

  • for rocketchat i wrote a small auth-bridge (because their plugin system is quite confusing)
  • for peertube i wrote this auth-plugin (nice work with the plugin system btw it was well documented and quite easy to create what i needed !)

everything was running very smoothly , but today i realised that any user with uppercase letters in their (discourse) username were failing to auth with peertube. been wondering how best to resolve this issue…

…and so also why this is a restriction in the first place ?

a few options i guess:

  • hack peertube to allow uppercases (maybe theres a hard restriction here ? - or maybe it messes with the activitypub / mastodon intergration ?)
  • restrict discourse signups to lowercase and migrate all existing accounts there (a bit of a hassle since this will impact all the rocketchat users too… but possible)
  • maintain some kind of unique map between discourse usernames and valid peertube usernames somehow and hack/intergrate it into my/a plugin … ??? (sounds bit messy lol)

update (will prob go with this option) :

  • since discourse doesnt allow two users with same name / different casing (like i had wrongly assumed), i think it is safe to run a toLowerCase() over the discourse username when passing to peertube auth … ?

Yep I think it will work

1 Like