* add mode spec for WireGuard mode
* add WireGuard server implementation
* remove coverage excludes
* simplify wireguard spec
* lint!
* remove superfluous tests
* bump to mitmproxy_wireguard 0.1.1
* proxy/test_mode_specs: remove unused import
* fix wireguard server mode
* WireGuard: move keyfile gen into `.start()`
This way any file format errors result in `.last_exception` being set.
* fixup UDP support
* bump to mitmproxy_wireguard v0.1.2
This release fixes TCP connections which were broken in v0.1.1.
* fix crash handler
* add simple test for WireGuard server instances
* bump to mitmproxy_wireguard v0.1.5 and fix launching wg-test-client
* fixups
- monkeypatch `handle_client` instead of the handlers.
- fix OS detection
- ctx.log -> logging
* nits
* bump to mitmproxy_wireguard 0.1.6 for fixed test client
* move WireGuardDatagramTransport into dedicated module
this allows us to exclude it from individual coverage, which makes no sense.
Also improve type checking to make sure that it's a full replacement.
* cover WireGuardServerInstance.is_running property with tests
* enable specialized server instance creation
* test wireguard conf generation
* deduplicate tcp/udp handlers
* update CHANGELOG
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* replace blinker with custom implementation
The major benefit here is type checking, followed by proper support for async receivers.
* fix compatibility with Python 3.9
* fix nits
* try harder to force gc
* try harderer
* coverage++
* coverage++
* nits
The major, breaking change is that it is no longer possible to "take" a reply in
order to block the effect of a later addon hook.
This is patch 4/4 of the reply-ectomy.
* Partial gRPC contentview prototype, not linted, no tests, not as add-on
* Linted (flake8)
* Save dev state
* Rewrote of protobuf parser, use decoding strategy, reduced rendered data. Parser uses generators
* minor cleanup
* fix: preferred encoding was provided as function instead of value
* flake8: line length
* Backlinked message tree objects, temporary debug out
* Partial implementation of gRPC definitions. Save state to fix a cras (data invalidate in edit mode)
* hack: deal with missing exception handling for generator based content views
* gRPC/Protoparser descriptions (with test code)
* replaced manual gzip decoding with mitmproxy.net.encoding.decode
* Refactored typing imports
* Reafctoring
* distinguish request vs response definitions, separate view config from parser config
* Code cleaning, moved customized protobuf definitions to example addon
* final cleanup
* changelog
* Stubs for tests
* Fixed render_riority of addon example
* Started adding tests
* Work on tests
* mypy
* Added pseudo encoder to tests, to cover special decodings
* Example addon test added
* finalized tests, no 100 percent coverage possible, see comments un uncovered code
* minor adjustments
* fixup tests
* Typos
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
A common pattern in sans-io is to essentially match on all variants of
an enum, and then have a `else: raise AssertionError` in the end.
This increases robustness as we spot incomplete coverage instead of
silently passing. However, it makes no sense to explicitly test these
asserts.