Commit Graph

16 Commits

Author SHA1 Message Date
Sergi Delgado Segura
0e5a99b778 Fixes potential runtime errors for dictionaries changing size 2020-04-21 13:40:43 +02:00
Sergi Delgado Segura
797cb9786e Adds new gatekeeper tests 2020-04-20 17:59:47 +02:00
Sergi Delgado Segura
8fad4d79cc Small fixes and docs 2020-04-20 17:58:40 +02:00
Sergi Delgado Segura
3f15459f2c Creates ExtendedAppointment as an appointment with user information 2020-04-20 17:58:16 +02:00
Sergi Delgado Segura
9cbd9ed18a Adds end time to the user (subscription) information. It will replace the appointment one. 2020-04-20 17:56:58 +02:00
Sergi Delgado Segura
08701f0fee Refactors Cryptographer to remove logs and avoid multi return types
Cryptographer now uses exceptions to report errors and does not use the log anymore
2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
10e856ae74 Fixes typos according to the review 2020-04-03 16:38:46 +02:00
Sergi Delgado Segura
fe73ee7298 Fixes comments, docstrings and some renamings 2020-04-02 15:20:09 +02:00
Sergi Delgado Segura
a46bab6b20 Adds user database and modifies registered_user content to be a dict instead of an int
Future additional data may be stored, so it's better if we store it as something that can hold it
2020-04-01 18:25:14 +02:00
Sergi Delgado Segura
33966e59e1 Moves (and renames) check_user_pk to common so cli can use it too. Fixes the regex so it only accepts {02, 03} as prefix 2020-03-30 13:06:01 +02:00
Sergi Delgado Segura
6547e75a19 Adds user exist restriction to fill/free slots and update comments/docs 2020-03-27 17:28:07 +01:00
Sergi Delgado Segura
4c21326974 Moves slots added on register from gatekeeper to config 2020-03-27 14:57:11 +01:00
Sergi Delgado Segura
9bc3bf2e6e Refactors and improves the gatekeeper
Following the same apporach as the Inspector, the gatekeeper now raises exceptions depending on the error encountered.
Also generalises `identify_user` so it can be used with any kind of user-signed message.
Finally lifts the restriction of having available slots on `identify_user` (that only applied to `add_appointent`).
2020-03-26 17:21:18 +01:00
Sergi Delgado Segura
f7260bc1ce Improves and simplifies add_appointment 2020-03-25 21:16:50 +01:00
Sergi Delgado Segura
83b3913cb5 Adds basic authentication logic.
+ Users need to be registered in order to send appointments (free registration for now)
+ The tower gives them a number of appointments to work with
+ Non-registered users and users with no enough appoitnemnts slots return the same error (to avoid proving)

- Authentication does not cover get_* requests yet
- No tests
- No docs
2020-03-25 17:13:35 +01:00
Sergi Delgado Segura
519caec29a Adds basic register logic
- Adds register endpoint in the API
- Adds the Gatekeeper to keep track of registered user and allow/reject access
- Adds registration errors
- Updates API unit tests
- Refactors some methods of the API to reduce code replication
2020-03-25 12:14:12 +01:00