refactor(cli): expose only config keys in provider list JSON/YAML output

Update provider_to_json() to only include config keys (not values) in
structured output, matching the security model used for credentials.
This prevents potential exposure of sensitive configuration values.

Changed field name from "config" to "config_keys" to clarify that only
keys are included, consistent with "credential_keys" field naming.
This commit is contained in:
Jeff MAURY
2026-06-15 17:58:45 +02:00
parent a26a6341af
commit 509db497b2
+3 -2
View File
@@ -4796,9 +4796,10 @@ fn provider_to_json(provider: &Provider) -> serde_json::Value {
serde_json::json!(credential_keys),
);
// Config (non-secret configuration)
// Config keys (keys only, not values)
if !provider.config.is_empty() {
obj.insert("config".to_string(), serde_json::json!(provider.config));
let config_keys: Vec<String> = provider.config.keys().cloned().collect();
obj.insert("config_keys".to_string(), serde_json::json!(config_keys));
}
// Metadata fields (only if metadata exists)