-
Notifications
You must be signed in to change notification settings - Fork 891
feat(usermgmt): allow usernames with "_", "." #5347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If we allow these characters we have to do replaces for them in the app subdomain routes otherwise they won't be valid subdomains. @coadler I think we should add a "normalized" username field which is the username but mangled to be subdomain-safe, and have a unique index on that. Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough context to know what the impact of this change is so I'm removing myself as a reviewer.
I agree. What do you think should happen if a username doesn't conflict but the normalized one does. Should we fail or try and make it unique? |
I don't think we should have the concept of a normalized one... that seems weird to me. Maybe we eliminate the idea of named subdomains and move to a workspace UUID approach? I'm in agreement with this based on POSIX Standards. |
Can I hand this back to someone else who is more familiar with the topics discussed above please? |
On new user creation both must be unique, the username you enter and the hidden "normalized" variant. During migration we can write the migration to avoid conflicts |
Having a hidden "normalized" username field for URLs that is guaranteed to be URL-safe and unique seems like a better option to me, and looks much better in URLs. It is also fairly cheap to implement, just a function to convert a username to a URL-safe version and a migration to apply that retroactively to existing accounts. The standard you linked is about posix filenames not usernames, and even this might not be enough. LDAP for example allows more characters than this in the user name field. |
I can take over on this but I'll wait until kyle makes a decision before starting anything. |
@deansheather what happens if I have:
|
@kylecarbs we would have a unique index on the URL-safe username so the second user couldn't be created. We don't need to write a complicated migration for this since all usernames currently are already URL-safe once lowercased, and we already have a unique index on lowercase. |
I think that rationale is likely to confuse people, TBH. If I can't make my username |
I don't think this is frustrating at all. The error would only occur in deployments that use non-URL-safe usernames and the error message would clearly say "you can't use the username 'kyle' because a user exists with a similar username 'k.y.l.e' which are identical after stripping non-URL-safe characters" or something along those lines. This is a similar problem to capitalized usernames. We allow uppercase characters in usernames at the moment but we unique index on the lowercase username. If someone had the username I don't think it's worth having ugly URLs with random IDs for apps just to support usernames with periods and underscores. The username conflicts seem few and far between so I don't think we should be optimizing for them. We could make support for non-URL-safe characters disabled by default and add a flag/env var to enable it so less people run into the problem to begin with. |
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
Resolves this item of feedback #4307
My RegEx is rusty, so would appreciate a second set of eyes validating..
Related items: