Commit Graph

20 Commits

Author SHA1 Message Date
Pierre Ossman 984dcc62d3 Move JWT token plugins tests to separate file
Let's try to match the test units with the modules we have.
2021-04-16 11:27:56 +02:00
Pierre Ossman b22a6b0ce0 Add unit tests for jwt token time checks 2021-01-29 13:11:07 +01:00
Pierre Ossman fadb25e026 Use assertRaises() as a context manager
Makes the code a lot easier to read.
2021-01-29 13:10:16 +01:00
Pierre Ossman 3f17696dc6 Use patch() as a decorator in tests
Cleaner and more robust.
2021-01-29 13:09:19 +01:00
Pierre Ossman a82eb10b48 Remove Python version check
We require Python 3 now, so no need for this check.
2021-01-29 12:58:26 +01:00
Pierre Ossman 96eda1a5c7 Remove support for older Python
All active distributions should now support at least Python 3.4, so
let's clean things up by removing older compatibility code.
2020-12-14 13:48:54 +01:00
Pierre Ossman 992e09eac4 Convert tests from mox to mock
mox is deprecated upstream in favour of mock
2020-08-21 10:50:11 +02:00
UXabre f2031eff05 Added JWT/JWS/JWE tokens capability 2019-02-15 03:45:57 -05:00
josedpedroso af85184e28 Added --host-token to allow choosing target by hostname. 2018-07-05 00:54:19 +01:00
josedpedroso 8964adf111 Added --web-auth option to require authentication to access the webserver.
BasicHTTPAuth plugin now issues 401 on bad credentials to allow the user to try again.
2018-07-05 00:48:08 +01:00
Pierre Ossman e47591f4aa Split out basic WebSocket server template 2017-02-01 08:33:07 +01:00
Pierre Ossman 8a69762249 Separate out raw WebSocket protocol handling 2017-02-01 08:22:27 +01:00
Solly Ross 72ce5c1ae8 Merge pull request #228 from jrziviani/master
Enable unix socket to work with token plugin
2016-06-30 16:54:35 -04:00
James Page 156b08ae68 Switch test dependency to mox3
mox is pretty much unmaintained these days, however the OpenStack
project are actively maintaining mox3 (a Python 3 compatibile fork
with some other improvements).

websockify seems quite happy to use mox3 instead, so switch the
test dependency and associated imports to use mox3.
2016-06-30 09:59:50 +01:00
Jose Ricardo Ziviani 7f8baf54e1 Enable unix socket to work with token plugin
This commit adds support to unix sockets in the token plugin, thus it is
possible to have a token files like:

  token: unix_socket:/path/to/socket_file

A single websockify instance will be able to handle multiple sockets.

Signed-off-by: Jose Ricardo Ziviani <jose@ziviani.net>
2016-02-16 13:51:13 -02:00
Solly Ross 1e2b5c2256 Rework Auth Plugins to Support HTTP Auth
This commit reworks auth plugins slightly to enable
support for HTTP authentication.  By raising an
AuthenticationError, auth plugins can now return
HTTP responses to the upgrade request (such as 401).

Related to kanaka/noVNC#522
2015-08-25 17:52:20 -04:00
Solly Ross 04fd789a67 Update Tests and Test Plugins
This commit updates the unit tests to work with the current code
and adds in tests for the auth and token plugin functionality.
2015-05-13 16:03:57 -04:00
Peter Åstrand (astrand) 047ce47742 Rename new_client to new_websocket_client, in order to have a better
name in the SocketServer/HTTPServer request handler hierarchy. Prepare
for merge pull request #72. This work has been picked out of
7b3dd8a6f5 .
2013-11-28 13:33:28 +01:00
Edward Hope-Morley 32c1abd5d9 Added temp dir for unit test data and cleanup
Unit test data will now go to a temporary dir that will be deleted
once the test completes. The unit tests also setup a logger which
will persist so that it can be inspected once tests complete.

Also fixes a bug where instance var is missing from decode_hybi()

Co-authored-by: natsume.takashi@lab.ntt.co.jp
2013-11-14 12:38:03 +00:00
Edward Hope-Morley 5e0ff7d855 Added unit tests for websocket and websocketproxy
To run the unit tests just run tox from the top
level directory which will try to run unit tests
for most versions of python. Requires tox to be
installed. To run tox for a specifice env, run
tox -e<env> e.g. for python 2.7 run 'tox -epy27'.

Co-authored-by: natsume.takashi@lab.ntt.co.jp
2013-10-29 16:19:39 +00:00