[openstack-dev] [barbican] Date/time/timezone parsing

John Dennis jdennis at redhat.com
Wed Jun 5 02:13:29 UTC 2013


On 06/04/2013 07:01 PM, John Wood wrote:
> Simo, we were planning to normalize times into UTC prior to putting into datastore, but didn't know if it would be too stringent to make clients also conform to UTC to use the API. Using UTC on both sides of the API does seem safer and more robust overall though, so we could enforce this in our code base for sure.
>
> Would anyone out there object to a UTC-only mode of operation for barbican?

Time values should always be in UTC. The only time (no pun intended) a 
time value should be in local time is when it is displayed to the user 
or accepted as user input, after which it should immediately be 
converted to UTC. Following the rule that time values are always UTC 
will prevent any number of nasty problems that can easily be avoided.

John

>
> Thanks,
> John
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
> ________________________________________
> From: Simo Sorce [simo at redhat.com]
> Sent: Tuesday, June 04, 2013 2:57 PM
> To: OpenStack Development Mailing List
> Subject: Re: [openstack-dev] [barbican] Date/time/timezone parsing
>
> On Tue, 2013-06-04 at 19:50 +0000, John Wood wrote:
>> Hello folks,
>>
>>
>> We noticed that the 'timeutils.py' module's 'parse_isotime()' function
>> in Oslo Incubator doesn't properly parse all ISO8601-compliant
>> strings, or else raise parse errors for non compliant strings.  Has
>> anyone else noticed this behavior?
>>
>>
>> This is a problem for Barbican as we need to precisely know when to
>> expire a secret to avoid unpleasant surprises, but this 'off by a few
>> hours' issue may not be a problem for other parts of OpenStack.
>>
>>
>> For example, if you try to pass a string of the form (no ':mm' after
>> the final 'hh'):
>>
>>
>> YYYY-MM-DDThh:mm:ss±hh
>>
>>
>> ...results in the timezone offset being ignored. Likewise for this
>> form (single digit timezone):
>>
>>
>> YYYY-MM-DDThh:mm:ss±h:mm
>>
>>
>> ...results in the timezone being ignored.
>>
>>
>> As a concrete example, the following failed to observe the timezone:
>>
>>
>> 013-06-14T12:06:30.629256-5:00
>>
>>
>> whereas this following works:
>>
>>
>> 013-06-14T12:06:30.629256-05:00
>>
> You should always use UTC dates in barbican, using/allowing timezones is
> only going to hit you back, badly.
>
> Simo.
>
> --
> Simo Sorce * Red Hat, Inc * New York
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




More information about the OpenStack-dev mailing list