Commit Graph

25 Commits

Author SHA1 Message Date
Sergi Delgado Segura
4c66d6c2cd cli - Adds start_block log after an accepted appointment 2020-06-12 12:10:45 +02:00
Sergi Delgado Segura
e91f65048d cli - fixes cli without params
Cli was crashing if no param was provided
2020-05-08 19:43:56 +02:00
Sergi Delgado Segura
5f7a909804 user_pk/client_pk -> user_id and cli/client -> user (when it does not reffer to the software) 2020-04-21 19:05:20 +02:00
Sergi Delgado Segura
32dd5cfc3f Refactors cli to avoid multi-type returns (normal return + None). Adds exceptions for errors. 2020-04-20 17:48:41 +02:00
Sergi Delgado Segura
08c66b6d42 Fixes error logging 2020-04-20 17:30:17 +02:00
Sergi Delgado Segura
a1a87ba9da Can't -> cannot 2020-04-20 17:30:17 +02:00
Sergi Delgado Segura
9afd5b1970 Gets rid of cli_pk file
The public key can be generated from the private, and the latter has to be loaded anyway, so there's no point storing both
2020-04-20 17:30:16 +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
71507d4c32 Gets rid of blob classes. Close #66 2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
472efd847b Typos 2020-04-20 17:01:55 +02:00
Sergi Delgado Segura
bed21e9625 Adds API HOST and PORT as configurable parameters.
Uses API_BIND/API_PORT for the server and API_CONNECT/API_PORT for the user, for consistency.
2020-04-20 17:01:55 +02:00
Sergi Delgado Segura
4a65b2524b Refactors cli to avoid multi-type returns (normal return + None). Adds exceptions for errors. 2020-04-20 16:06:38 +02:00
Sergi Delgado Segura
5f7eb9df10 Minor fixes 2020-04-20 13:58:09 +02:00
Turtle
b6b95a9821 Add get_all_appointments cli command 2020-04-17 15:17:11 -04:00
Sergi Delgado Segura
39f2628b79 Fixes docs and adds register help 2020-04-02 15:15:45 +02:00
Sergi Delgado Segura
b93aa64827 Patches unchanged variable after renaming in 3e32d8a85e 2020-04-02 10:02:11 +02:00
Sergi Delgado Segura
3e32d8a85e Fixes typo in variable and inconsistent return type 2020-03-31 16:54:52 +02:00
Sergi Delgado Segura
b56123055d Adds flake8 and fixes style issues 2020-03-31 13:06:44 +02:00
Sergi Delgado Segura
f8cc099696 Adds register command to cli, modifies get_appointment to work with POST, refactors cli to improve modularity and cleaning the code
- Adds register command
- Modifies get_appointment command to work with POST + adds signature
- Avoids passing config dict to functions if not necessary (passing single parameters instead)
- Moves key loading to main since most of the commands will need the keys now
- Refactors post_appointment and process_post_appointment_request to work with any post request, so it can be reused for both register and get_appointment
- Functions have been rearanged in a more logical order
- Error handling has been improved
2020-03-30 22:20:01 +02:00
Sergi Delgado Segura
dd53ad68fb Fixes bug when dealing with empty JSON requests or empty appointment field
When posting a request via requests.post the json field was dumped to json, but it shouldn't have been since requests deals with this internally. That meant that the requests made by the code didn't match proper JSON.
In line with this, the API was only parsing this type POST requests correctly, making add_appointment to fail if a proper formatted JSON was passed.

On top of that, empty appointments were not checked in the Inspector before trying to get data from them, making it crash if a JSON was posted to add_appointment not containing the `appointment` field. Unit tests for this should be added.
2020-03-24 20:17:03 +01:00
Sergi Delgado Segura
6ee04bd303 Sets add_appointment_endpoint from / to /add_appointment for consistency
Also passes the base_url to add_appointment and get_appointment and builds the full endpoint inside (also for consistency)
2020-03-24 19:03:41 +01:00
Sergi Delgado Segura
d21e947e05 Moves cli show_usage to help.py 2020-03-23 17:15:46 +01:00
Sergi Delgado Segura
f5edaf1bf0 Fixes default HOST to remove the schema from config
The schema now defaults to http if none is defined. Also improves some of the cli docstrings
2020-03-23 17:15:43 +01:00
Sergi Delgado Segura
3d389a92ac Refactors cli to use the new config approach. Adds template.conf 2020-03-21 22:13:22 +01:00
Sergi Delgado Segura
5e5ff0278a Removes apps folder 2020-03-18 12:09:58 +01:00