feat: align OpenRPC server with simplified client API

- Updated RegisterRunnerParams to only require name (queue = name)
- Added AddRunnerParams with RunnerConfig for add_runner method
- Updated RunnerManagementParams and StopRunnerParams with secrets
- Added add_runner method to OpenRPC trait and implementation
- Removed duplicate AddRunnerParams definition
- Updated client register_runner to send params as JSON object
- Added TODO comments for moving secrets to HTTP headers
This commit is contained in:
Timur Gordon
2025-10-27 14:48:46 +01:00
parent a47157aa71
commit 9b3477d6d2
4 changed files with 90 additions and 54 deletions

View File

@@ -97,18 +97,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let runner_path = runner_binary.path().to_string_lossy();
let db_path = "/tmp/osiris_openrpc.db";
let command = format!(
"{} osiris_runner --db-path {} --redis-url redis://localhost:6379",
runner_path, db_path
);
let runner_config = RunnerConfig {
name: "osiris_runner".to_string(),
command,
env: None,
};
client.add_runner("admin_secret", runner_config).await?;
// Register the runner with the supervisor
// Note: The current OpenRPC server uses register_runner, not add_runner
client.register_runner("admin_secret", "osiris_runner").await?;
println!("✅ Runner registered: osiris_runner");
client.start_runner("admin_secret", "osiris_runner").await?;