cinder/cinder/api
PranaliDeore cf67960607 Validate string, integer limit for input parameter
1. Below apis will return 500 error code on passing name or description
   parameters with more than 255 characters:
   a. consisgroup-create
   b. consisgroup-update
   c. cgsnapshot-create
   d. quota-class-update
   e. quota-update
   f. qos-create
   g. volume-manage
   h. volume-transfer

2. Below apis will return 500 error code on passing 'hard_limit' value
   greater than mysql INT type:
   a. quota-class-update
   b. quota-update
   c. encryption-type-create

3. Below apis accept name as string with whitespaces:
   a. consisgroup-create
   b. cgsnapshot-create
   c. qos-create
   d. volume-transfer

4. Type-key api will return 500 error code on passing key or value with
   more than 255 characters.

Added new method
1. validate_name_and_description() in
   cinder.api.openstack.wsgi.Controller to validate length of name and
   description and returned 400 if it exceeds the limit and removing
   leading or trailing whitespaces and string containing only
   whitespaces.
2. validate_string_length() in cinder.api.openstack.wsgi.Controller to
   validate length of string and returned 400 if it exceeds the limit.
3. validate_integer() method in cinder.utils to validate integer
   limit and returned 400 if limit exceeds.

APIImpact
1. For all above apis 400 response will be returned.
2. Earlier it was possible to pass only whitespaces or leading-trailing
   spaces to 'name' parameters and 'key' while updating key-value in
   type-key api.
   Now it will raise 400 error if only whitespaces are passed and will
   remove leading-trailing spaces if present in other cases.

Closes-Bug: 1466351
Closes-Bug: 1463379
Closes-Bug: 1465967
Change-Id: I0c0029d61ba2b293b579d1afffec0bdf062b22a8
2015-08-10 08:51:19 +00:00
..
contrib Validate string, integer limit for input parameter 2015-08-10 08:51:19 +00:00
middleware Use versionutils from oslo.log 2015-06-29 13:10:08 +02:00
openstack Validate string, integer limit for input parameter 2015-08-10 08:51:19 +00:00
schemas Add XML deserializer for qos_manage delete_keys API 2014-05-25 11:37:30 +08:00
v1 Merge "Replace dict(obj.iteritems() with dict(obj)" 2015-06-15 22:37:38 +00:00
v2 Validate name and description string 2015-08-10 01:31:02 -07:00
views Replace dict.iteritems() with dict.items() 2015-06-12 15:18:57 +02:00
__init__.py Logging not using oslo.i18n guidelines 2015-03-19 12:28:12 -05:00
common.py set/unset volume image metadata 2015-07-11 12:13:58 +08:00
extensions.py Replace dict.iteritems() with dict.items() 2015-06-12 15:18:57 +02:00
urlmap.py Fix multi-line docstrings to meet hacking rules 2015-07-30 11:34:16 -05:00
versions.py Fix wrong response with version details 2015-05-27 08:13:34 +08:00
xmlutil.py Replace basestring with six.string_types 2015-06-16 22:37:20 +02:00