Commit Graph

1159 Commits

Author SHA1 Message Date
Aldo Cortesi cc8b422d9d multidict: remove to_dict
We never use it, and it is dangerously ambiguous when a key is associated with
a list.
2016-10-21 11:42:21 +13:00
Aldo Cortesi 18ee6255c0 multidict: ditch ImmutableMultiDict
A contorted class we only use for cookie attributes. We don't need it.
2016-10-21 11:40:05 +13:00
Aldo Cortesi 8430f857b5 The final piece: netlib -> mitproxy.net 2016-10-20 11:56:38 +13:00
Aldo Cortesi 853e03a5e7 netlib.tutils -> mitmproxy.test.tutils
There's a LOT more to be done refactoring our different conflicting test utils.
2016-10-20 11:42:55 +13:00
Aldo Cortesi 01a449b5cb netlib.exceptions.* -> mitmproxy.exceptions 2016-10-20 11:27:05 +13:00
Aldo Cortesi 301d52d9d0 netlib.encoding -> netlib.http.encoding
Encoding is highly specific to http, and only used within this module.
2016-10-20 11:06:57 +13:00
Aldo Cortesi f964d49853 netlib.certutils -> mitmproxy.certs 2016-10-20 11:02:52 +13:00
Aldo Cortesi 9870844b38 netlib.utils -> netlib.check
Now only contains is_valid_[host,port]

Intermediate step - this will be in mitproxy.net soon.
2016-10-20 10:46:47 +13:00
Aldo Cortesi e0f3cce14c netlib.utils.[get,set]bit -> mitmproxy.utils.bits 2016-10-20 10:38:57 +13:00
Aldo Cortesi 9555126585 netlib.utils.BiDi -> mitmproxy.types.bidi.BiDi 2016-10-20 10:32:09 +13:00
Aldo Cortesi a684585e7c netlib.debug -> mitmproxy.utils.debug 2016-10-20 10:25:36 +13:00
Aldo Cortesi 1ecb25cdc1 mitmproxy.types.[basethread,multidict,serializable] 2016-10-20 10:22:23 +13:00
Aldo Cortesi f45f4e677e netlib.strutils -> mitmproxy.utils.strutils 2016-10-20 10:11:58 +13:00
Aldo Cortesi 1407830280 netlib.human -> mitmproxy.utils.human 2016-10-20 09:45:18 +13:00
Aldo Cortesi 069119364d Create mitmproxy.utils hierarchy
- Add mitproxy.utils.lrucache, mitproxy.utils.data
2016-10-20 09:35:55 +13:00
Aldo Cortesi e73c7fe77e mitmproxy.protocol -> mitmproxy.proxy.protocol
The protocols here are compltely proxy-specific, are only used from within the
proxy module, and are not exposed to users.
2016-10-19 23:11:56 +13:00
Aldo Cortesi 24cf8da27e Move all tools into mitmproxy.tools, move models/* to top level
The primary motivation here (and for all the other moving around) is to present
a clean "front of house" to library users, and to migrate primary objects to
the top of the module hierarchy.
2016-10-19 20:26:05 +13:00
Aldo Cortesi 5a68d21e8c Remove flow module entirely, move contents to top level
mitmproxy.flow.io -> mitmproxy.io
mitmproxy.flow.export -> mitmproxy.export
2016-10-19 15:08:35 +13:00
Aldo Cortesi 7c32d4ea2a flow.state -> addons.state 2016-10-19 14:48:42 +13:00
Aldo Cortesi 22eebfd574 addons.Addons -> addonmanager, builtins -> addons 2016-10-19 14:39:39 +13:00
Aldo Cortesi 966418725b controller.Log -> log.Log 2016-10-19 14:14:59 +13:00
Aldo Cortesi bce387a5a0 Kill flow.master - create master.Master
Also extract events into .events
2016-10-19 13:22:50 +13:00
Aldo Cortesi 264a09e778 Let's dispense with this fiction that we support multiple servers
It's simple enough to re-add if needed, and until then is just cruft.
2016-10-19 12:37:32 +13:00
Aldo Cortesi 87629586ae web app cleanups: tests and examples 2016-10-19 11:48:51 +13:00
Aldo Cortesi ceb8caee98 Web apps to addons
This commit removes the app registry, adds a wsgiapp addon base, and ports the
onboarding app to it.
2016-10-19 11:40:51 +13:00
Aldo Cortesi 03cb5bb325 No need for all builtins to be loaded for server tests 2016-10-18 22:30:21 +13:00
Aldo Cortesi 466f5e56a1 Convert flow.state to an addon
A first step, and already many things are much nicer.
2016-10-18 21:51:36 +13:00
Aldo Cortesi d5056c5627 accept_addon -> resume, intercept/resume events 2016-10-18 12:02:35 +13:00
Aldo Cortesi 825b02d495 master.duplicate_flow -> state.duplicate_flow
This is a pure operation on state, and doesn't belong on master.

Part of prep to move state to an addon.
2016-10-18 11:29:51 +13:00
Aldo Cortesi b25d94a6ac Response body streaming to addon 2016-10-18 10:42:05 +13:00
Maximilian Hils beed406058 fix tests 2016-10-17 03:37:42 -07:00
Thomas Kriechbaumer 94c9dd66e6 remove empty lines at beginning of file 2016-10-17 10:32:12 +02:00
Maximilian Hils 758860531a fix socks5 mode with tls 2016-10-16 23:05:51 -07:00
Aldo Cortesi c774a9fec9 python3: clean up super and __future__ 2016-10-17 18:03:07 +13:00
Aldo Cortesi a647b30365 python3: clean up class brackets 2016-10-17 17:37:08 +13:00
Aldo Cortesi fb22f2ff4f Zap object base class 2016-10-17 17:37:08 +13:00
Aldo Cortesi ce98a9219e test & examples: zap six 2016-10-17 16:45:45 +13:00
Aldo Cortesi 9a0195bf64 scripts: keep scripts just after the ScriptLoader in addon chain
We need scripts to run _before_ filestreamer, so we can't just add them to the
end of the chain. This patch also fixes an issue that could cause scripts to be
initialised un-necessarily if only the order of scripts in options changed.
2016-10-16 20:26:06 +13:00
Aldo Cortesi fb69c9c345 docs: overview, classes, arguments 2016-10-16 20:26:06 +13:00
Maximilian Hils e9284ab7ee add regression test for #1605 2016-10-14 01:22:30 -07:00
Aldo Cortesi 89d36713e3 certutils: cap the cert store size at 100 by default
This should be enough to give us reuse without growing infinitely. This is part
of fixing the memory situation in mitmdump.

TODO: There's an opportunity here for a better algorithm, that expires certs
based on least-recently-accessed time, rather than oldest generated time.
2016-10-05 10:44:31 +11:00
Thomas Kriechbaumer 90898f9084 use flt instead of filt for flowfilter expressions 2016-10-04 14:51:04 +02:00
Aldo Cortesi 882c363ec5 debug: Hard exit after debug signal 2016-10-04 16:48:13 +11:00
Aldo Cortesi 7fe09f4d26 Consolidate logging
- Make log event handler work
- Move terminal event log into an addon
- Clean various log related errors and duplications
2016-10-04 13:00:15 +11:00
Aldo Cortesi 2e48b60ff1 Clarify channel interaction pattern
Before this patch, it wasn't clear when the arguments to an event could be
modified, and when a new object should be returned. After this patch, the right
thing to do is to modify the arguments in 99% of cases. The only exception to
this is root_layer, for which we can find a better structure down the track.
2016-10-04 08:13:56 +11:00
Aldo Cortesi 1ae73b9157 Add requestheaders event
HTTP1 only for now, HTTP2 coming next.
2016-10-04 08:13:56 +11:00
Thomas Kriechbaumer 36c04f1631 fix flowfilter.match args 2016-10-03 12:04:17 +02:00
Thomas Kriechbaumer bb60b76af4 use flowfilter.match 2016-10-03 11:45:54 +02:00
Thomas Kriechbaumer ba84248910 rename mitmproxy.filt -> mitmproxy.flowfilter 2016-10-03 11:45:54 +02:00
Maximilian Hils 611dad12a7 Revert "Add API to programmatically create new requests (#1534)"
This reverts commit ccbdcd684b,
which yielded a test timeout.
2016-10-02 23:08:51 -07:00