为什么Subversion不允许在用户名中使用“。”和“@”?或者是吗?

时间:2022-01-17 16:44:45

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.

我们希望在所有开发工具中使用相同的用户ID,但是subversion的这种限制不允许我们将电子邮件地址用作用户名。

6 个解决方案

#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:

这是在创建新的svn存储库时生成的默认authz文件中的示例:

[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.

这为组中的用户提供了对/ baz / fuz中存储库的harry_and_sally读写权限。

#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.

这实际上取决于你如何设置Subversion。 svnserve的标准Subversion内置身份验证可能不允许。和@(我还没试过)。我使用Apache而不是内置的svnserve设置了我的Subversion存储库。在Apache下,您可以使用标准的Apache访问控制,如htpasswd文件,甚至可以与LDAP或Microsoft Active Directory集成。然后,您可以为Subversion用户使用电子邮件地址或AD登录。

#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:

Subversion实际上在内部使用UTF-8来存储其所有数据,包括用户名,因此对用户命名的内容没有任何限制。例如,我刚刚与用户创建了一个提交:

'Й, ק,‎ م, ๗, あ, 叶, 葉, 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.

问题是,其他程序可能会为特殊目的保留某些字符,例如svn passwd文件中的[,=和#。 Subversion可以处理更广泛的用户名,但特定的文件格式不能。如果您发现自己无法使用某些字符,则链接中的某些其他链接(如Apache或IDE或您的数据库)或其他任何链接都会受到限制。

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.

这不是太有用,因为你可能无法轻易修复造成这个或切换工具的任何东西,但现在这种状态是“怪异”。

#4


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

它确实允许“。”在用户名中,从未尝试@。

#5


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

在我的$ JOB公司电子邮件地址是Subversion的标准用户名,所以它必须工作。

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.

但是,在我的团队中,我们坚持要求我们的(也是公司范围的)Windows用户名,这些用户名不得超过8个字符。像Reallylongfirst.Andlastname@amazing-products.com这样的用户名会在标准的GUI日志查看器中造成可怕的可用性,并且不能与svn blame很好地配合使用。

#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.

构造包含用户名的URI的常用方法是protocol:// user @ host:port / path。 svn也使用它,所以@字符是特殊的。我没有尝试,但我相信你可以逃脱它(如%40)使它工作。但是,IMO使用完整的电子邮件地址作为用户名是一个相当糟糕的主意。如果你在公司内部,为什么不能使用本地部分?对于所有用户来说,其他所有内容都很可能是相同的,因此您只是重复信息 - 并且它不能很好地与日志视图一起使用。

See also RFC 3986.

另请参阅RFC 3986。

#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:

这是在创建新的svn存储库时生成的默认authz文件中的示例:

[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.

这为组中的用户提供了对/ baz / fuz中存储库的harry_and_sally读写权限。

#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.

这实际上取决于你如何设置Subversion。 svnserve的标准Subversion内置身份验证可能不允许。和@(我还没试过)。我使用Apache而不是内置的svnserve设置了我的Subversion存储库。在Apache下,您可以使用标准的Apache访问控制,如htpasswd文件,甚至可以与LDAP或Microsoft Active Directory集成。然后,您可以为Subversion用户使用电子邮件地址或AD登录。

#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:

Subversion实际上在内部使用UTF-8来存储其所有数据,包括用户名,因此对用户命名的内容没有任何限制。例如,我刚刚与用户创建了一个提交:

'Й, ק,‎ م, ๗, あ, 叶, 葉, 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.

问题是,其他程序可能会为特殊目的保留某些字符,例如svn passwd文件中的[,=和#。 Subversion可以处理更广泛的用户名,但特定的文件格式不能。如果您发现自己无法使用某些字符,则链接中的某些其他链接(如Apache或IDE或您的数据库)或其他任何链接都会受到限制。

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.

这不是太有用,因为你可能无法轻易修复造成这个或切换工具的任何东西,但现在这种状态是“怪异”。

#4


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

它确实允许“。”在用户名中,从未尝试@。

#5


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

在我的$ JOB公司电子邮件地址是Subversion的标准用户名,所以它必须工作。

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.

但是,在我的团队中,我们坚持要求我们的(也是公司范围的)Windows用户名,这些用户名不得超过8个字符。像Reallylongfirst.Andlastname@amazing-products.com这样的用户名会在标准的GUI日志查看器中造成可怕的可用性,并且不能与svn blame很好地配合使用。

#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.

构造包含用户名的URI的常用方法是protocol:// user @ host:port / path。 svn也使用它,所以@字符是特殊的。我没有尝试,但我相信你可以逃脱它(如%40)使它工作。但是,IMO使用完整的电子邮件地址作为用户名是一个相当糟糕的主意。如果你在公司内部,为什么不能使用本地部分?对于所有用户来说,其他所有内容都很可能是相同的,因此您只是重复信息 - 并且它不能很好地与日志视图一起使用。

See also RFC 3986.

另请参阅RFC 3986。