mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-13 04:51:00 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user