Commit Graph

30 Commits

Author SHA1 Message Date
Sergi Delgado Segura
2facd61f6c teos - addresses minor comments from #149 2020-06-09 16:59:01 +02:00
Sergi Delgado Segura
08c794590c teos - additional docs 2020-06-03 17:39:27 +02:00
Sergi Delgado Segura
6ea3e8e3ff watcher - simplifies locator_cache and check_breach
locator_cache.blocks was storing a dictionary with both the locator and txid pair, when only the locators were actually necessary. Reworks the code a bit to only use locators.
check_breach was returning some values that could be worked out from the unaltered inputs.

Also fixes some comments and docs.
2020-06-03 17:23:29 +02:00
Sergi Delgado Segura
837f7d428a watcher - Fixes cache setup for regtest
Cache setup in regtest was raising some warnings due to the blocks not being found
2020-06-02 20:05:03 +02:00
Sergi Delgado Segura
5af0658720 watcher - Adds reorg protection for the LocatorCache 2020-05-22 19:57:20 +02:00
Sergi Delgado Segura
76e4780f4c teos - Adds start_block to add_appointment response 2020-05-21 19:39:42 +02:00
Sergi Delgado Segura
708f2e1f3b teos - Changes the behavior for updates of already triggered appointments
If an update for an already triggered appointment is received, it will be drop no matter if the locator is in the cache or not. This tries to prevent inconsistencies between the Watcher and the Responder, specially in the case of a reorg when data may have to flow backwards.
2020-05-21 19:37:33 +02:00
Sergi Delgado Segura
17128edada teos - Renames get_locator to check_locator, adds LocatorCache.init and docstrings 2020-05-21 16:40:36 +02:00
Sergi Delgado Segura
699da54aa0 teos - Adds LocatorCache 2020-05-19 18:24:40 +02:00
Sergi Delgado Segura
9c10f7964f teosd- First bits of locator cache 2020-05-18 20:40:17 +02:00
Sergi Delgado Segura
e7141b295e watcher - wipes completed/expired appointments from the Gatekeeper 2020-04-22 14:55:10 +02:00
Sergi Delgado Segura
96cb8d4afd Adds user_id to ExtendedAppointment after authentication
The ExtendedAppointment is passed to the Watcher without user_id, since the user is not yet authenticated.

The Watcher has to add the user_id to the ExtendedAppointment after the user is authenticated.
2020-04-20 17:59:57 +02:00
Sergi Delgado Segura
797cb9786e Adds new gatekeeper tests 2020-04-20 17:59:47 +02:00
Sergi Delgado Segura
66dce42526 Adds get_summary to extended appointment
The Watcher used to create the summary, but that was not modular enough and introduced issues when testing
2020-04-20 17:58:41 +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
71507d4c32 Gets rid of blob classes. Close #66 2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
630c3f6e0c Fixes last known block initialization on Watcher 2020-04-07 11:40:44 +02:00
Sergi Delgado Segura
75eebf80cd Adds last_known_block to Watcher and stores last block on db on fresh bootstrap Watcher and Responder 2020-04-07 11:40:44 +02:00
Sergi Delgado Segura
fe73ee7298 Fixes comments, docstrings and some renamings 2020-04-02 15:20:09 +02:00
Sergi Delgado Segura
7031b552f7 Splits DBManager in parent and child classes so a UserDBManager can be implemented
- DBManager preserves the basic methods, while the appointment related ones have been moved to AppointmentDBM.
- AppointmentDBM handles json loads and dumps for appointments and trackers, so the corresponding methods can be removed from their classes.
- Updates docs.
2020-04-01 17:18:37 +02:00
Sergi Delgado Segura
b56123055d Adds flake8 and fixes style issues 2020-03-31 13:06:44 +02:00
Sergi Delgado Segura
f55e37b0fc Adds unit test for watcher.get_appointment_summary 2020-03-30 16:22:52 +02:00
Sergi Delgado Segura
e924b57efc Appointment updates only do not decrease slots if not necessary
- For a given appointment, checks if it is an update and computes the difference of sizes if so.
- Additional slots are only filled if the new version is bigger. Slots are freed if the update is smaller.
- Adds get_appoiment_summary to get information in memory information of an appointment (so the API can check if a request is an update)
	- The API computes the uuid and requests it to the tower.
	- Size field has been added to all in memory appointments
2020-03-30 12:49:53 +02:00
Sergi Delgado Segura
a6f9cbf44e Prevents adding the same uuid twice in the map (appointment update) 2020-03-26 19:06:38 +01:00
Sergi Delgado Segura
3d8c0a9498 Applies new uuid apporach to the Watcher 2020-03-26 19:06:38 +01:00
Sergi Delgado Segura
b43731397c Updates teos to work with the new conf file format and redefines how objects are built
Configuration parameters are now load from a .conf file (see template.conf as an example).

The code has 3 config levels: default (teos/__init__.py), config file (<data_dir>/teos.conf) and command line.
Most of the config parameters are only modificable trough the config file for now.
The priority order is: command line, config file, default.

Objects that need config parameters are now built in teosd instead of inside other classes. Therefore teosd acts like a factory and config parameters don't have to be passed around between objects. This also implies that a lot of the object creation logic has been changed.

This should simplify unit testing.
2020-03-20 21:38:28 +01:00
Sergi Delgado Segura
7c7ff909d7 pisa -> teos 2020-03-17 15:47:38 +01:00