fix: authenticate device config sync like upload client
- send X-Device-Name and X-Api-Key to /api/device-config - require YARIS_DEVICE_NAME alongside shared upload creds - fix server create_device output to match actual Pi env names - document shared upload/config sync credential requirements Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -56,11 +56,20 @@ class DeviceSyncReloadCallbackTest(unittest.TestCase):
|
||||
finally:
|
||||
app_device_sync._RELOAD_CALLBACK = original
|
||||
|
||||
@patch.dict(os.environ, {"YARIS_SERVER_URL": "https://example.test", "YARIS_API_KEY": "upload-key"}, clear=True)
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{
|
||||
"YARIS_SERVER_URL": "https://example.test",
|
||||
"YARIS_DEVICE_NAME": "yaris-2013",
|
||||
"YARIS_API_KEY": "upload-key",
|
||||
},
|
||||
clear=True,
|
||||
)
|
||||
def test_sync_credentials_fall_back_to_upload_api_key(self):
|
||||
server_url, device_key = app_device_sync._server_credentials()
|
||||
server_url, device_name, device_key = app_device_sync._server_credentials()
|
||||
|
||||
self.assertEqual(server_url, "https://example.test")
|
||||
self.assertEqual(device_name, "yaris-2013")
|
||||
self.assertEqual(device_key, "upload-key")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user