At the moment the application can only handle only one PiWeather-client.
It must support multiple clients.
This change will require a big number of changes, listed below.
New page: Clients
The clients page will be similar to the users page, the user can add, remove or deactivate clients. Adding clients will create a Client record, and it will generate an API key and a secret key pair.
This pair should be used by the client to authenticate with every request.
The PiWeather-server application should only store the hash of the secret key, so only the user will know it. It will be displayed for the user only once, when the api key is generated.
API keys can be revoked, or just temporary disabled.
The model:
{
id,
name,
description,
api_key,
secret_key (of course just the bcrypted value)
}
Database modifications and a migrator script for the database:
The sensor data tables must contain a new field: client_id which will point to the clients table's id field,
also the aggregated data records must be updated to store the client_id.
A migrator script must be created to migrate the current database.
Dashboard modifications:
The dashboard must be able to display any number of client data.
At the moment the application can only handle only one PiWeather-client.
It must support multiple clients.
This change will require a big number of changes, listed below.
New page: Clients
The clients page will be similar to the users page, the user can add, remove or deactivate clients. Adding clients will create a
Clientrecord, and it will generate an API key and a secret key pair.This pair should be used by the client to authenticate with every request.
The PiWeather-server application should only store the hash of the secret key, so only the user will know it. It will be displayed for the user only once, when the api key is generated.
API keys can be revoked, or just temporary disabled.
The model:
Database modifications and a migrator script for the database:
The sensor data tables must contain a new field:
client_idwhich will point to the clients table's id field,also the aggregated data records must be updated to store the
client_id.A migrator script must be created to migrate the current database.
Dashboard modifications:
The dashboard must be able to display any number of client data.