Commit Graph

55 Commits

Author SHA1 Message Date
Sergi Delgado Segura
07aa9a73ee Adds debug logging of all request to track possible bugs (stored in file only) 2020-02-17 12:21:53 +01:00
Sergi Delgado Segura
6e737b735c Logs real IP if API is behind a reverse proxy 2020-02-15 19:24:20 +01:00
Sergi Delgado Segura
3ba5db533d Fixes json parsing of None when no json was postesd to the API
h/t @yahgwai for finding this.
2020-02-13 18:42:00 +01:00
Sergi Delgado Segura
3b5ff2e92c Removes get_block_count endpoint
get_block_count was only for dummy testing and it's not used anymore
2020-02-13 16:59:06 +01:00
Sergi Delgado Segura
7e29824452 Improves API log and adds logs for get_appointment 2020-02-13 16:51:44 +01:00
Sergi Delgado Segura
6884db9f58 Updates logger codebase-wise to match the Logger updates
Logger instances now specify the logger prefix so the logger can be properly loaded, fixing the issues with the cli file logger
2020-01-23 18:16:25 +01:00
Sergi Delgado Segura
a49f86dd88 Merge branch 'master' into 64-data-to-disk 2020-01-15 12:44:29 +01:00
Sergi Delgado Segura
42a957f555 Merge branch 'master' into chainmonitor 2020-01-15 11:38:32 +01:00
Turtle
c22bf220f0 Move config options used by inspector to the constructor 2020-01-13 02:23:07 -05:00
Sergi Delgado Segura
d9cccfb26a Refactors the API to used the new triggered functions 2020-01-09 18:15:43 +01:00
Sergi Delgado Segura
531523c534 Refactors the API to run using dispatch instead of decorate
The API was never made an object since I couldn't find a way or working around the Flask decorators.

By using dispatch we can get around the issues in #14 and will be able to create better mocks for the API
2019-12-17 17:04:57 +01:00
Sergi Delgado Segura
5c585a7a02 Refactors code to use appointment from common based on f4a1e34e2f4d75226c7e313b83ff5ae06c8c89ca 2019-12-17 16:22:23 +01:00
Sergi Delgado Segura
77b191dde2 Moves Logger to common 2019-12-16 14:15:30 +01:00
Sergi Delgado Segura
e2ca226b11 Last formatting details troughout the codebase 2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
d881706eb3 Refactors the codebase to match the new naming from 793d563b8c053136dd5f936b0ef0cd88af215b06 and 3046eae38ee3f34857c96e6b9d43e645f7d2de2d 2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
f287bdf073 Fixes returns 2019-12-10 12:02:25 +01:00
Sergi Delgado Segura
6e196b25bd Capitalization of returns first char 2019-12-10 10:44:52 +01:00
Sergi Delgado Segura
05dad7d38b Further improvements, including references 2019-12-09 20:08:05 +01:00
Sergi Delgado Segura
641cc3be4f api docstrings 2019-12-09 14:33:31 +01:00
Sergi Delgado Segura
d39056a0cc Refactors signing/verifiying functionality to be part of the Cryptographer
- All encryption/decryption and signing/verifying calls are performed by the cryptographer now.

- The current signature format is temporal. We should define something not base on json.

- Some Cryptographer tests are still missing.

- The cli tests should be modified to fit this too.
2019-12-07 13:22:39 +01:00
Sergi Delgado Segura
b4197aa5bb Replaces hardcoded 16/32 for LOCATOR lengths 2019-12-05 11:26:58 +01:00
Sergi Delgado Segura
babb746dbd Create common package
Moves cryptographer to common. Also adds constants and defines the leghtn of the locator to avoid hardcoding it in almost every file
2019-12-05 11:02:17 +01:00
Sergi Delgado Segura
f0150ce585 Removes hash/cipher configuration and changes AESGCM128 for CHACHA20POLY1305
Updates tests accordingly
2019-12-04 17:46:07 +01:00
Sergi Delgado Segura
c679d59451 Merge branch '59-uncovered-tests' 2019-12-04 14:41:24 +01:00
Sergi Delgado Segura
c663fab788 Return non found if the locator does not fit the proper format 2019-12-04 13:27:06 +01:00
Turtle
7713a3cd47 Server validates appointment signature upon reception 2019-11-26 23:21:07 -05:00
Sergi Delgado Segura
3a1bf0cc8a Updates API to use DB on get methods 2019-11-14 17:38:26 +00:00
Sergi Delgado Segura
20f296c9d4 Reformats code to match code guidelines 2019-11-07 15:47:35 +00:00
Sergi Delgado Segura
f61474216c Fixes and tests updates
Updates tests so they run with the db_manager and fixes some bugs introduced in d7d42c9.
2019-10-28 14:49:40 -07:00
Sergi Delgado Segura
a0538739d2 Starts data persistence integration
The difference between master and the old data-persistence branch was huge, seems more effective to manually cherry pick the changes and integrate them
2019-10-28 14:38:50 -07:00
Salvatore Ingala
b633c89724 Several fixes from PR review 2019-10-23 22:33:34 +08:00
Salvatore Ingala
cd2f3610f9 Merge branch 'testing' into 13-appointment-signature 2019-10-23 09:19:44 +08:00
Sergi Delgado Segura
af0e9c81b5 Adds some missing tests 2019-10-22 16:38:28 +01:00
Salvatore Ingala
9b1af92fc3 Minor fixes 2019-10-22 18:59:27 +08:00
Salvatore Ingala
cbcff453b1 Remove unused import 2019-10-22 14:37:28 +08:00
Salvatore Ingala
8b46c2f496 Merge branch 'testing' into 13-appointment-signature 2019-10-22 12:14:02 +08:00
Sergi Delgado Segura
e5013d5bca Dissables Flask logging 2019-10-21 16:53:29 +01:00
Salvatore Ingala
50d53e0960 Converted response format of add_appointment to json 2019-10-18 10:22:04 +08:00
Sergi Delgado Segura
c09becd7fa Fixes to_dict/to_json for and some fixes 2019-10-17 19:11:32 +01:00
Salvatore Ingala
7c1d8b69c7 Changed to_json to to_dict in Appointment and Job; added to_json to Appointment to actually return a string 2019-10-17 09:59:34 +08:00
Salvatore Ingala
99db9a29ad Added signatures to appointment 2019-10-17 09:59:29 +08:00
Salvatore Ingala
9f25ef8603 Fixes from PR review 2019-10-10 18:22:33 +07:00
Salvatore Ingala
aea1d1f1e0 Fixes from PR review 2019-10-10 11:07:58 +07:00
Salvatore Ingala
dee93e5c62 Moved StructuredMessage and Logger to separate file; refactored pisa-cli logging using new format 2019-10-10 09:59:11 +07:00
Salvatore Ingala
bae9b6b913 Added Logger class; refactored logging accordingly 2019-10-10 09:59:10 +07:00
Salvatore Ingala
2a5dd48950 PEP8 linting 2019-10-10 09:58:27 +07:00
Salvatore Ingala
ed0cb4f632 Changed log format to JSON; fixed missing return value in get_potential_matches 2019-10-10 09:58:27 +07:00
Sergi Delgado Segura
e81ccd39a1 Adds API unit tests and modifies bitcoin_sim to be fixture compatible
- Adds unit tests for API
- Updates API to let BlockProcessor deal with block block related JSON-RPC
- Fixes BlockProcessor get_potential_matches return
- Makes bitcoin_sim runnable via function (instead of a main runnable script) to work with pytests fixture
- <3 Fixture
2019-10-08 18:55:27 +01:00
Sergi Delgado Segura
d2a07d6519 More clean up 2019-10-07 15:36:58 +01:00
Sergi Delgado Segura
e9832e4408 More clean up 2019-10-03 11:47:07 +01:00