whitespace stripped from the names of keystone objects

Bug #1301275 reported by wanghong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Opinion
Wishlist
wanghong

Bug Description

Currently, the name of project and user has been stripped, however the name of domain, group, service, role does not.

wanghong (w-wanghong)
Changed in keystone:
assignee: nobody → wanghong (w-wanghong)
Revision history for this message
Dolph Mathews (dolph) wrote :

This doesn't have enough detail to be considered a bug, much less reproducible - please be MUCH more specific about what you're referring to.

Changed in keystone:
status: New → Incomplete
Revision history for this message
wanghong (w-wanghong) wrote :

An example of creating user:
curl -i -H "X-Auth-Token:admin" -H "Content-Type:application/json" http://127.0.0.1:35357/v3/users -d '{"user":{"name":" test "}}'

{"user": {"name": "test", "links": {"self": "http://192.168.70.108:5000/v3/users/292a99153cae4b70ade647b8ea90e9b4"}, "enabled": true, "id": "292a99153cae4b70ade647b8ea90e9b4", "domain_id": "default"}}

And another example of creating domain:
curl -i -H "X-Auth-Token:admin" -H "Content-Type:application/json" http://127.0.0.1:35357/v3/domains -d '{"domain":{"name":" test "}}'

{"domain": {"enabled": true, "id": "c9326fb776e44ac2bfa404957e92d89c", "links": {"self": "http://192.168.70.108:5000/v3/domains/c9326fb776e44ac2bfa404957e92d89c"}, "name": " test "}}

Please note the *name* parameter in request and response body. " test " will be stripped when creating user, but it does not when creating domain.

Revision history for this message
Dolph Mathews (dolph) wrote :

Ah, stripping whitespace. I'm not really a fan of that behavior (nor of manipulating any user input), but is it really harming anything?

Changed in keystone:
importance: Undecided → Wishlist
status: Incomplete → Opinion
summary: - strip the name of keystone objects
+ whitespace stripped from the names of keystone objects
Revision history for this message
wanghong (w-wanghong) wrote :

1. I think normal users will not name an object with whitespaces at beginning or end of the string
2. The behavior should be Consistent for all keystone objects
3. It is not possible to distinguish the names if I get list via keystone-client-cmd, for example:
keystone role-list
+----------------------------------+---------------+
| id | name |
+----------------------------------+---------------+
| b0a0d4ae288942e6bc297d206326f0ac | testx |
| 65e7b9166f3e48cbb398859e71de4329 | Member |
| c7d837a83058479f8d0b1fab4520cddf | ResellerAdmin |
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_ |
| b58675d094ca4752b6d9004a9cf4c781 | admin |
| db69e0109b5e4c6da6c49049342c0284 | anotherrole |
| ac4f6f5ef29f440185d29fd8ddc53549 | service |
| 5a04ea124d764c38b89196acb3cf1fda | testx |
+----------------------------------+---------------+

Revision history for this message
wanghong (w-wanghong) wrote :

The one of the testx above is "testx" and another is "testx ".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.