Creating trust with invalid expires_at causes 500 error

Bug #1246831 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Steven Hardy

Bug Description

If you attempt to create a trust with an invalid expires_at field (something which can't be parsed by timeutils.parse_isotime resulting in a ValueError), you get a 500 response

https://github.com/openstack/keystone/blob/master/keystone/trust/controllers.py#L172

2013-10-31 18:12:25.365 4359 ERROR keystone.common.wsgi [-] Unable to parse date string u'bad.123Z'
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi Traceback (most recent call last):
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/common/wsgi.py", line 238, in __call__
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi result = method(context, **params)
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/common/controller.py", line 158, in inner
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi return f(self, context, *args, **kwargs)
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/trust/controllers.py", line 174, in create_trust
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi (trust['expires_at']))
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi File "/opt/stack/keystone/keystone/openstack/common/timeutils.py", line 52, in parse_isotime
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi raise ValueError(unicode(e))
2013-10-31 18:12:25.365 4359 TRACE keystone.common.wsgi ValueError: Unable to parse date string u'bad.123Z'

Steven Hardy (shardy)
Changed in keystone:
assignee: nobody → Steven Hardy (shardy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/55834

Changed in keystone:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/55834
Committed: http://github.com/openstack/keystone/commit/d77be6714af1d741681ba9f7ba0b6c01b244d2b0
Submitter: Jenkins
Branch: master

commit d77be6714af1d741681ba9f7ba0b6c01b244d2b0
Author: Steven Hardy <email address hidden>
Date: Fri Nov 8 14:15:47 2013 +0000

    trusts raise validation error if expires_at is invalid

    Raise an appropriate error when the evaluation of expires_at
    fails, otherwise invalid user input results in a 500 response

    Change-Id: Ibe5b2c5aaed5996e36a680dead85450e3eb9df31
    Closes-Bug: #1246831

Changed in keystone:
status: In Progress → Fix Committed
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-1 → 2014.1
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.