remove args for metadata (#1405)

* remove args for metadata

* Add explanation for removing 'args' from log metadata

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
Kayou 2022-01-06 17:37:05 +01:00 committed by GitHub
parent 24f8faca67
commit 2b3138ef80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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):