mitmproxy.types -> mitmproxy.coretypes
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.
This commit is contained in:
parent
1f6656ccb1
commit
978b8d095c
|
@ -11,7 +11,7 @@ from pyasn1.codec.der.decoder import decode
|
|||
from pyasn1.error import PyAsn1Error
|
||||
import OpenSSL
|
||||
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
|
||||
# Default expiry must not be too long: https://github.com/mitmproxy/mitmproxy/issues/815
|
||||
DEFAULT_EXP = 94608000 # = 24 * 60 * 60 * 365 * 3
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import imghdr
|
||||
|
||||
from mitmproxy.contentviews import base
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from . import image_parser
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from mitmproxy.net import http
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from . import base
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from mitmproxy.net.http import url
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from . import base
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
from collections.abc import MutableMapping
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
|
||||
|
||||
class _MultiDict(MutableMapping, metaclass=ABCMeta):
|
|
@ -12,7 +12,7 @@ from mitmproxy import http
|
|||
from mitmproxy import log
|
||||
from mitmproxy.net import server_spec
|
||||
from mitmproxy.proxy.protocol import http_replay
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
|
||||
from . import ctx as mitmproxy_ctx
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import re
|
|||
import time
|
||||
from typing import Tuple, List, Iterable
|
||||
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
|
||||
"""
|
||||
A flexible module for cookie parsing and manipulation.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import re
|
||||
|
||||
import collections
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from mitmproxy.utils import strutils
|
||||
|
||||
# See also: http://lucumr.pocoo.org/2013/7/2/the-updated-guide-to-unicode/
|
||||
|
|
|
@ -3,7 +3,7 @@ from typing import Optional, Union # noqa
|
|||
|
||||
from mitmproxy.utils import strutils
|
||||
from mitmproxy.net.http import encoding
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
from mitmproxy.net.http import headers
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import re
|
|||
import urllib
|
||||
from typing import Optional, AnyStr, Dict, Iterable, Tuple, Union
|
||||
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from mitmproxy.utils import strutils
|
||||
from mitmproxy.net.http import multipart
|
||||
from mitmproxy.net.http import cookies
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import time
|
||||
from email.utils import parsedate_tz, formatdate, mktime_tz
|
||||
from mitmproxy.utils import human
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from mitmproxy.net.http import cookies
|
||||
from mitmproxy.net.http import headers as nheaders
|
||||
from mitmproxy.net.http import message
|
||||
|
|
|
@ -3,7 +3,7 @@ import array
|
|||
import ipaddress
|
||||
|
||||
from mitmproxy.net import check
|
||||
from mitmproxy.types import bidi
|
||||
from mitmproxy.coretypes import bidi
|
||||
|
||||
|
||||
class SocksError(Exception):
|
||||
|
|
|
@ -14,7 +14,7 @@ from OpenSSL import SSL
|
|||
|
||||
from mitmproxy import certs
|
||||
from mitmproxy import exceptions
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
|
||||
socket_fileobject = socket.SocketIO
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from mitmproxy.net import tcp
|
|||
from mitmproxy.utils import strutils
|
||||
from mitmproxy.utils import bits
|
||||
from mitmproxy.utils import human
|
||||
from mitmproxy.types import bidi
|
||||
from mitmproxy.coretypes import bidi
|
||||
from .masker import Masker
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from mitmproxy.proxy.protocol import base
|
|||
from mitmproxy.proxy.protocol import http as httpbase
|
||||
import mitmproxy.net.http
|
||||
from mitmproxy.net import tcp
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
from mitmproxy.net.http import http2, headers
|
||||
from mitmproxy.utils import human
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ from mitmproxy import options
|
|||
from mitmproxy import connections
|
||||
from mitmproxy.net import server_spec
|
||||
from mitmproxy.net.http import http1
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
from mitmproxy.utils import human
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ offload computations from mitmproxy's main master thread.
|
|||
"""
|
||||
|
||||
from mitmproxy import eventsequence
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
|
||||
|
||||
class ScriptThread(basethread.BaseThread):
|
||||
|
|
|
@ -2,7 +2,7 @@ from typing import Any
|
|||
from typing import List
|
||||
from typing import MutableMapping # noqa
|
||||
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
|
||||
|
||||
def _is_list(cls):
|
||||
|
|
|
@ -3,7 +3,7 @@ import time
|
|||
from typing import List
|
||||
|
||||
from mitmproxy import flow
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
|
||||
|
||||
class TCPMessage(serializable.Serializable):
|
||||
|
|
|
@ -3,7 +3,7 @@ from typing import List, Optional
|
|||
|
||||
from mitmproxy import flow
|
||||
from mitmproxy.net import websockets
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
from mitmproxy.utils import strutils, human
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ from mitmproxy.net import tcp, tls
|
|||
from mitmproxy.net import websockets
|
||||
from mitmproxy.net import socks
|
||||
from mitmproxy.net import http as net_http
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
from mitmproxy.utils import strutils
|
||||
|
||||
from pathod import log
|
||||
|
|
|
@ -8,7 +8,7 @@ from mitmproxy.net.http import http2
|
|||
import mitmproxy.net.http.headers
|
||||
import mitmproxy.net.http.response
|
||||
import mitmproxy.net.http.request
|
||||
from mitmproxy.types import bidi
|
||||
from mitmproxy.coretypes import bidi
|
||||
|
||||
from .. import language
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import io
|
|||
import time
|
||||
import queue
|
||||
from . import pathod
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
import typing # noqa
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from mitmproxy.contentviews import auto
|
||||
from mitmproxy.net import http
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from . import full_eval
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from mitmproxy.contentviews import query
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
from . import full_eval
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import re
|
||||
from mitmproxy.types import basethread
|
||||
from mitmproxy.coretypes import basethread
|
||||
|
||||
|
||||
def test_basethread():
|
|
@ -1,5 +1,5 @@
|
|||
import pytest
|
||||
from mitmproxy.types import bidi
|
||||
from mitmproxy.coretypes import bidi
|
||||
|
||||
|
||||
def test_bidi():
|
|
@ -1,6 +1,6 @@
|
|||
import pytest
|
||||
|
||||
from mitmproxy.types import multidict
|
||||
from mitmproxy.coretypes import multidict
|
||||
|
||||
|
||||
class _TMulti:
|
|
@ -1,6 +1,6 @@
|
|||
import copy
|
||||
|
||||
from mitmproxy.types import serializable
|
||||
from mitmproxy.coretypes import serializable
|
||||
|
||||
|
||||
class SerializableDummy(serializable.Serializable):
|
Loading…
Reference in New Issue