gitblit-org / gitblit

pure java git solution
http://gitblit.com
Apache License 2.0
2.28k stars 670 forks source link

Using E-mail address as LDAP username prevents personal repositories from working. #810

Open gitblit opened 9 years ago

gitblit commented 9 years ago

Originally reported on Google Code with ID 514

What steps will reproduce the problem?
1.  Configure Gitblit against an LDAP server, specifically configuring the realm.ldap.uid
parameter to an e-mail value.
2.  Log in as any user using the e-mail address and password.
3.  Attempt to create a new repository.  This fails to validate or submit with "Illegal
character '@' in repository name!"

What is the expected output? What do you see instead?

I would expect that unacceptable characters would be encoded or stripped - or at least
have the option to use an alternate LDAP attribute for the repository name without
having to change what users use to log in.
If there is macro syntax for the properties file that would allow me to strip out the
@ from the user's ID, I could run with that as well.

What version of the product are you using? On what operating system?

GitBlit 1.6.0

$ lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release:        6.5
Codename:       Santiago

Please provide any additional information below.

Reported by chsh1ca on 2014-10-08 18:11:14

gitblit commented 9 years ago
Using the email address as the account name is not a supported/designed use which is
why it doesn't work correctly.  Unfortunately, I believe there are many corner-cases
in the code where the extraction/sanitization method you are proposing would be a problem.

Why do you want to set account names to addresses?  Is it because your ldap auto-generates
account names?  Or were you looking to be able to login to Gitblit using an email address?
 Logging in via the user email address is something I would entertain supporting -
but you'd still have to setup a valid username.

Reported by James.Moger on 2014-10-14 20:06:55

gitblit commented 9 years ago
Yes, it's so users can log in via e-mail address instead of using generated account
names.  It would be workable in my case to use e-mail to log in and a uid value as
the repository name. 

Gitblit otherwise works very well using an e-mail address for the user account, it's
only private repositories which do not.

Reported by chsh1ca on 2014-10-14 21:13:24

gitblit commented 9 years ago

Reported by James.Moger on 2014-10-24 12:04:33