Commit Graph

21 Commits

Author SHA1 Message Date
Sergi Delgado Segura
62edf51dbd Adds API HOST and PORT as configurable parameters. Renames them to API_CONNECT and API_PORT for consistency. 2020-04-07 12:29:51 +02:00
Sergi Delgado Segura
b4a453c8de Adds register docs and removes API readme
The TEOS-API README is no longer needed after open-sourcing the server
2020-04-04 13:09:19 +02:00
Sergi Delgado Segura
c74f6a49af Refactors cli to avoid multi-type returns (normal return + None). Adds exceptions for errors. 2020-04-03 21:57:38 +02: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
18e9a0fe5f Removes 2kib restriction from readmes 2020-03-31 17:51:19 +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
6096fe5dc5 Fixes config templates
Removes quotation marks ("") from strings in the template config files
2020-03-23 17:25:52 +01:00
Sergi Delgado Segura
d2fbcf61e3 Updates READMEs with the new config file apporach 2020-03-23 17:15:46 +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
00a48ce6f5 Modifies ConfigParser so config file is passed as parameter (to be used by both teos and cli)
- Modifies ConfigParser
- Adapts __init__ and teosd at teos/
2020-03-21 22:02:46 +01:00
Sergi Delgado Segura
5ff33ad5cf Gets rid of sample_confs and add defaults confs 2020-03-18 18:33:38 +01:00
Sergi Delgado Segura
6d6fa9f728 Update missing readmes and circleci
- Some apps intances were not removed
- requeriment paths were wrong in circleci and some apps path needed to be removed
2020-03-18 16:26:48 +01:00
Sergi Delgado Segura
90ec15923e Move requeriments to root and creates readmes 2020-03-18 16:25:52 +01:00
Sergi Delgado Segura
5e5ff0278a Removes apps folder 2020-03-18 12:09:58 +01:00