opentrace-community / opentrace-cloud-functions

OpenTrace Cloud Functions. Reference implementation of the BlueTrace protocol.
https://bluetrace.io
GNU General Public License v3.0
273 stars 121 forks source link

getHandshakePin problem #17

Closed bedilbek closed 4 years ago

bedilbek commented 4 years ago

As I understood from the flow of the system, the pin that is generated from getHandshakePin function is also used in getUploadToken to validate whether user has a right to upload his history data.

I am curious about this flow. If it's the case that the same pin taken from then getHandshakePin process used as a token via getUploadToken, is't it a bad approach to save that pin in local storage of the device. And why backend should send that pin to the user at getHandshakePin process?

Or if we look from different prespective, let's say we do not use the same pin generated from getHandshakePin to store it as an UploadToken using storeUploadCodes function, so that we will use different tokens generated by Health Authorities instead of those pins. Then, why we need that pin from getHandshakePin?

I understand that maybe I am not understanding the flow fully, so I ask for an advice to shed the light in this situation.

Thanks!

qtangs commented 4 years ago

The 2 functions actually serve distinct purposes:

bedilbek commented 4 years ago

@qtangs Thank you, now I understand the process fully