grnet / synnefo

Synnefo is open source cloud software, used to create massively scalable IaaS clouds.
GNU General Public License v3.0
133 stars 45 forks source link

[BUGFIX] Add URL regex validator on keypair name #385

Closed kpelelis closed 7 years ago

kpelelis commented 7 years ago

For the time being, Synnefo's API for keypairs (/os-keypairs) supported only English characters(A-Z, a-z), numbers(0-9), dashes(-) and underscores(_). That practice generated some compatibility issues, since some clients such as Vagrant generate key names and append extra characters such as colons(:), spaces( ) etc.

Using OpenStack's Nova implementation, we added a regex generator that accepts a defined range of UTF-8 characters. We can use this validator to further improve the validation and URL checking of various endpoints.

As a showcase we have implemented a leading trailing space validator for the key names that accepts strings that contain at least one non white space character.