Tutorial :Why Subversion doesn't allow “.” and “@” in usernames? Or does it?



Question:

We want to use the same user-id across all our dev tools, but this limitation from subversion is not allowing us to use email addresses as usernames.


Solution:1

Well, since you can create groups consisting of multiple users, and later refer to them by using @<groupname>, I guess having a @ in a regular username may be a problem.

This is from the example in the default authz file generated when creating new svn repository:

[groups]  harry_and_sally = harry,sally  [repository:/baz/fuz]  @harry_and_sally = rw  

Which gives the users in group harry_and_sally read and write permissions to the repository in /baz/fuz.


Solution:2

It really depends on how you set up Subversion. It's possible that the standard Subversion built-in authentication for svnserve does not allow . and @ (I haven't tried). I have set up my Subversion repositories using Apache instead of the built-in svnserve. Under Apache you can use standard Apache access controls like htpasswd files or even integration with LDAP or Microsoft Active Directory. Then you can use e-mail addresses or AD logins for your Subversion users.


Solution:3

Subversion actually uses UTF-8 internally to store all of its data, including the usernames, so there isn't really any restriction on what you can name your users. For example, I just created a commit with the user:

'Й, ק,‎ Ù…, ๗, あ, 叶, è'‰, and 말.'  

The thing is, other programs may reserve certain characters for special purposes, such as [, =, and # in the svn passwd file. Subversion can handle a wider range of usernames, but that particular file format cannot. If you are finding yourself unable to use certain characters, it is a limitation of some other link in the chain, like Apache or your IDE or your database, or whatever.

That isn't too helpful because you probably can't easily fix whatever is causing this or switch tools, but such is the state of "weird" characters these days.


Solution:4

It does allow "." in username, never tried @.


Solution:5

At my $JOB company e-mail address is the standard user name for Subversion, so it must work.

On my team, however, we insisted on being given our (also company-wide) Windows user names which tend to be no longer than 8 characters. User names like Reallylongfirst.Andlastname@amazing-products.com make for terrible usability in standard GUI log viewers and don't play nicely with svn blame.


Solution:6

The usual way to construct URIs containing a username is protocol://user@host:port/path. svn uses this too, so the @ character is special. I haven't tried but I'm rather confident that you could escape it (like %40) to make it work. However, IMO it's a rather bad idea to use complete email addresses as usernames. If you're inside a company, why can't you use the local part? Everything else will most likely be the same for all users, thus you're only repeating information -- and it won't play nicely with log views.

See also RFC 3986.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »