Closed kpelelis closed 7 years ago
Please add some more tests of valid and not valid non-ASCII names. We are doing the tests to test the key_name_regexp
. Just testing a space is not enough.
I just added some more tests(not pushed yet). I have a question. Should the string u'\u0000 foo'
be acceptable or not? based on the regular expression I think it shouldn't
Null character is a control character. Any string that contains this character is invalid.
LGTM I'll fix the conflict and merge it to develop
According to Open Stack's specifications, the name of a keypair should have at least one non whitespace character and only printable characters. For the time being Synnefo could create a keypair with any name but the URL
/os-keypairs/{key_name}
would match only if thekey_name
contained, letters(A-Z, a-z), numbers(0-9), dashes(-) and/or underscores(_).With the new changes the name is compliant to Open Stack specifications and it will prevent a user of creating a keypair with an invalid name by returning him a 400 Bad Request error. Also the underlying URL now matches the new format.