From 2b3138ef8027ed13db301e88d3341fc162d7d80c Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 6 Jan 2022 17:37:05 +0100 Subject: [PATCH] remove args for metadata (#1405) * remove args for metadata * Add explanation for removing 'args' from log metadata Co-authored-by: Alexandre Aubin --- src/yunohost/log.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/yunohost/log.py b/src/yunohost/log.py index d28a35e18..9f9e0b753 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -659,6 +659,11 @@ class OperationLogger: data["error"] = self._error # TODO: detect if 'extra' erase some key of 'data' data.update(self.extra) + # Remove the 'args' arg from args (yodawg). It corresponds to url-encoded args for app install, config panel set, etc + # Because the data are url encoded, it's hell to properly redact secrets inside it, + # and the useful info is usually already available in `env` too + if "args" in data and isinstance(data["args"], dict) and "args" in data["args"]: + data["args"].pop("args") return data def success(self):