mirror of
https://github.com/rclone/rclone.git
synced 2025-08-19 01:46:31 +02:00
allow trailing+leading whitespace for passwords - #1717
warn users when they enter passwords with leading/trailing whitespaces Updated config_test.go, removing deprecated test case and updated TestReveal
This commit is contained in:
@@ -107,9 +107,9 @@ func TestReveal(t *testing.T) {
|
||||
in string
|
||||
wantErr string
|
||||
}{
|
||||
{"YmJiYmJiYmJiYmJiYmJiYp*gcEWbAw", "base64 decode failed: illegal base64 data at input byte 22"},
|
||||
{"aGVsbG8", "input too short"},
|
||||
{"", "input too short"},
|
||||
{"YmJiYmJiYmJiYmJiYmJiYp*gcEWbAw", "base64 decode failed when revealing password - is it obscured?: illegal base64 data at input byte 22"},
|
||||
{"aGVsbG8", "input too short when revealing password - is it obscured?"},
|
||||
{"", "input too short when revealing password - is it obscured?"},
|
||||
} {
|
||||
gotString, gotErr := Reveal(test.in)
|
||||
assert.Equal(t, "", gotString)
|
||||
@@ -203,9 +203,6 @@ func TestPassword(t *testing.T) {
|
||||
// Simple check of wrong passwords
|
||||
hashedKeyCompare(t, "mis", "match", false)
|
||||
|
||||
// Check that passwords match with trimmed whitespace
|
||||
hashedKeyCompare(t, " abcdef \t", "abcdef", true)
|
||||
|
||||
// Check that passwords match after unicode normalization
|
||||
hashedKeyCompare(t, "ff\u0041\u030A", "ffÅ", true)
|
||||
|
||||
|
Reference in New Issue
Block a user