trac-hacks / authopenid-plugin

This plugins allows one to login to Trac using OpenID
Other
12 stars 12 forks source link

Plugin generates usernames with spaces or other problematic characters #17

Open sleske opened 10 years ago

sleske commented 10 years ago

The plugin will generate usernames with spaces or other problematic characters, if they are part of the data from the OpenID provider. This will probably cause problems in trac later on: At least spaces and commas will break the CC funtionality of trac (see http://trac.edgewall.org/ticket/9740 ). Other special characters are likely to cause problems as well. The plugin should restrict usernames suitably. Maybe only allow ascii letters and digits, and possibly underscore and hyphen.

dairiki commented 10 years ago

Oof. Most of my usernames have spaces in them.

I'm not sure what the best solution is. I'm open to munging newly created usernames to eliminate problem characters. (It's probably best to replace them by underscores or hyphens rather than just deleting them.)

sleske commented 10 years ago

Yes, fixing usernames by replacing problematic characters seems like the best solution. However, this will have to wait until ticket #14 has been fixed - otherwise existing "bad" usernames will become inaccessible when the plugin generates a new, different username (have a look at my pull request to #14 :wink: ).

Once #14 is fixed, I can probably whip up a patch.