* Example addon for saving streamed data including a small bug fix to make it work.
* Revert "Example addon for saving streamed data including a small bug fix to make it work."
This reverts commit 02ab78def9a52eaca1a89d0757cd9475ce250eaa.
* Add https_ping_threshold option to enable keep-alive for HTTP/2 server connections by sending PING frames if the conection is idle longer than the threshold.
* Fixed test
* Fix test
* Adding pragma
* Moved timer logic to _http2.py
* Small code improvement
* Update mitmproxy/options.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/options.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/commands.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/commands.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/layers/http/_http2.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Sending Wakup back to right client
* Update mitmproxy/proxy/server.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/server.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/server.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Incorporated suggested changes
Fixed almost all tests
* make `Wakeup` a `CommandCompleted` event.
This allows us to use it with `reply()` in tests,
which makes sure that the correct instance is reused.
# Please enter the commit message for your changes. Lines starting
* nits
`typing.Set` for Python 3.8 compatibility and a few minor stylistic changes.
* nits nits
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* Fix mitmweb export copy failed in non-secure domain
https://github.com/mitmproxy/mitmproxy/issues/5264
* Set the generic type of Promise to void
* move clipboard copy to contrib, adjust for TypeScript
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* add keyboard shortcut n to mitmweb (by creating /flows/create route)
* add keyboard shortcut n to mitmweb (simplified, by using runCommand instead of a new route)
* Add font types to asset filter (~a)
* Add PR number to changelog
* remove flash mention
* restore asset test
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* 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>
I noticed when running tests the output of
`web/src/js/__tests__/ducks/_tflow.ts` would change depending on how I
set my timezone, e.g.
$ TZ=America/Los_Angeles pytest --quiet \
test/mitmproxy/tools/web/test_app.py >/dev/null \
&& grep --extended-regexp 'not(after|before)' web/src/js/__tests__/ducks/_tflow.ts
"notafter": 2235132207,
"notbefore": 1604415807,
$ TZ=Asia/Tokyo pytest --quiet \
test/mitmproxy/tools/web/test_app.py >/dev/null \
&& grep --extended-regexp 'not(after|before)' web/src/js/__tests__/ducks/_tflow.ts
"notafter": 2235074607,
"notbefore": 1604354607
It looks like this is because the `cert_to_json` function simply calls
`timestamp` the `datetime` object from
`x509.Certificate.not_valid_before`, however, this `datetime` object is
not timestamp aware, from the docs [1]:
> A naïve datetime representing the beginning of the validity period for
the certificate in UTC
So when serializing to JSON, first convert the `datetime` to UTC then
call `timestamp`.
A test was added by inspecting one of the test certs with:
$ openssl x509 -in test/mitmproxy/net/data/text_cert_2 -text
Extracting the date and asserting on that.
The corresponding test has also been re-run so that `_tflow.ts` was
regenerated with it's correct value. Snapshots were also updated via:
$(npm bin)/jest --updateSnapshot
[1] https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate.not_valid_after