Extract key-loading code to a dedicated class KeyRing in lacre.keyring module.
KeyCache only keeps a static map of identities, making it safe to use in
asynchronous context (and race condition resistant).
Subscribe to FS events from keyring directory using Python Watchdog and when a
modification is observed, reload the key cache.
Since we may receive more than one event about a single modification, keep
directory's last modification to recognise 'false positives'.
Use [default]cache_refresh_minutes configuration parameter to define periods
between cache reloads. After this number of minutes cache will be reloaded.
- Polish implementation of mail operations (lacre/mailop.py). Add two
strategies: InlineOpenPGPEncrypt and MimeOpenPGPEncrypt, to support two modes
of OpenPGP encryption.
- In delivery_plan, only use those strategies that actually make sense with
the recipients we'd got.
- Add flag_enabled predicate (lacre/config.py) to make configuration checks
easier / simpler.
- Handle TypeError errors in Advanced Filter, indicating a delivery failure
when they appear.
- Add type hints to some of the functions.
Extract new functions to match keys using enc_keymap and enc_domain_keymap
configuration sections, another one to look them up directly in GnuPG keyring,
optionally stripping delimiters ("+" followed by a topic).
Add some comments and docstrings.
- Add a dedicated configuration file for lacre.daemon.
- Implement test/daemon_test.py like test/e2e_test.py, to automate the
following procedure:
1. Start up lacre.daemon.
2. For each test case, send test message to the daemon and verify that the
output received by test/utils/relay.py contains expected pattern.
- Simplify Makefile.
- Fix indentation here and there.
In particular, move:
- test utilities to test/utils;
- unit tests to test/modules.
Also: start implementing the Lacre daemon test (just a stub for now).
- Add a "mailop" module to define mail operations. Each should inherit from
MailOperation class (which just defines the contract).
- Make lacre.mailgate.delivery_plan always return KeepIntact strategy to have
a daemon that just forwards messages without modifying them.
- Add sample configuration.
- Include daemon configuration in mandatory parameter check.
First initialise logging, then import lacre.mailgate module. Otherwise,
module's logging quitely initialises its own root logger that doesn't use
configuration provided by the user.
Also: remove unnecessary "global" keywords.
If a user registers their key for address alice@example.com but receives a
message sent to alice+something@example.com, this message should be encrypted
as well.
- Implement delimiter support for GnuPG encryption.
- Add E2E test case for a clear text message delivered to an address with
delimiter.
- Fix minor bug: wrong configuration parameter was retrieved when logging
information about enc_domain_keymap being active.
After each execution, log an entry with information about total seconds from
the start to the end of execution and the value returned by
time.process_time() function, which returns:
sum of the kernel and user-space CPU time
according to the documentation.
This feature can be used to collect stats about Lacre performance.