username allowed characters

svhb at telenet.be svhb at telenet.be
Tue Feb 21 11:03:35 UTC 2023


Hello, 

I'm using LDAP to authenticate users to our system. Out IT-dept hammers on the fact that we need to use the email-address of users to login. 

The login works ok, but when I want to change the settings for a certain user, it complains about a '@' in the user name.A simple patch during docker build solved this issue. 

Since email addresses are used regularly for logging in, maybe this can be also in the next version of Kallithea. 


Simply said : just adding @ to the regexp for username does the job. 

--- validators.py 2023-02-21 10:25:27.657212999 +0000 
+++ validators_new.py 2023-02-21 10:26:40.560218089 +0000 
@@ -92,7 +92,7 @@ 
msg = self.message('username_exists', state, username=value) 
raise formencode.Invalid(msg, value, state) 

- if re.match(r'^[a-zA-Z0-9\_]{1}[a-zA-Z0-9\-\_\.]*$', value) is None: 
+ if re.match(r'^[a-zA-Z0-9\_]{1}[a-zA-Z0-9\-\_\.@]*$', value) is None: 
msg = self.message('invalid_username', state) 
raise formencode.Invalid(msg, value, state) 
return _validator 

Cheers, 
Stefaan 


BTW : this is the best package I encountered since bitbucket stopped with Hg. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20230221/fbb024a3/attachment.html>


More information about the kallithea-general mailing list