sshutil: allow uppercase usernames (thinking of you thaJeztah)
Signed-off-by: Tibor Vass <tibor@docker.com>v0.8
parent
201482bba9
commit
fbf8ed15a8
|
@ -4,7 +4,7 @@ import (
|
|||
"regexp"
|
||||
)
|
||||
|
||||
var gitSSHRegex = regexp.MustCompile("^[a-z0-9-_]+@[a-zA-Z0-9-.]+:.*$")
|
||||
var gitSSHRegex = regexp.MustCompile("^[a-zA-Z0-9-_]+@[a-zA-Z0-9-.]+:.*$")
|
||||
|
||||
func IsSSHTransport(s string) bool {
|
||||
return gitSSHRegex.MatchString(s)
|
||||
|
|
|
@ -17,7 +17,7 @@ func TestIsSSHTransport(t *testing.T) {
|
|||
require.False(t, IsSSHTransport(""))
|
||||
require.True(t, IsSSHTransport("git@github.com:moby/buildkit.git"))
|
||||
require.True(t, IsSSHTransport("nonstandarduser@example.com:/srv/repos/weird/project.git"))
|
||||
require.True(t, IsSSHTransport("other_funky-username52@example.com:path/to/repo.git/"))
|
||||
require.True(t, IsSSHTransport("other_funky-username52@example.com:/to/really:odd:repo.git/"))
|
||||
require.True(t, IsSSHTransport("other_Funky-username52@example.com:path/to/repo.git/"))
|
||||
require.True(t, IsSSHTransport("other_Funky-username52@example.com:/to/really:odd:repo.git/"))
|
||||
require.True(t, IsSSHTransport("teddy@4houses-down.com:/~/catnip.git/"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue