<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hi</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thank you.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">But ...</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Kallithea generally tries to keep
logins and emails unambiguous and in different namespaces. It is
arguably a bug if Kallithea allows LDAP to use email addresses as
usernames.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">The assumption is probably not entirely
enforced, but it and the consequences show up for example in
get_by_username_or_email .<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">If allowing @ in usernames, it should
perhaps be enforced that it only is allowed if it matches the
email ... but that seems like a hack that would be hard to enforce
and not really feasible.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">But it is already generally possible to
login with email instead of username. Perhaps that doesn't work
with LDAP? Can you set attr_login to point at the email attribute?
Or does that have other bad consequences? Something that could be
fixed instead?<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">/Mads<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 21/02/2023 12:03, <a class="moz-txt-link-abbreviated" href="mailto:svhb@telenet.be">svhb@telenet.be</a>
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1100788871.14329366.1676977415664.JavaMail.zimbra@telenet.be">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt; color: #000000">
<div>Hello, <br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>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. <br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>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. <br>
</div>
<div><br data-mce-bogus="1">
</div>
<div>Since email addresses are used regularly for logging in,
maybe this can be also in the next version of Kallithea. <br
data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>Simply said : just adding @ to the regexp for username does
the job. <br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>--- validators.py 2023-02-21 10:25:27.657212999 +0000<br>
+++ validators_new.py 2023-02-21 10:26:40.560218089 +0000<br>
@@ -92,7 +92,7 @@<br>
msg = self.message('username_exists',
state, username=value)<br>
raise formencode.Invalid(msg, value,
state)<br>
<br>
- if
re.match(r'^[a-zA-Z0-9\_]{1}[a-zA-Z0-9\-\_\.]*$', value) is
None:<br>
+ if
re.match(r'^[a-zA-Z0-9\_]{1}[a-zA-Z0-9\-\_\.@]*$', value) is
None:<br>
msg = self.message('invalid_username', state)<br>
raise formencode.Invalid(msg, value, state)<br>
return _validator<br>
<br data-mce-bogus="1">
</div>
<div>Cheers, <br data-mce-bogus="1">
</div>
<div>Stefaan<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>BTW : this is the best package I encountered since
bitbucket stopped with Hg. <br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
kallithea-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:kallithea-general@sfconservancy.org">kallithea-general@sfconservancy.org</a>
<a class="moz-txt-link-freetext" href="https://lists.sfconservancy.org/mailman/listinfo/kallithea-general">https://lists.sfconservancy.org/mailman/listinfo/kallithea-general</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>