Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Use user-provided timestamp string as-is when calculating server-side signature #24

Closed
achimnol opened this issue Jan 10, 2017 · 0 comments
Labels
Milestone

Comments

@achimnol
Copy link
Member

achimnol commented Jan 10, 2017

Different languages may use slightly different timezone offset formats when generating ISO 8601-style datetime strings. So, after checking timing range (+- 15 minutes to the server time), we need to use the date header value as-is when canonicalizing the request.

Python 3.6:

>>> from datetime import datetime
>>> from dateutil.tz import tzutc
>>> datetime.now(tzutc()).isoformat()
'2017-01-10T06:15:09.189505+00:00'
>>> datetime.now().isoformat()
'2017-01-10T15:15:15.573437'
>>> datetime.utcnow().isoformat()
'2017-01-10T06:15:23.914917'

Javascript

var d = new Date;
console.log(d.toISOString());
// 2017-01-10T06:16:21.828Z
@achimnol achimnol changed the title Use user-provided timestamp string as-is when calculating server-side singature Use user-provided timestamp string as-is when calculating server-side signature Jan 10, 2017
achimnol added a commit that referenced this issue Jan 10, 2017
 * Attach UTC timezone if the parsed datetime object does not have
   tzinfo at all.

 * Use user-provided header value ("raw_date") as-is when generating
   canonicalized request string.
@achimnol achimnol modified the milestone: 0.8 Jan 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant