1
0
Fork 0

Minor changes

This commit is contained in:
Ludovic Fernandez 2018-07-03 10:02:03 +02:00 committed by Traefiker Bot
parent bb14ec70bd
commit 17ad5153b8
38 changed files with 93 additions and 182 deletions

View file

@ -72,7 +72,7 @@ func TestBasicAuthFail(t *testing.T) {
Users: []string{"test"},
},
}, &tracing.Tracing{})
assert.Contains(t, err.Error(), "Error parsing Authenticator user", "should contains")
assert.Contains(t, err.Error(), "error parsing Authenticator user", "should contains")
authMiddleware, err := NewAuthenticator(&types.Auth{
Basic: &types.Basic{
@ -131,7 +131,7 @@ func TestDigestAuthFail(t *testing.T) {
Users: []string{"test"},
},
}, &tracing.Tracing{})
assert.Contains(t, err.Error(), "Error parsing Authenticator user", "should contains")
assert.Contains(t, err.Error(), "error parsing Authenticator user", "should contains")
authMiddleware, err := NewAuthenticator(&types.Auth{
Digest: &types.Digest{

View file

@ -20,7 +20,7 @@ func parserBasicUsers(basic *types.Basic) (map[string]string, error) {
for _, user := range userStrs {
split := strings.Split(user, ":")
if len(split) != 2 {
return nil, fmt.Errorf("Error parsing Authenticator user: %v", user)
return nil, fmt.Errorf("error parsing Authenticator user: %v", user)
}
userMap[split[0]] = split[1]
}
@ -40,7 +40,7 @@ func parserDigestUsers(digest *types.Digest) (map[string]string, error) {
for _, user := range userStrs {
split := strings.Split(user, ":")
if len(split) != 3 {
return nil, fmt.Errorf("Error parsing Authenticator user: %v", user)
return nil, fmt.Errorf("error parsing Authenticator user: %v", user)
}
userMap[split[0]+":"+split[1]] = split[2]
}