Reject dynamic environments named local (#34784)

## Why

`local` identifies the environment owned by `EnvironmentManager`, but dynamic
remote environment registration previously allowed that ID to be replaced.

## What changed

Reject `local` in the shared environment ID validator used by dynamic remote
environment registration.

GitOrigin-RevId: 2622551f78989c16c432e6dd3d7da9bd8b0527c5
This commit is contained in:
jif
2026-07-22 16:22:34 +00:00
committed by copyberry
parent cc559bb971
commit 44436fd075
+5
View File
@@ -490,6 +490,11 @@ fn validate_environment_id(environment_id: &str) -> Result<(), ExecServerError>
"environment id cannot be empty".to_string(),
));
}
if environment_id == LOCAL_ENVIRONMENT_ID {
return Err(ExecServerError::Protocol(format!(
"environment id `{LOCAL_ENVIRONMENT_ID}` is reserved for EnvironmentManager"
)));
}
Ok(())
}