Sergi Delgado Segura
c0ada5f818
Improves logging messages
2020-03-30 13:06:35 +02:00
Sergi Delgado Segura
33966e59e1
Moves (and renames) check_user_pk to common so cli can use it too. Fixes the regex so it only accepts {02, 03} as prefix
2020-03-30 13:06:01 +02:00
Sergi Delgado Segura
ae68cd33da
Captures TypeErrors in Cryptographer.get_compressed_pk and adds unit tests
2020-03-27 16:50:47 +01:00
Sergi Delgado Segura
9e798916d1
Fixes API return HTTP return types and messages
2020-03-27 12:07:26 +01:00
Sergi Delgado Segura
bbe93ae3f1
Adds RIPMED160 hash function
2020-03-26 17:13:38 +01:00
Sergi Delgado Segura
4fad6b7b6f
Fixes docstring
2020-03-26 17:09:15 +01:00
Sergi Delgado Segura
83b3913cb5
Adds basic authentication logic.
...
+ Users need to be registered in order to send appointments (free registration for now)
+ The tower gives them a number of appointments to work with
+ Non-registered users and users with no enough appoitnemnts slots return the same error (to avoid proving)
- Authentication does not cover get_* requests yet
- No tests
- No docs
2020-03-25 17:13:35 +01:00
Sergi Delgado Segura
02eefd5807
Moves extend paths from tools to ConfigLoader
2020-03-23 13:04:50 +01:00
Sergi Delgado Segura
8316892ef2
Uses path.join for safely join paths on common/tools
2020-03-23 12:05:39 +01:00
Sergi Delgado Segura
27e249e665
Adds missing try/catch when casting data from config file in ConfigLoader
2020-03-22 19:09:48 +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
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
6499820540
Adds ConfigLoader to handle loading configurations parameters. Switches from conf.py to .conf files
2020-03-20 21:38:22 +01:00
Sergi Delgado Segura
7c7ff909d7
pisa -> teos
2020-03-17 15:47:38 +01:00
Sergi Delgado Segura
b712e3df0c
Changes sign/verify functions to match the ones used by lnd and c-lightning
...
- Replaces cryptography for coincurve for the signature / recovery operations
- Fixes return types of ecrypt, decrypt to be str (gets rid of rtype)
2020-02-21 13:11:06 +01:00
Sergi Delgado Segura
de2036b19b
Fixes cli console log levels so Cryptographer's sensitive info is only logged in disk
2020-02-14 12:42:47 +01:00
Sergi Delgado Segura
02e159faac
Moves EncryptedBlob to common
2020-02-13 16:32:51 +01:00
Sergi Delgado Segura
d447debe54
Temporal fix for Cryptographer logs. Close #91
2020-02-11 20:22:51 +01:00
Sergi Delgado Segura
ab21cbfc8f
Moves load_key_file to Cryptographer and updates pisad to use it
2020-02-10 16:31:48 +01:00
Sergi Delgado Segura
5c75b1f40d
Removes Logger dependency from setup_data_folder
...
Logger was only used to log when a new folder was created, and was making that the setup needed to be done on the main of pisad and cli instead of __init__, which seems a better fit
2020-01-23 20:12:21 +01:00
Sergi Delgado Segura
dce7b4d39e
Adds missing tools docs
2020-01-23 19:00:55 +01:00
Sergi Delgado Segura
1f46e6eb26
Moves logging setup to common
...
The setup it's identical for cli and pisad
2020-01-23 18:14:34 +01:00
Sergi Delgado Segura
fddf2e6968
Fixes logger not properly working for cli
...
The Logger was set to use c_logger and f_logger from pisad, so the cli file logs were never created
2020-01-23 18:13:30 +01:00
Sergi Delgado Segura
a3f2d20499
Moves/adds methods to deal with config to common
2020-01-23 18:05:44 +01:00
Sergi Delgado Segura
2559d143aa
Fixes logging
2020-01-21 19:06:29 +01:00
Sergi Delgado Segura
90e1245a84
Fixes some bugs based on E2E testing
2020-01-16 17:08:44 +01:00
Sergi Delgado Segura
a49f86dd88
Merge branch 'master' into 64-data-to-disk
2020-01-15 12:44:29 +01:00
Turtle
40d7ca1912
Refactor add_appointment cli code
2020-01-15 03:35:31 -05:00
Sergi Delgado Segura
15f9a9efe1
Removes triggered from to_json
...
Triggered has been deatached from the appointment having it's own entry into the db, so not part of the appointment data anymore
2020-01-09 18:13:24 +01:00
Sergi Delgado Segura
a69f1ba28b
Moves appointment to common and creates serialize
...
Appointment serialization used to be part of the cryptographer (signature_format) but it makes more sense to be an appointment method. Therefore cli also need Appointment
Also fixes comments based on reviews
2019-12-17 16:21:54 +01:00
Sergi Delgado Segura
46a7fa824f
Removes unnecessary encoding when unhexlifying
...
binascii.unhexlify(x) is equal to binascii.unhexlify(x.encode())
2019-12-17 11:35:28 +01:00
Sergi Delgado Segura
1184b4648a
Fixes logs and removes redundant tailing dots
2019-12-16 19:45:30 +01:00
Sergi Delgado Segura
a9df67d787
Properly fromats console logs
2019-12-16 19:44:50 +01:00
Sergi Delgado Segura
77b191dde2
Moves Logger to common
2019-12-16 14:15:30 +01:00
Sergi Delgado Segura
b363cc2d94
Adds missing tool tests
2019-12-16 12:57:28 +01:00
Sergi Delgado Segura
d37b6b6de2
Merge branch 'master' into 46-docstrings
2019-12-16 12:02:04 +01:00
Sergi Delgado Segura
a7eb22626e
Some fixes based on review comments
2019-12-16 11:58:14 +01:00
Sergi Delgado Segura
e6fd9f77cf
Fixes return types for cryptographer
2019-12-16 10:25:33 +01:00
Sergi Delgado Segura
83c73d5df4
Docstrings for common package
2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
df5dcbdfe9
Renames dispute_delta to to_self_delay and justice tx to penalty tx
...
Uses the naming convention followed by LN implementations and BOLTs
2019-12-11 12:45:05 +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
a8800ac375
Integrates encryption/decryption within the Cryptographer. Close #63
...
Includes unittests. Also reformats test_inspector to avoid using cli functions
2019-12-06 13:23:02 +01:00
Sergi Delgado Segura
3c95c31bc8
Creates tools shared between client and server side
...
Includes check_txid_format that has been renamed. Close #12 #43
2019-12-06 13:20:58 +01:00
Sergi Delgado Segura
5f7cd7e189
Delete old TODOs
2019-12-05 11:34:44 +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