Commit Graph

659 Commits

Author SHA1 Message Date
Maximilian Hils
c43a2ef8dc improve flowfilter api: raise on invalid input, add ~all 2021-10-08 17:45:47 +02:00
Maximilian Hils
adfccb90a5 minor fixes 2021-10-08 17:36:16 +02:00
Matthew Hughes
d9cac6fbcd
Make Cert.not{before,after} timezone aware (#4805)
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
2021-09-16 10:53:36 +02:00
Maximilian Hils
0437d2935e make flake8 happy 2021-09-04 00:23:45 +02:00
Maximilian Hils
c0fd6cfc09
Merge pull request #4779 from mhils/mitmweb-tcp
web: add support for viewing tcp flows
2021-08-25 13:35:37 +02:00
Maximilian Hils
89beb31c8e web: make icon column sortable 2021-08-23 18:59:38 +02:00
Maximilian Hils
e483aa544f force less variable calculation 2021-08-23 14:58:56 +02:00
Maximilian Hils
d55aa7ea42 tests++ 2021-08-23 11:48:27 +02:00
Maximilian Hils
3589ec2f58 web: convert everything to TypeScript 2021-08-23 11:01:43 +02:00
Maximilian Hils
c5e3e3d636 web: add backend tests 2021-08-23 09:35:47 +02:00
Maximilian Hils
1f6015d72a web: update dependencies 2021-08-20 18:47:34 +02:00
Maximilian Hils
46cd40f493 web: test coverage++, adjust commandbar 2021-08-20 18:38:22 +02:00
Maximilian Hils
2945ba925b please the coverage gods 2021-08-20 15:10:14 +02:00
Maximilian Hils
3ad4949c0e fix web tests 2021-08-19 19:15:51 +02:00
Maximilian Hils
65aa0a6ef5 major mitmweb upgrades 2021-08-18 17:38:22 +02:00
Maximilian Hils
94172594b3 [web] update fontawesome 2021-08-12 10:16:43 +02:00
zokutyou2@gmail.com
4f5c615818 applied requested changes 2021-07-21 16:53:52 +09:00
zokutyou2@gmail.com
29997bca4b convert components in FlowView, Header, Modal, ValueEditor into typescript 2021-07-19 15:47:30 +09:00
zokutyou2@gmail.com
e0b8a48392 bind "this" to functions in CodeMirror 2021-07-18 16:29:16 +09:00
zokutyou2@gmail.com
5dd2ae7937 make formatTimeStamp function return UTC time when updating snapshot in jest 2021-07-17 16:23:13 +09:00
zokutyou2@gmail.com
ac66678b4d fix bug of not dispatching when type in the field in FilterInput component 2021-07-17 15:59:56 +09:00
zokutyou2@gmail.com
6def195743 convert components in common and ContentView folder into typescript, and modified test 2021-07-17 12:29:11 +09:00
zokutyou2@gmail.com
7ff97d6e08 change CommandBar component into typescript, autoscroll overflowed result to bottom 2021-07-15 22:19:46 +09:00
zokutyou2@gmail.com
4ab49c5239 fix bug related to tab completion 2021-07-15 19:56:49 +09:00
zokutyou2@gmail.com
689fde87a2 move available commands popover to command help 2021-07-15 19:30:21 +09:00
zokutyou2@gmail.com
eec3c35cb1 change command history into mitmproxy's one 2021-07-14 22:03:49 +09:00
zokutyou2@gmail.com
79f4cdd25c display help, description and add tab autocompletion 2021-07-14 21:35:44 +09:00
zokutyou2@gmail.com
9513a6d12c update obsolete snapshot 2021-07-13 22:16:10 +09:00
zokutyou2@gmail.com
91772456df update test 2021-07-13 22:13:07 +09:00
zokutyou2@gmail.com
f0b88833c2 add response to fetchMock 2021-07-13 21:54:55 +09:00
zokutyou2@gmail.com
6670dc0666 include package-lock.json 2021-07-13 21:48:22 +09:00
zokutyou2@gmail.com
a689cbe0b0 fix lintings issue and test 2021-07-13 21:43:28 +09:00
zokutyou2@gmail.com
fc7455b914 transfer the argument suggestion into popup, show available commands, highlight currently typing argument 2021-07-13 20:02:31 +09:00
zokutyou2@gmail.com
5b229c2dcd fix optionsSpec.js 2021-06-26 10:17:58 +09:00
zokutyou2@gmail.com
b9254379a2 include command.js to commit 2021-06-26 09:44:30 +09:00
zokutyou2@gmail.com
22e5989783 fix web test failure 2021-06-26 09:41:19 +09:00
zokutyou2@gmail.com
feb77ed7ea add command bar to mitmweb 2021-06-25 22:06:35 +09:00
Maximilian Hils
e8fd816b97 web: fix options ducks 2021-06-25 13:08:27 +02:00
Maximilian Hils
9b119c3dac web: major upgrades
This commit brings a bunch of under-the-hood mitmweb improvements:

 - migrate large parts of the codebase to typescript
 - introduce modern react testing conventions
 - vendor react-codemirror to silence warnings
 - use esbuild for both bundles and tests
 - move from yarn to npm
 - various fixes across the board
2021-06-21 17:51:47 +02:00
zokutyou2@gmail.com
d6fc9a7b27 clean FlowRow arguments 2021-06-19 09:55:55 +09:00
zokutyou2@gmail.com
3b541a0b87 implement actions to the menu 2021-06-18 22:37:09 +09:00
Maximilian Hils
a034b7c2c1 replace dropdown with popper.js-based implementation 2021-06-16 22:28:29 +02:00
zokutyou2@gmail.com
f69c91cb36 apply requested change 2021-06-14 09:21:55 +09:00
zokutyou2@gmail.com
fffd0017d8 add dropdown submenu 2021-06-13 21:11:52 +09:00
zokutyou2@gmail.com
6824666424 Merge branch 'main' of https://github.com/gorogoroumaru/mitmproxy into hover-menu 2021-06-10 22:17:34 +09:00
zokutyou2@gmail.com
ccb48f3cc3 apply suggested changes 2021-06-10 22:13:49 +09:00
gorogoroumaru
a4f5edb5b7
[mitmweb] Add "one click resume / accept all" button (#4615)
* Add one-click-resume button

* Add one-click-resume button

* update jest snapshot

* update style

* Disable forward button when the flow is not intercepted

* update jest snapshot

* group items in main menu

* add layout for quick actions menu

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2021-06-10 14:59:30 +02:00
zokutyou2@gmail.com
96d6804f5a Merge branch 'main' of https://github.com/gorogoroumaru/mitmproxy into hover-menu 2021-06-10 09:11:06 +09:00
Maximilian Hils
0e9206ceb1 switch to esbuild for bundling 2021-06-09 18:02:05 +02:00
Maximilian Hils
743b409f7f fix some react deprecation warnings 2021-06-09 12:08:41 +02:00