fix(secrets): recover encrypted tokens on all backends
test / integration-docker (pull_request) Successful in 24s
lint / lint (push) Failing after 1m0s
test / unit (pull_request) Successful in 2m3s
test / integration-firecracker (pull_request) Successful in 4m48s
test / coverage (pull_request) Successful in 20s
test / publish-infra (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Failing after 11m36s

This commit is contained in:
2026-07-22 17:31:39 +00:00
parent c435e9088e
commit 89058fbaec
25 changed files with 517 additions and 57 deletions
+21
View File
@@ -76,6 +76,27 @@ class TestTeardown(unittest.TestCase):
self.assertEqual("DELETE", m.call_args.args[0].get_method())
class TestReprovisionGateway(unittest.TestCase):
def setUp(self) -> None:
self.c = OrchestratorClient("http://orch:8080")
def test_success_posts_key(self) -> None:
with patch(_URLOPEN, return_value=_resp(200, {"reprovisioned": True})) as opened:
self.assertTrue(self.c.reprovision_gateway("b1", "key"))
request = opened.call_args.args[0]
self.assertEqual("POST", request.get_method())
self.assertEqual({"env_var_secret": "key"}, json.loads(request.data))
def test_missing_stored_secret_is_false(self) -> None:
with patch(_URLOPEN, side_effect=_http_error(404)):
self.assertFalse(self.c.reprovision_gateway("b1", "key"))
def test_other_status_raises(self) -> None:
with patch(_URLOPEN, side_effect=_http_error(400)):
with self.assertRaises(OrchestratorClientError):
self.c.reprovision_gateway("b1", "key")
class TestHealthAndPolicy(unittest.TestCase):
def setUp(self) -> None:
self.c = OrchestratorClient("http://orch:8080")