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
This commit is contained in:
Sergi Delgado Segura
2020-03-25 12:14:12 +01:00
parent dd53ad68fb
commit 519caec29a
5 changed files with 113 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
# Appointment errors
# Appointment errors [-1, -64]
APPOINTMENT_EMPTY_FIELD = -1
APPOINTMENT_WRONG_FIELD_TYPE = -2
APPOINTMENT_WRONG_FIELD_SIZE = -3
@@ -8,6 +8,10 @@ APPOINTMENT_FIELD_TOO_BIG = -6
APPOINTMENT_WRONG_FIELD = -7
APPOINTMENT_INVALID_SIGNATURE = -8
# Registration errors [-65, -128]
REGISTRATION_MISSING_FIELD = -65
REGISTRATION_WRONG_FIELD_FORMAT = -66
# Custom RPC errors
RPC_TX_REORGED_AFTER_BROADCAST = -98