Commit Graph

168 Commits

Author SHA1 Message Date
Shadab Zafar
bda30efb35 Py3: Use rich comparison methods (__eq__, __lt__) instead of __cmp__ 2016-06-06 00:07:44 +05:30
Aldo Cortesi
a31c183a0f Ditch pathod static assets 2016-06-05 13:28:57 +12:00
Aldo Cortesi
375d7c9741 Remove last vestiges of noapi and noweb from pathod
Also hide HTTP2 freeze bug by making explain configurable in the tests
2016-06-05 13:24:46 +12:00
Aldo Cortesi
48da24ae7e First-order removal of pathod API and app 2016-06-05 13:04:13 +12:00
Shadab Zafar
2dec2db756 Py3: Return path unescaped
[skip appveyor]
2016-06-04 18:31:31 +05:30
Shadab Zafar
1c82231129 Use encode to detect if string is valid ASCII 2016-06-04 12:49:11 +02:00
Shadab Zafar
ae553ef472 Fix Docstring: "inject" can be an action too 2016-06-04 15:23:09 +05:30
Aldo Cortesi
6943d7e397 More explicit name for the tcp.Server handler counter 2016-06-03 13:57:12 +12:00
Aldo Cortesi
e60860e65d Make tcp.Client.connect return a context manager that closes the connection 2016-06-03 12:06:36 +12:00
Aldo Cortesi
36383a6146 Pathod websocket service threads should not be immortal 2016-06-03 11:58:05 +12:00
Aldo Cortesi
c5076f5e01 Implement a service connection handler counter, use it in Pathod test suite
Lots of failures, but that's a good thing.
2016-06-03 11:47:07 +12:00
Aldo Cortesi
c6d15904f3 Merge remote-tracking branch 'upstream/master' into testsuite 2016-06-03 10:19:22 +12:00
Shadab Zafar
8e60a9bca9 Handle the slice object case in TransformGenerator.__getitem__ 2016-06-03 02:00:58 +05:30
Maximilian Hils
5e385405ca please flake8 2016-06-02 09:54:19 -07:00
Maximilian Hils
29c52d98dc Merge remote-tracking branch 'duffer/pathod-lang-generators' 2016-06-02 09:53:22 -07:00
Shadab Zafar
75ce2498e8 Simplify rand_byte by creating a special case for Python 2 2016-06-02 13:34:18 +05:30
Aldo Cortesi
69de78515d Make last_log actually return last log 2016-06-02 19:45:18 +12:00
Shadab Zafar
ec5d931ee3 Remove redundant __getslice__ from TransformGenerator 2016-06-02 13:02:17 +05:30
Shadab Zafar
b510616c69 Py3: Return bytes from FileGenerator
and use __getitem__ instead of __getslice__
2016-06-02 13:00:44 +05:30
Shadab Zafar
a04d7fd166 Py3: Return bytes from RandomGenerator
and use __getitem__ rather than __getslice__
2016-06-02 13:00:02 +05:30
Aldo Cortesi
a7522d9308 pathod.test shouldn't use the API at all 2016-06-02 18:27:51 +12:00
Aldo Cortesi
254614e9f7 Since we have locks over the logs, use direct access rather than API requests to get to them 2016-06-02 18:10:36 +12:00
Aldo Cortesi
40156ce123 Bump error timeout 2016-06-02 17:55:11 +12:00
Aldo Cortesi
5e12384486 Remove debug print 2016-06-02 17:54:34 +12:00
Aldo Cortesi
92decf96dd Add expect_log to the pathod test truss, and use it for last_log 2016-06-02 17:46:37 +12:00
Aldo Cortesi
29bcdc8250 Fix lock over pathod locks
There were basically a nop before... o_O
2016-06-02 16:08:17 +12:00
Aldo Cortesi
09da1febbd Shift a bunch more string-related functions to strutils 2016-06-02 13:04:19 +12:00
Aldo Cortesi
31012d782f Consolidate some functions to strutils.bytes_to_escaped_str 2016-06-02 12:53:12 +12:00
Aldo Cortesi
3d9dbd6a49 xrepr is used exactly once. move to pathoc.py. 2016-06-02 12:37:24 +12:00
Aldo Cortesi
cccdc98426 Utils reorganisation: add netlib.strutils
Extract a number of string and format-related functions to netlib.strutils.
2016-06-02 12:31:41 +12:00
Shadab Zafar
42f16d5d40 Py3: Use six.string_types instead of basestring 2016-05-31 00:49:44 +05:30
Shadab Zafar
769e20f2a9 Py3: Use range from six.moves 2016-05-31 00:41:44 +05:30
Aldo Cortesi
b2f63458fc Move human-friendly format functions to netlib.human, remove redundant implementations 2016-05-31 19:32:08 +12:00
Thomas Kriechbaumer
e2447406cc more style cleanup 2016-05-29 13:43:20 +02:00
Thomas Kriechbaumer
e4045dc7f8 pathod: fix most flake8 offenses 2016-05-28 22:44:28 +02:00
Thomas Kriechbaumer
caee1adeb6 cleanup imports with flake8 2016-05-28 14:43:32 +02:00
Shadab Zafar
4ec56808dd remove str() 2016-05-26 23:07:37 +05:30
Shadab Zafar
1bbb178b6a Remove inner_repr, fixup escape_unprintables 2016-05-26 23:07:37 +05:30
Shadab Zafar
1699592f09 Use escaped_str functions for TokValueLiteral 2016-05-26 23:07:37 +05:30
Shadab Zafar
daaa672d39 Remove Py3 specific check 2016-05-26 23:07:37 +05:30
Shadab Zafar
5c62fabc84 Use BytesIO in pathod app 2016-05-26 23:07:37 +05:30
Shadab Zafar
22e4bc1938 Py3: Handle bytes case in inner_repr 2016-05-26 23:07:37 +05:30
Shadab Zafar
e5cebb81fb Removed wrong import 2016-05-26 23:07:37 +05:30
Shadab Zafar
88e42bab6d Py3: inner_repr and escape_unprintables 2016-05-26 23:07:37 +05:30
Shadab Zafar
f3932b27da Py3: Import and Other misc. stuff 2016-05-26 23:07:37 +05:30
Aldo Cortesi
123e3b130c We don't need 3 slightly different implementations of Data 2016-05-21 11:53:14 +12:00
Thomas Kriechbaumer
55a17b2ed3 fix encoding error on *too* random bytes
This should fix things like:

def __init__(self, val):
    self.val = val.decode("string_escape")
ValueError: Trailing \ in string
pathod/language/base.py:108: ValueError

test/pathod/test_language_websocket.py:83: in fr
    return netlib.websockets.Frame.from_bytes(tutils.render(wf, settings))
test/pathod/tutils.py:123: in render
    r = r.resolve(settings)
pathod/language/websockets.py:179: in resolve
    Key(base.TokValueLiteral(os.urandom(4)))
2016-05-15 10:41:54 -07:00
Maximilian Hils
acab4fea5a fix version.NAME 2016-05-11 13:02:19 -06:00
Maximilian Hils
bc60c26c7b py3++ 2016-04-13 22:34:28 -07:00
Maximilian Hils
35a6d6e7f6 response.msg -> response.reason 2016-04-02 22:54:46 +02:00
Thomas Kriechbaumer
ec68d8b8e4 s/nocover/no cover/g
according to coveralls docs
2016-03-27 12:02:41 +02:00
Maximilian Hils
2ce023a991 py3++ 2016-03-20 22:50:03 +01:00
Maximilian Hils
88d365cfe6 py3++: cStringIO 2016-03-20 19:40:03 +01:00
ikoz
9b970b0303 fix for sslinfo cert chain printing bug - now all certs get printed 2016-03-15 14:40:54 +00:00
Maximilian Hils
d33d3663ec combine projects 2016-02-18 13:03:40 +01:00
Maximilian Hils
294774d6f0 move pathod/.sources to root 2016-02-18 12:29:49 +01:00
Aldo Cortesi
36e070ee25 Pull bin to the top, move pathod examples to examples dir 2016-02-18 10:15:59 +13:00
Maximilian Hils
b7701eb8c1 add combined MANIFEST.in and CHANGELOG 2016-02-17 00:02:18 +01:00
Thomas Kriechbaumer
1785f70a19 fix all libpathod->pathod references 2016-02-16 21:11:19 +01:00
Thomas Kriechbaumer
dedca54099 rename pathod source directory 2016-02-16 20:37:53 +01:00
Maximilian Hils
5101843683 fix wheel creation, re-add MANIFEST.in 2016-02-16 04:28:10 +01:00
Maximilian Hils
4583fa7922 remove MANIFEST.in, move Dockerfile to root 2016-02-16 00:57:42 +01:00
Maximilian Hils
10f9b6faa7 fix release tool, refs #947 2016-02-16 00:22:38 +01:00
Maximilian Hils
3d9a5157e7 use own shields instance, update pathod readme 2016-02-15 21:13:06 +01:00
Maximilian Hils
fc9fa87827 fix ALPN checks 2016-02-15 18:43:06 +01:00
Maximilian Hils
b7af845523 fix appveyor, re-introduce requirements.txt 2016-02-15 18:12:12 +01:00
Maximilian Hils
a1190c3696 adjust travis 2016-02-15 17:06:32 +01:00
Maximilian Hils
d7158f975e move tests into shared folder 2016-02-15 16:34:22 +01:00
Maximilian Hils
95cef3c0e9 merge metadata files 2016-02-15 15:43:59 +01:00
Maximilian Hils
175ce43a30 add pathod 2016-02-15 14:58:49 +01:00
Thomas Kriechbaumer
18a4456397 refactor cmdline tests 2015-06-15 15:50:44 +02:00
Aldo Cortesi
cd481fdd14 Refactor and whitespace 2014-10-24 17:12:54 +13:00
Aldo Cortesi
962a414327 Fix tests, re-add scripts 2014-10-24 14:01:34 +13:00
Maximilian Hils
658a56a1ac use setuptools entrypoints rather than scripts 2014-08-31 02:09:04 +02:00
Aldo Cortesi
e54bf1a804 Adjust for upstream cert store changes, improve cert handling significantly 2014-03-05 15:03:31 +13:00
Aldo Cortesi
0177eb899a Support cert/key combo files in args. Improve argument names in SSLOptions 2014-03-02 15:56:36 +13:00
Aldo Cortesi
091e539a02 Big improvements to SSL handling
- pathod now dynamically generates SSL certs, using the ~/.mitmproxy
cacert
- pathoc returns data on SSL peer certificates
- Pathod certificate CN can be specified on command line
- Support SSLv23
2014-03-02 13:45:35 +13:00
Aldo Cortesi
a1d0da2b53 Expand SSL support
- Cipher suite selection for both pathoc and pathod
- SSL version specification for pathod
- Expose SSLv23 as an option, and use it by default
2014-02-27 18:33:48 +13:00
Maximilian Hils
0c04abb6e4 fix pathod main script 2014-02-08 22:42:27 +01:00
Maximilian Hils
42aede6181 ensure binary read on windows 2013-08-19 19:21:47 +02:00
Aldo Cortesi
9e7f08acea Download path, version flags for both tools. 2013-05-15 18:56:05 +12:00
Aldo Cortesi
1e932e7045 Collect SSL options into an SSLOptions object
Also split SSL cert specifications from SSL service mode - we can now enter SSL
service mode through a proxy CONNECT request as well.
2013-01-05 16:48:49 +13:00
Aldo Cortesi
3886ccae93 Provisional proxy mode support for pathod. 2013-01-05 15:25:09 +13:00
Aldo Cortesi
b07ab253b7 Require requests > 1.0.4
This changes the API slightly, since json is now a method, not a property.
2012-12-31 12:23:42 +13:00
Aldo Cortesi
3f50930dc0 Use .freeze to implement the -e explain flags for pathod and pathoc.
This now prints (in pathoc) or logs (in pathod) a frozen specification that
includes an expanded record of all generated values and locations.
2012-10-31 11:34:58 +13:00
Aldo Cortesi
f5d5cc4988 rparse.py -> language.py 2012-10-05 10:30:32 +13:00
Aldo Cortesi
41f1c66772 Add -q and -r flags to pathod, logging request and respnose bytes.
- These flags also mean that a bytes log is included in the internal log
buffer.
- There's an -x flag to turn on hex dump output in the text logs (does
not affect the log buffer).
2012-10-01 12:48:26 +13:00
Aldo Cortesi
915bcfbd30 Add timeout argument to Pathod, and matching -t command-line option. 2012-10-01 12:01:02 +13:00
Aldo Cortesi
60b016365f Use 24-hour clock for log timestamps. 2012-08-23 17:22:17 +12:00
Aldo Cortesi
d758409b76 Make sure date stamps are added to all logs. 2012-08-23 12:00:16 +12:00
Aldo Cortesi
ea2ca98bea Add -D to daemonize pathod. 2012-08-16 16:07:23 +12:00
Aldo Cortesi
d7db6757b2 Listen on localhost by default. 2012-07-29 17:29:38 +12:00
Aldo Cortesi
bc84cc99cd Handle file access denied in pathod. 2012-07-29 16:10:22 +12:00
Aldo Cortesi
d8c53cbc57 Add an option to specify a log file to pathod. 2012-07-27 14:03:15 +12:00
Aldo Cortesi
3e158211a8 Add a --nohang flag that turns off pauses in response generation. 2012-07-26 20:01:51 +12:00
Aldo Cortesi
eb1f2c3fc4 Add option to specify craft anchor point. 2012-07-24 21:51:43 +12:00
Aldo Cortesi
a950a4d7a3 Add pathod --noapi to turn off the service API. 2012-07-23 23:31:26 +12:00
Aldo Cortesi
190392ea13 Add a --nocraft option to pathod that turns off crafting. 2012-07-23 21:39:31 +12:00
Aldo Cortesi
622a2b5607 Add a --noweb option to turn web iface off, refactor unit tests. 2012-07-23 19:55:33 +12:00
Aldo Cortesi
1c45f5b05c Use policy hook to apply a size limit in pathod, add corresponding cmdline arg. 2012-07-23 15:03:56 +12:00