The type system was scattered over a number of places, making it hard to
follow. This collects all command types in types.py, and completion, validation
and parsing for each type is centralised. We should use the same mechanism for
options.
The types name is valuable, and we have a better use for it in collecting and
exposing types for options and commands.
The coretypes module should probably be split up anyway - it contains a
threading base class, a few container objects, and the defintion of our
serialization protocol. I was tempted to rename it to "uncagegorized" for the
sake of honesty.
The JS test assets depend in a brittle way on the details of the tflow()
utility functions. We shouldn't have to fix JS tests when adjusting these.
Options:
- Manually generate the test assets in a script.
- Define the JS assets without using tflow, so they don't unexpextedly
vary.
- Remove shortcuts for request, response, etc. - we don't need them if we have completion
- Restrict cuts specification to a set of prefixes
- Extend cuts to add a few more items
This represents a command passed as an argument. Also split arguments from
command values themselves, making the command help for meta-commands much
clearer.
This resolves as a string during MyPy checks, but at runtime has an additional
attribute that is a command that returns valid options.
This is very ugly and clumsy, basically because MyPy is super restrictive about
what it accepts as a type. Almost any attempt to construct these types in a
more sophisticated way fails in one way or another. I'm open to suggestions.
A simple addon that starts an instance of Chrome attached to the current
proxy. The instance is isolated in its own user data directory, and addons are
turned off.
Future work:
- I wasn't able to test the Windows executable path - a Windows dev should
confirm this for us.
- In future it would be nice to support other browsers like Firefox.
- always refresh UI after flow is finished (refs #2616)
- count currently active replay
- make replay thread daemonic so that users can exit mitmproxy
if replay hangs. This is not perfect yet, but vastly better
than how it has been.