Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/trusted-server-core/src/config_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/trusted-server-core/src/settings_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}'''"#
)
}

Expand Down Expand Up @@ -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!(
Expand All @@ -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"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading