Skip to content

Commit 509db49

Browse files
committed
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.
1 parent a26a634 commit 509db49

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • crates/openshell-cli/src

‎crates/openshell-cli/src/run.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4796,9 +4796,10 @@ fn provider_to_json(provider: &Provider) -> serde_json::Value {
47964796
serde_json::json!(credential_keys),
47974797
);
47984798

4799-
// Config (non-secret configuration)
4799+
// Config keys (keys only, not values)
48004800
if !provider.config.is_empty() {
4801-
obj.insert("config".to_string(), serde_json::json!(provider.config));
4801+
let config_keys: Vec<String> = provider.config.keys().cloned().collect();
4802+
obj.insert("config_keys".to_string(), serde_json::json!(config_keys));
48024803
}
48034804

48044805
// Metadata fields (only if metadata exists)

0 commit comments

Comments
 (0)