Commit Graph

89 Commits

Author SHA1 Message Date
Manuel Meitinger 75504e38a2 Merge remote-tracking branch 'upstream/main' into quic 2022-11-18 21:44:18 +01:00
Aldo Cortesi 0bbb0215c1
more mypy (#5724)
Co-authored-by: requires.io <support@requires.io>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-11-13 18:04:34 +00:00
Manuel Meitinger 3d39c52048 [quic] mode tests 2022-10-31 02:23:51 +01:00
Fabio Valentini 2d495c093c
add transparent server mode based on WireGuard (#5562)
* 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>
2022-09-18 17:15:15 +02:00
Maximilian Hils f6ac500698 add HTTP/3 content view 2022-09-13 09:00:09 +02:00
Manuel Meitinger 1706a9b9fe
Unify proxy modes, introduce UDP protocol detection. (#5556)
* [modes] new unified syntax

* [modes] full coverage udp.py

* [modes] mypy and coverage

* [modes] split mode_spec into two files

* [modes] adjust DNS layer

* [modes] add udp layer decision

* [modes] use 1:1 ServerInstances

* [modes] fix paste issue

* [modes] update tests

* [modes] fix typo

* [modes] updated docs

* [modes] fix typo
2022-08-30 05:27:51 +02:00
Maximilian Hils f4dc2f2cfd
Replace blinker with custom implementation (#5528)
* 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
2022-08-16 12:21:55 +00:00
Maximilian Hils e2157ecdff fix individual_coverage on Windows 2022-07-21 15:24:11 +02:00
Maximilian Hils 8ffd2dcaaa windows installer: use 64bit builds 2022-06-28 14:18:40 +02:00
Maximilian Hils 8c151c66a4
add `asyncio_utils.set_current_task_debug_info` (#5392) 2022-06-03 15:20:25 +02:00
Maximilian Hils b3587b52b2 make it black! 2022-04-28 19:11:10 +02:00
Manuel Meitinger 0553b73d36 [dns] 100% coverage 2022-04-23 23:31:41 +02:00
Maximilian Hils fab7016b31 beautify flowtable dns entries
this isn't perfect (the whole table needs to be refactored properly),
but good enough for now.
2022-04-23 20:05:42 +02:00
Manuel Meitinger 30cd490c79 [dns] udp reader tests 2022-03-31 01:45:37 +02:00
Manuel Meitinger 9adf715124 [dns] server config test 2022-03-31 00:44:30 +02:00
Manuel Meitinger 86adb1a5a0 [dns] temporarily exclude dns.py and more tests 2022-03-29 17:00:13 +02:00
Maximilian Hils 9243ba4e25 fix vt code detection on Windows 2022-03-19 17:20:32 +01:00
Maximilian Hils ecd4790cbb
vendor `click.style` instead of depending on click (#5188)
click introduces subdependencies like colorama, this approach is much simpler.
2022-03-16 17:02:53 +00:00
Maximilian Hils 5fc20e3e8c tests++ 2022-03-15 18:43:56 +01:00
Robert Xiao 794c18bec0 Entirely remove the reply system.
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.
2022-02-04 17:30:20 +01:00
mame82 480052f58b
Grpc contentview (#4851)
* 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>
2021-10-12 13:32:56 +02:00
Maximilian Hils 805aed4f6a docs++ 2021-02-13 00:13:37 +01:00
Maximilian Hils ca578181e3 adjust tests, increase coverage 2021-02-05 08:44:17 +01:00
Maximilian Hils 990116b44a update mypy 2021-02-03 23:03:49 +01:00
Thomas Kriechbaumer 24725e94fa fix coverage 2020-12-17 23:50:23 +01:00
Thomas Kriechbaumer df164f42e1 imports cleanup 2020-12-14 23:52:48 +01:00
Thomas Kriechbaumer d159897d98 nuke legacy protocol stack 2020-12-14 22:14:43 +01:00
Thomas Kriechbaumer c35316f85a remove pathod and pathoc 2020-12-13 20:21:11 +01:00
Maximilian Hils 641b1c425b [sans-io] add mode tests, minor fixes 2020-12-12 21:24:21 +01:00
Maximilian Hils efacbca0ca [sans-io] add clientplayback tests 2020-12-12 21:24:21 +01:00
Maximilian Hils 997b496a68 update flake8 and mypy 2020-08-26 23:33:15 +02:00
Maximilian Hils 15270dfaf0 don't count overage for AssertionErrors
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.
2020-07-30 09:07:35 +02:00
Maximilian Hils 5af57cfa99 HTTPRequest -> http.Request, add request.authority 2020-07-16 16:55:15 +02:00
Maximilian Hils 3550bdfe00
Merge pull request #3693 from typoon/fix-command-bar-issue-3259
Improve Command Bar UX
2019-11-21 14:13:08 +01:00
Maximilian Hils 7bf06f8ae0 fix coverage 2019-11-18 05:19:06 +01:00
Maximilian Hils ac22aee2f5 cleanup mypy usage 2019-11-16 15:14:30 +01:00
Maximilian Hils be46008b5e disable overly strict indentation checks 2019-11-15 15:56:55 +01:00
Maximilian Hils 902ef59d01
Move onboardingapp from tornado to flask (#3661) 2019-10-06 14:41:46 +02:00
Thomas Kriechbaumer a54954ee1e fix linting 2019-09-28 12:29:16 +02:00
Thomas Kriechbaumer 2fb2b48a06 bump dependencies 2018-12-02 15:48:20 +01:00
Pietro Francesco Tirenna d5da74645b protobuf: tests implemented, full coverage 2018-07-17 19:23:01 +02:00
Aldo Cortesi bae4a3393f release: include release directory in coverage
With lots of exclusions for now
2018-05-24 19:03:15 +12:00
Maximilian Hils 69726f180a stateobject: use typing, enable tuples and more complex datatypes 2018-01-13 00:33:37 +01:00
Thomas Kriechbaumer 4a3702792c ignore contrib type errors 2017-12-18 09:33:14 +01:00
Ujjwal Verma 5214f544e7 Use wsproto for websockets 2017-12-12 22:09:46 +01:00
Thomas Kriechbaumer 80a8eaa708 bump flake8
closes #2601
2017-10-31 10:58:38 +01:00
Maximilian Hils 930d78b554 Merge pull request #2537 from ujjwal96/content-view
JS beautifier
2017-09-04 19:49:42 +02:00
Maximilian Hils ca91780ff4 do not fail CI for missing newlines
this regularly stalls pull requests and serves no further purpose,
so it needs to go.
2017-09-04 18:08:00 +02:00
Maximilian Hils de006ea8ad move hostname validation into mitmproxy.net.tls 2017-09-04 14:02:43 +02:00
Ujjwal Verma 4587b54aed tests for Proxy config 2017-06-12 01:32:58 +05:30