Skip to content

Add TOML configuration to the autopilot#4147

Merged
jmg-duarte merged 15 commits intomainfrom
jmgd/config-drivers
Feb 17, 2026
Merged

Add TOML configuration to the autopilot#4147
jmg-duarte merged 15 commits intomainfrom
jmgd/config-drivers

Conversation

@jmg-duarte
Copy link
Contributor

Description

Kicks off #4005; to start only one of the more annoying arguments was migrated to validate the approach.

Changes

  • Add an optional config path
  • Remove the drivers CLI arg
  • Move the drivers argument to the TOML parsing

How to test

  • Migrate the drivers argument to TOML in the infra repo
  • Run in staging

@jmg-duarte jmg-duarte marked this pull request as ready for review February 13, 2026 10:21
@jmg-duarte jmg-duarte requested a review from a team as a code owner February 13, 2026 10:21
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces TOML-based configuration for the autopilot service, migrating the drivers argument from a CLI flag. While this is a positive step for configuration management, a critical security vulnerability has been identified: sensitive external service URLs (including node URLs and solver URLs) are logged in plain text, potentially exposing API keys or authentication tokens. It is crucial to implement masking utilities for all URLs that may contain secrets before logging. Furthermore, the PR has critical functional issues: a necessary validation check for drivers configuration was removed without replacement, risking an invalid service state, and the fairness_threshold configuration for solvers appears to be removed without documentation, which could lead to a significant functional regression, with misleading tests.

Fix to_temp_path() to actually serialize and write the TOML config
content instead of creating an empty file.

Replace manual temp dir/file creation in 6 e2e test files (12
occurrences) with the cleaner to_temp_path() helper, which uses
tempfile::NamedTempFile for automatic cleanup on drop.
Comment on lines +34 to +61
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum Account {
/// AWS KMS is used to retrieve the solver public key
#[serde(deserialize_with = "deserialize_arn")]
Kms(Arn),
/// Solver public key
Address(Address),
}

// Wrapper type for AWS ARN identifiers
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize)]
pub struct Arn(pub String);

fn deserialize_arn<'de, D>(deserializer: D) -> Result<Arn, D::Error>
where
D: Deserializer<'de>,
{
let raw_arn = String::deserialize(deserializer)?;
if raw_arn.starts_with("arn:aws:kms:") {
Ok(Arn(raw_arn))
} else {
Err(serde::de::Error::invalid_value(
serde::de::Unexpected::Str(raw_arn.as_str()),
&"expected value starting with \"arn:aws:kms\"",
))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it duplicate the logic implemented in the driver crate? Maybe it makes sense to extract it somewhere, so it is accessible by both crates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly, but the driver does things a little differently. I'd like to keep this PR focused and simple enough for review

@jmg-duarte jmg-duarte enabled auto-merge February 17, 2026 10:13
@jmg-duarte jmg-duarte added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 89bdca3 Feb 17, 2026
19 checks passed
@jmg-duarte jmg-duarte deleted the jmgd/config-drivers branch February 17, 2026 10:30
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants