Kyle Larose
dfea8a1624
handle invalid characeters in encoding
...
When establishing a connection to an SSH server, WebSSH tries to guess
at its encoding using a command sent prior to opening the terminal.
Unfortunately, sometimes this can return data which does not form proper
input for the `encode` function used by `is_valid_encoding` to test
whether the encoding is known.
In particular, we ran in to a case where the server was returning a
string which had a \0 in it when converted to ascii. That raised a
`ValueError` (as opposed to `LookupError`), which was uncaught.
Handle the `ValueError` case as well, treating it as an unknown encoding
so that we fall back on the default.
2023-03-30 10:52:53 -04:00
Sheng
50fc9908eb
Added test_worker_closed
2022-11-21 16:48:49 +08:00
Sheng
9238c01c35
Updated test_failed_weak_ref
2022-11-21 16:39:13 +08:00
Kyle Larose
f0e2ddb821
do not process message for closed workers
...
WsockHandler stores a weak reference to the ssh backend worker. The
worker closes itself if the backend connection closes (e.g. the user
exists the ssh session). That happens in parallel to the websocket
handler processing messages, so it is possible for a message to arrive
when the worker no longer has any strong references, leading to an
exception being thrown.
Handle this case by treating the None worker the same way we do invalid
messages: by simply returning.
2022-11-18 08:55:03 -05:00
Sheng
ccb40d2bed
Support openssh new format key
2019-12-11 09:32:42 +08:00
khuxkm fbexl
b2261367e8
Fix wrong passphrase test
2019-09-06 14:19:24 -04:00
khuxkm fbexl
850dd39f26
Fix test for passphrase
2019-09-06 13:54:24 -04:00
Sheng
ec545ec463
Refactored PrivateKey
2019-07-04 21:53:39 +08:00
Sheng
2b8b978ca2
Added PrivateKey class
2019-06-27 12:52:19 +08:00
Sheng
786b42da7e
Re-raise InvalidValueError for PasswordRequiredException
2019-05-19 20:27:44 +08:00
Sheng
c35f801235
Support custom origin configuration
2019-01-19 16:46:25 +08:00
Sheng
8a8d741230
Refactored method is_forbidden
2019-01-16 22:58:49 +08:00
Sheng
682ddbf65f
Removed function for detecting whether the http(s) server is open to public
2019-01-15 23:02:14 +08:00
Sheng
5c8bd84b95
Added an option for configuring cross-origin websocket level
2019-01-10 22:09:32 +08:00
Sheng
d0542e72c6
Fixed test_get_redirect_url
2018-10-21 14:45:58 +08:00
Sheng
8e4039a24a
Support redirecting http to https
2018-10-21 14:07:44 +08:00
Sheng
40cf1095ff
Use open_to_public to store the status of the http(s) server
2018-10-20 17:54:12 +08:00
Sheng
1f835f5a70
Refactored handler.py
2018-10-19 18:18:55 +08:00
Sheng
68468585ee
Added a command line option xheaders
2018-10-18 20:25:30 +08:00
Sheng
a8a444d7ed
Always reset fbidhttp to False if not open to public
2018-10-18 18:17:42 +08:00
Sheng
5d6f92e529
Move some config variables to handler.py
2018-10-18 15:07:45 +08:00
Sheng
c06bf5311a
Added an option for blocking public non-https requests
2018-10-17 22:39:53 +08:00
Sheng
77b6fbfd85
Block requests not come from trusted_downstream and public non-https requests
2018-10-15 20:14:53 +08:00
Sheng
bb9d193cae
Fixed assertion in rasied exception context
2018-10-14 16:46:47 +08:00
Sheng
f6d2776a20
Let tornado parse xheaders
2018-10-10 10:51:40 +08:00
Sheng
b372fcbbb2
Pass None for empty password
2018-09-12 13:07:05 +08:00
Sheng
688ca78bb2
Use command "locale charmap" to detect encoding
2018-08-28 07:55:41 +08:00
Sheng
80bdddc280
Added setting swallow_http_errors
2018-08-28 07:43:43 +08:00
Sheng
5519a17016
Return 400 http error for invalid post requests
2018-08-26 15:13:02 +08:00
Sheng
757702127a
Move all tests data into a separate directory
2018-08-24 15:11:21 +08:00
Sheng
2e34702988
Changed validation error messages
2018-08-22 17:37:23 +08:00
Sheng
e85ae1692e
Added to_bytes function to utils
2018-08-20 18:36:04 +08:00
Sheng
f4197f0e4c
Use base_dir as the project root directory
2018-08-18 17:39:50 +08:00
Sheng
469d86ac77
Auto detect system default encoding
2018-05-30 21:29:44 +08:00
Sheng
ffb776ca6c
Use absolute path for importing modules
2018-04-26 22:38:16 +08:00
Sheng
331eaa2ba7
Remove unused modules
2018-04-25 21:08:02 +08:00
Sheng
d6e4339540
Updated test_handler.py
2018-04-25 21:05:01 +08:00
Sheng
d1177bc2c5
Updated handler.py and test_hanlder.py
2018-04-25 19:01:54 +08:00
Sheng
50ab045c1f
Use HTTPServerRequest instead
2018-04-24 10:57:25 +08:00
Sheng
42ac3daf87
Updated test_handler.py
2018-04-24 10:23:45 +08:00
Sheng
acc3b47ec6
Added test_handler.py
2018-04-24 09:59:51 +08:00