From 42b79f50655ab389070e82b1fd4d21ecf1925745 Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:05:11 +0200 Subject: [PATCH] Verify HTTPS proxy login and authenticated control end to end --- test_server.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test_server.py b/test_server.py index 8d93473..692f8fe 100644 --- a/test_server.py +++ b/test_server.py @@ -172,6 +172,15 @@ class Tests(unittest.TestCase): with self.assertRaises(urllib.error.HTTPError) as error: self.request('models/start','POST',{**base,'Origin':'https://athena.example.org','X-Deck-Proxy':'wrong','X-Forwarded-Proto':'https'}) self.assertEqual(error.exception.code,403);error.exception.close() + headers={**base,'Origin':'https://athena.example.org','Content-Type':'application/json'} + req=urllib.request.Request(self.url+'/api/v1/login',data=json.dumps({'password':self.password}).encode(),headers=headers) + with urllib.request.urlopen(req) as response: + self.assertTrue(json.load(response)['authenticated']) + cookie=response.headers['Set-Cookie'].split(';',1)[0] + with patch.object(self.server.endpoint,'configure',return_value={'port':8120}) as configure: + req=urllib.request.Request(self.url+'/api/v1/endpoint/config',data=b'{"port":8120}',headers={**headers,'Cookie':cookie}) + with urllib.request.urlopen(req) as response:self.assertEqual(json.load(response)['port'],8120) + configure.assert_called_once_with({'port':8120}) def test_unavailable_hardware(self): with patch.dict('os.environ', {'DECK_LOCAL_HARDWARE':'0'}), patch('server.subprocess.run',side_effect=OSError()): result=HardwareProvider().snapshot()