ncssar / sartopo_python

Python calls for the caltopo / sartopo API
GNU General Public License v3.0
14 stars 2 forks source link

'expires' definition for signed requests is wrong #5

Closed caver456 closed 4 years ago

caver456 commented 4 years ago

Matt confirms, and I confirmed too, that 'expires' in the hash and in the json does NOT refer to the user's account expiration date.

It refers to how long the request is valid for, i.e. so that some nefarious individual or bot cannot make the same request after the 'expires' time. Matt suggests setting it to a couple minutes in the future. So, in python, I'm doing this inside the function that generates each new signed request:

self.expires=int(time.time()*1000)+120000 # 2 minutes from current time, in milliseconds

Anyway at some point I'll put this in a new version of the package, but, the docs should probably be switched out sooner rather than later.

This all came up because I was trying to get the credentials for our team administrator account, and the json returned in the last step of the README at sme-sartopo-mapsrv did not have any subscriptionExpires key for whatever reason.

caver456 commented 4 years ago

README at sme-sartopo-mapsrv has been updated