refactor: unify component naming — control_plane/control_auth -> orchestrator
tracker-policy-pr / check-pr (pull_request) Successful in 14s
test / integration-docker (pull_request) Successful in 18s
test / unit (pull_request) Successful in 46s
lint / lint (push) Failing after 54s
test / integration-firecracker (pull_request) Successful in 3m21s
test / coverage (pull_request) Successful in 18s
test / publish-infra (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Successful in 14s
test / integration-docker (pull_request) Successful in 18s
test / unit (pull_request) Successful in 46s
lint / lint (push) Failing after 54s
test / integration-firecracker (pull_request) Successful in 3m21s
test / coverage (pull_request) Successful in 18s
test / publish-infra (pull_request) Has been skipped
The codebase used "control plane" both as an architectural role term AND
as an identifier alias for the orchestrator component, producing
duplicate names for one thing (control_plane_url vs orchestrator_url,
CONTROL_PLANE_PORT, host_control_plane_token, …). Going forward the
concrete component is always named for what it is — Gateway or
Orchestrator — and the plane vocabulary is reserved for prose (module
descriptions, the security argument).
Renamed (identifiers + the in-repo env/wire/file string values, all
setters/getters are in this repo so the change is atomic):
ControlPlaneServer -> OrchestratorServer
control_plane_url -> orchestrator_url
probe_control_plane_url -> probe_orchestrator_url
host_control_plane_token -> host_orchestrator_token
CONTROL_PLANE_PORT -> ORCHESTRATOR_PORT
CONTROL_PLANE_TOKEN_ENV/FILE -> ORCHESTRATOR_TOKEN_ENV/FILENAME
BOT_BOTTLE_CONTROL_PLANE_TOKEN-> BOT_BOTTLE_ORCHESTRATOR_TOKEN
control-plane-token (file) -> orchestrator-token
control_auth (module) -> orchestrator_auth (stays top-level;
the gateway imports it and must not
import the orchestrator/ package)
CONTROL_AUTH_HEADER -> ORCHESTRATOR_AUTH_HEADER
x-bot-bottle-control-auth -> x-bot-bottle-orchestrator-auth
CONTROL_AUTH_JWT_ENV -> ORCHESTRATOR_AUTH_JWT_ENV
BOT_BOTTLE_CONTROL_AUTH_JWT -> BOT_BOTTLE_ORCHESTRATOR_AUTH_JWT
_control_auth_headers -> _orchestrator_auth_headers
Prose plane-terms ("control plane", "data plane") are preserved,
including the test name test_data_plane_daemons_get_jwt_not_key (it
names the security invariant). Gateway and orchestrator verified to
agree on the renamed wire header; full unit suite green (2243).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ class TestSigningKeySync(unittest.TestCase):
|
||||
patch.object(infra_vm, "bot_bottle_root", return_value=root):
|
||||
out = infra_vm._with_signing_key(self._infra())
|
||||
self.assertIsInstance(out, infra_vm.InfraVm) # returned for chaining
|
||||
token = root / infra_vm.CONTROL_PLANE_TOKEN_FILENAME
|
||||
token = root / infra_vm.ORCHESTRATOR_TOKEN_FILENAME
|
||||
self.assertEqual("the-signing-key", token.read_text())
|
||||
self.assertEqual(0o600, token.stat().st_mode & 0o777)
|
||||
# It cat'd the guest volume path over SSH.
|
||||
@@ -44,16 +44,16 @@ class TestSigningKeySync(unittest.TestCase):
|
||||
with patch.object(infra_vm.subprocess, "run", return_value=proc), \
|
||||
patch.object(infra_vm, "bot_bottle_root", return_value=root):
|
||||
infra_vm._with_signing_key(self._infra()) # no raise
|
||||
self.assertFalse((root / infra_vm.CONTROL_PLANE_TOKEN_FILENAME).exists())
|
||||
self.assertFalse((root / infra_vm.ORCHESTRATOR_TOKEN_FILENAME).exists())
|
||||
|
||||
|
||||
class TestControlPlaneUrl(unittest.TestCase):
|
||||
class TestOrchestratorUrl(unittest.TestCase):
|
||||
def test_url_uses_guest_ip_and_port(self):
|
||||
infra = infra_vm.InfraVm(
|
||||
vm=MagicMock(), guest_ip="10.243.255.1", private_key=Path("/k"))
|
||||
self.assertEqual(
|
||||
f"http://10.243.255.1:{infra_vm.CONTROL_PLANE_PORT}",
|
||||
infra.control_plane_url,
|
||||
f"http://10.243.255.1:{infra_vm.ORCHESTRATOR_PORT}",
|
||||
infra.orchestrator_url,
|
||||
)
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ class TestBuildInfraRootfs(unittest.TestCase):
|
||||
# Role-scoped control-plane auth (issue #469 review): the orchestrator
|
||||
# gets the signing key, the gateway daemons get a pre-minted `gateway`
|
||||
# JWT — never open mode in the infra VM.
|
||||
self.assertIn("host_control_plane_token", init) # key generated on the volume
|
||||
self.assertIn("host_orchestrator_token", init) # key generated on the volume
|
||||
self.assertIn("mint, ROLE_GATEWAY", init) # gateway JWT minted from it
|
||||
self.assertIn('BOT_BOTTLE_CONTROL_PLANE_TOKEN="$CP_KEY" python3 -m bot_bottle.orchestrator',
|
||||
self.assertIn('BOT_BOTTLE_ORCHESTRATOR_TOKEN="$CP_KEY" python3 -m bot_bottle.orchestrator',
|
||||
init) # key -> orchestrator only
|
||||
self.assertIn('BOT_BOTTLE_CONTROL_AUTH_JWT="$GW_JWT"', init) # JWT -> gateway daemons
|
||||
self.assertIn('BOT_BOTTLE_ORCHESTRATOR_AUTH_JWT="$GW_JWT"', init) # JWT -> gateway daemons
|
||||
|
||||
|
||||
class TestSshGatewayTransport(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user