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
8 changes: 5 additions & 3 deletions resources/dscecho/src/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use serde_json::{Map, Value};

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
#[serde(untagged)]
Expand All @@ -22,7 +22,9 @@ pub enum Output {
String(String),
// Object has to be last so it doesn't get matched first
#[serde(rename = "object")]
Object(Value),
Object(Map<String,Value>),
#[serde(rename = "null")]
Null,
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
Expand All @@ -36,7 +38,7 @@ pub struct SecureString {
#[serde(deny_unknown_fields)]
pub struct SecureObject {
#[serde(rename = "secureObject")]
pub secure_object: Value,
pub secure_object: Map<String,Value>,
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
Expand Down
5 changes: 4 additions & 1 deletion resources/dscecho/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ fn main() {
}
},
Output::Object(ref mut obj) => {
*obj = redact(obj);
*obj = redact(&Value::Object(obj.clone()))
.as_object()
.expect("Expected redact() to return a Value::Object")
.clone();
},
_ => {}
}
Expand Down