Create the server token at install and document the security boundary

This commit is contained in:
2026-11-10 00:59:39 +00:00
parent 547d4d9822
commit 12a74247ae
7 changed files with 245 additions and 1 deletions
+5
View File
@@ -281,6 +281,7 @@ class ManageNativeTests(unittest.TestCase):
config = self.config(root)
config["web"] = {"node": "/bin/node", "script": "/prefix/lib/web/serve.mjs",
"host": "0.0.0.0", "port": 8082, "auth_file": "/private/auth.json",
"server_token_file": "/private/server-token",
"root": str(root / "lib/app-web"), "updates": "/prefix/lib/app-updates"}
ntfy, server, web = MagicMock(), MagicMock(), MagicMock()
ntfy.poll.return_value = None
@@ -299,6 +300,10 @@ class ManageNativeTests(unittest.TestCase):
"--updates", "/prefix/lib/app-updates"])
self.assertNotIn("PIPELINES_WEB_AUTH", call.kwargs["env"])
self.assertEqual(call.kwargs["env"]["PIPELINES_WEB_AUTH_FILE"], "/private/auth.json")
# The server requires and the proxy sends the shared server token.
for spawned in popen.call_args_list:
self.assertEqual(spawned.kwargs["env"]["PIPELINES_SERVER_TOKEN_FILE"], "/private/server-token")
self.assertEqual(manage.server_token_env({"web": None}), {})
web.terminate.assert_called_once()
server.terminate.assert_called_once()
ntfy.terminate.assert_called_once()