-
Notifications
You must be signed in to change notification settings - Fork 32
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
Allow numbers in usernames #224
base: master
Are you sure you want to change the base?
Conversation
You probably wouldn't want all digit usernames, since those could be confused with UIDs. Also, are there any additional usernames that would need to be reserved if numbers suddenly become valid characters in usernames? |
I don't think we expose a UID anywhere at the OCF though, but it's fair that just to avoid the possibility in case we ever do to make the first character lowercase alphabetical. As far as I can tell we haven't done anything special that would require more reserved usernames either. |
I've changed it so you need to have the first letter be a lowercase character. |
@@ -26,7 +26,6 @@ class TestValidateUsername: | |||
'Ckuehl', | |||
'ckuehl!', | |||
'123123', |
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.
Would this be valid since the regex selects 3-16 digits/lowercase nums?
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.
It's not valid because the validation logic comes from validate_username
. You're right that the regex is lax and I don't really know how to feel about it. On the one hand Kerberos principals can be any printable ASCII so there is nothing stopping us from creating [email protected]
for example, and the method's purpose is to extract that out.
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.
Is the goal of the regex to handle any arbitrary Kerberos principal, or only those which correspond to valid usernames? I must point out that the regex as written won't match hypothetical Kerberos principals which are longer than 16 characters, have hyphens in them, or the like.
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.
That's fair. I think making it tighter and in line with what we allow will be better than in this weird state of not doing either.
@@ -26,7 +26,6 @@ class TestValidateUsername: | |||
'Ckuehl', | |||
'ckuehl!', | |||
'123123', |
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.
Is the goal of the regex to handle any arbitrary Kerberos principal, or only those which correspond to valid usernames? I must point out that the regex as written won't match hypothetical Kerberos principals which are longer than 16 characters, have hyphens in them, or the like.
Here are some additional steps I thought of that may be needed:
|
Considering we don't reserve things like ocflib/ocflib/account/utils.py Line 52 in 309680a
e7staff it worked fine.
|
We do reserve ocflib/ocflib/account/validators.py Line 18 in 309680a
But agree we can consider reserving such leetspeak usernames in a different change. |
Oh huh I stand corrected, thanks. |
I think talking to @nikhiljha, we're a bit hesitant to merge this, as people could use numbers to make their usernames a bit more obfuscated, e.g. |
iirc we do have requirements that username must somewhat match real name and it's automatically enforced somewhere - could possibly be useful to prevent somebody using "adm1n" (the one who exploit it must has a name like Adam Norton or something...) |
E7 wants a group account with a number in the username and I don't see why not.