cozie-app / cozie-apple

https://cozie-apple.app
GNU Lesser General Public License v3.0
15 stars 9 forks source link

Seperate read APIs for the app and for users #47

Closed mariofrei closed 2 years ago

mariofrei commented 2 years ago

Currently, there is only one read API to retrieve data from the database. There are two expected use cases:

  1. Researchers retrieve data for processing e.g., in a Kaggle notebook.
  2. The calls the read API to update the question counter on the "home" page, to update the plots on the "my data" page, and to retrieve a last_sync_datetime which is required to retrieve HealthKit data

For security concerns, these should be two separate APIs with separate sets of credentials. An additional benefit would be that the return body for the app read API could be kept much smaller lowering the time it takes to refresh the question counter and plots.

mariofrei commented 2 years ago

A new AWS API Gateways has been created while migrating the AWS Lambda functions from N. Virginia to Singapore (AWS regions). There are separate APIs for the app and for researchers. In addition, there are multiple API keys available.