2013-07-09 01:07:03 |
Auston McReynolds |
description |
https://github.com/openstack/trove/commit/4419cb1c035e430607492dbf066b463b8323d1d5#L2R125
The user's host is validated against the non_empty_string_pattern, which is defined as:
non_empty_string = {
"type": "string",
"minLength": 1,
"maxLength": 255,
"pattern": "^.*[0-9a-zA-Z]+.*$"
}
Previous to this commit, the --host flag was optional (it would conveniently default to '%'). This behavior has been broken, as well as the ability to include wildcards (via % and _).
Per http://dev.mysql.com/doc/refman/5.5/en/account-names.html, '%' and '_' are valid wildcard characters and host_ip/netmask is also an accepted format.
Note: If it was decided that defaulting the host was in poor taste, then the CLI should enforce the host argument (to be consistent) (see https://github.com/openstack/python-troveclient/blob/4ddb58ce9e609df3c0ac4be555f19643ef0511cc/troveclient/cli.py#L159) |
[Description]
https://github.com/openstack/trove/commit/4419cb1c035e430607492dbf066b463b8323d1d5#L2R125
The user's host is validated against the non_empty_string_pattern, which is defined as:
non_empty_string = {
"type": "string",
"minLength": 1,
"maxLength": 255,
"pattern": "^.*[0-9a-zA-Z]+.*$"
}
Previous to this commit, the --host flag was optional (it would conveniently default to '%'). This behavior has been broken, as well as the ability to include wildcards (via % and _).
Per http://dev.mysql.com/doc/refman/5.5/en/account-names.html, '%' and '_' are valid wildcard characters and host_ip/netmask is also an accepted format.
Note: If it was decided that defaulting the host was in poor taste, then the CLI should enforce the host argument (to be consistent) (see https://github.com/openstack/python-troveclient/blob/4ddb58ce9e609df3c0ac4be555f19643ef0511cc/troveclient/cli.py#L159)
[Example]
$ trove-cli user create --id 4a91d343-38bd-4a24-a0b4-942336f1ed03 --name myuser --password myuser --databases mydb --host % --verbose
...
BODY: {
"users": [
{
"databases": [
{
"name": "mydb"
}
],
"host": "%",
"name": "myuser",
"password": "myuser"
}
]
}
RESPONSE HEADERS: {'date': 'Tue, 09 Jul 2013 01:04:29 GMT', 'status': '400', 'content-length': '102', 'content-type': 'application/json; charset=UTF-8'}
RESPONSE BODY : {
"badRequest": {
"code": 400,
"message": "Validation error: u'%' does not match '^.*[0-9a-zA-Z]+.*$'"
}
}
Validation error: u'%' does not match '^.*[0-9a-zA-Z]+.*$' (HTTP 400) |
|