[Fix] Fixed secrets showing up on JSON of agent

This commit is contained in:
Robert von Burg 2023-07-28 12:38:16 +02:00
parent efbd624876
commit 2a51a5b790
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 7 additions and 5 deletions

View File

@ -249,7 +249,12 @@ public abstract class AbstractionConfiguration {
for (String key : this.configurationValues.keySet()) {
JsonObject propertyJ = new JsonObject();
propertyJ.addProperty(Tags.Json.KEY, key);
propertyJ.addProperty(Tags.Json.VALUE, this.configurationValues.get(key));
if (this.valueTypes.containsKey(key) && this.valueTypes.get(key).equals(SECRET))
propertyJ.addProperty(Tags.Json.VALUE, "***");
else
propertyJ.addProperty(Tags.Json.VALUE, this.configurationValues.get(key));
propertyJ.addProperty(Tags.Json.UNUSED, true);
propertiesMap.put(key, propertyJ);
}
@ -263,10 +268,7 @@ public abstract class AbstractionConfiguration {
propertyJ.addProperty(Tags.Json.UNUSED, false);
propertyJ.addProperty(Tags.Json.DEFAULT_VALUE, this.defaultValues.get(key));
String type = this.valueTypes.get(key);
if (type.equals(SECRET))
propertyJ.addProperty(Tags.Json.VALUE, "***");
propertyJ.addProperty(Tags.Json.TYPE, type);
propertyJ.addProperty(Tags.Json.TYPE, this.valueTypes.get(key));
}
JsonArray propertiesJ = propertiesMap.values().stream()