From b59c966b8c5090262581fc418d751d3b0532bb7c Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 7 Jul 2026 19:33:27 -0500 Subject: [PATCH 1/2] Use trusted_server_config for app config defaults --- crates/trusted-server-core/src/config_payload.rs | 2 +- crates/trusted-server-core/src/settings_data.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/trusted-server-core/src/config_payload.rs b/crates/trusted-server-core/src/config_payload.rs index 6ee26904..dd0b3533 100644 --- a/crates/trusted-server-core/src/config_payload.rs +++ b/crates/trusted-server-core/src/config_payload.rs @@ -12,7 +12,7 @@ use crate::error::TrustedServerError; use crate::settings::Settings; /// Default config-store key containing the Trusted Server app-config blob. -pub const CONFIG_BLOB_KEY: &str = "app_config"; +pub const CONFIG_BLOB_KEY: &str = "trusted_server_config"; /// Reconstruct validated [`Settings`] from a serialized config blob envelope. /// diff --git a/crates/trusted-server-core/src/settings_data.rs b/crates/trusted-server-core/src/settings_data.rs index 0261c7e4..06ea548f 100644 --- a/crates/trusted-server-core/src/settings_data.rs +++ b/crates/trusted-server-core/src/settings_data.rs @@ -8,7 +8,7 @@ use crate::error::TrustedServerError; use crate::platform::{PlatformConfigStore, StoreName}; use crate::settings::Settings; -const DEFAULT_CONFIG_STORE_ID: &str = "app_config"; +const DEFAULT_CONFIG_STORE_ID: &str = "trusted_server_config"; const FASTLY_CHUNK_POINTER_KIND: &str = "fastly_config_chunks"; const FASTLY_CONFIG_ENTRY_LIMIT: usize = 8_000; From f88ed5ea5fee63ae1b9189399aa5efc4f8f01445 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 8 Jul 2026 07:43:23 -0500 Subject: [PATCH 2/2] Update integration config defaults --- .../fixtures/configs/viceroy-template.toml | 4 ++-- .../src/bin/generate-viceroy-config.rs | 21 +++++++------------ .../tests/environments/axum.rs | 5 ++++- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml b/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml index 002c86f3..9f1443d2 100644 --- a/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml +++ b/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml @@ -67,8 +67,8 @@ data = "test-api-key" [local_server.config_stores] - # Generated integration configs inject the app_config blob and the - # empty trusted_server_config store required by the Fastly entry point. + # Generated integration configs inject the trusted_server_config blob + # into the store required by the Fastly entry point. # GENERATED_TRUSTED_SERVER_CONFIG_STORES [local_server.config_stores.jwks_store] diff --git a/crates/trusted-server-integration-tests/src/bin/generate-viceroy-config.rs b/crates/trusted-server-integration-tests/src/bin/generate-viceroy-config.rs index 2ec0e456..85b1bcf0 100644 --- a/crates/trusted-server-integration-tests/src/bin/generate-viceroy-config.rs +++ b/crates/trusted-server-integration-tests/src/bin/generate-viceroy-config.rs @@ -147,16 +147,10 @@ fn inject_generated_config_stores(template: &str, envelope_json: &str) -> Result fn generated_config_store_blocks(envelope_json: &str) -> String { format!( r#" # Generated by generate-viceroy-config. Do not edit generated output. - [local_server.config_stores.app_config] - format = "inline-toml" - [local_server.config_stores.app_config.contents] - app_config = '''{envelope_json}''' - - # The post-cutover entry point still opens this store, but no longer - # reads rollout flags from it. [local_server.config_stores.trusted_server_config] format = "inline-toml" - [local_server.config_stores.trusted_server_config.contents]"# + [local_server.config_stores.trusted_server_config.contents] + trusted_server_config = '''{envelope_json}'''"# ) } @@ -222,7 +216,7 @@ mod tests { .expect("should inject generated stores"); assert!( - generated.contains("[local_server.config_stores.app_config]"), + generated.contains("[local_server.config_stores.trusted_server_config]"), "should include app config store" ); assert!( @@ -246,11 +240,12 @@ mod tests { .expect("should inject generated stores"); let parsed: toml::Value = toml::from_str(&generated).expect("should parse as TOML"); - assert!( + assert_eq!( parsed["local_server"]["config_stores"]["trusted_server_config"]["contents"] - .as_table() - .is_some_and(toml::Table::is_empty), - "trusted_server_config should remain present with no rollout flags" + ["trusted_server_config"] + .as_str(), + Some(envelope.as_str()), + "trusted_server_config should contain the app-config blob" ); } diff --git a/crates/trusted-server-integration-tests/tests/environments/axum.rs b/crates/trusted-server-integration-tests/tests/environments/axum.rs index 69af9949..235af413 100644 --- a/crates/trusted-server-integration-tests/tests/environments/axum.rs +++ b/crates/trusted-server-integration-tests/tests/environments/axum.rs @@ -36,7 +36,10 @@ impl RuntimeEnvironment for AxumDevServer { let mut child = Command::new(&binary) .env("PORT", port.to_string()) - .env("TRUSTED_SERVER_CONFIG_APP_CONFIG_APP_CONFIG", app_config) + .env( + "TRUSTED_SERVER_CONFIG_TRUSTED_SERVER_CONFIG_TRUSTED_SERVER_CONFIG", + app_config, + ) .stdout(Stdio::null()) .stderr(Stdio::piped()) .spawn()