Update roster fixtures and redact live provider keys (T90)
This commit is contained in:
@@ -148,7 +148,8 @@ pub async fn run_module_with_input(
|
||||
receiver: input::Receiver,
|
||||
source: &str,
|
||||
) -> anyhow::Result<()> {
|
||||
let provider_config = config::Config::read(&world.root).await?;
|
||||
let config_root = world.root.clone();
|
||||
let provider_config = config::Config::read(&config_root).await?;
|
||||
let loader = std::rc::Rc::new(loader::Loader {
|
||||
root: world.root.clone(),
|
||||
modules: Default::default(),
|
||||
@@ -232,9 +233,14 @@ pub async fn run_module_with_input(
|
||||
Ok::<_, anyhow::Error>(())
|
||||
}
|
||||
.await;
|
||||
let current_config = config::Config::read(&config_root).await.unwrap_or_default();
|
||||
result.map_err(|error| {
|
||||
let mut text = error.to_string();
|
||||
for provider in provider_config.providers.values() {
|
||||
for provider in provider_config
|
||||
.providers
|
||||
.values()
|
||||
.chain(current_config.providers.values())
|
||||
{
|
||||
if !provider.api_key.is_empty() {
|
||||
text = text.replace(&provider.api_key, "[redacted]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user