yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #11807
[Bug 1241218] Re: Keystone doesn't allow any input fields which has ":" or "-"
** Changed in: keystone
Status: New => Invalid
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1241218
Title:
Keystone doesn't allow any input fields which has ":" or "-"
Status in OpenStack Identity (Keystone):
Invalid
Bug description:
If we define a custom field called "My-Filed" and pass it as input
it is getting converted to "My_Field" internally. I believe this
converston should happen only for HTTP headers and not for payload.
e.g
POST /users
{
"name" : "haneef"
"emailAddress" : "a@xxxxx"
"MY-Field" : "MyCustomFiled"
}
Keytone converts the payload to
POST /users
{
"name" : "haneef"
"emailAddress" : "a@xxxxx"
"MY_Field" : "MyCustomFiled"
}
before passing it to identity driver.
commons/wsgi.py
def _normalize_arg(self, arg):
return str(arg).replace(':', '_').replace('-', '_')
That is the function that is converting it. I believe this normalization should happen only for HTTP headers and not for payload
If the create_user call comes to
@controller.protected()
def create_user(self, context, user):
self._require_attribute(user, 'name')
ref = self._assign_unique_id(self._normalize_dict(user))
ref = self._normalize_domain_id(context, ref)
ref = self.identity_api.create_user(ref['id'], ref)
return UserV3.wrap_member(context, ref)
due to normalize_dict, the payload is getting changed. Is it a
bug or keystone doesn't allow "-" , ":" in payload?
To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1241218/+subscriptions