Skip to content

Commit

Permalink
[Notifications] Fix sensitive data appearing in api logs (#3663)
Browse files Browse the repository at this point in the history
  • Loading branch information
quaark committed May 31, 2023
1 parent 2efe330 commit 6f4856e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mlrun/utils/notifications/notification_pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async def _push_notification(
)
logger.debug(
"Pushing notification",
notification=notification_object.to_dict(),
notification=_sanitize_notification(notification_object),
run_uid=run.metadata.uid,
)
try:
Expand Down Expand Up @@ -346,3 +346,9 @@ def push_pipeline_run_results(
if state:
text += f", state={state}"
self.push(text, "info", runs=runs_list)


def _sanitize_notification(notification: mlrun.model.Notification):
notification_dict = notification.to_dict()
notification_dict.pop("params", None)
return notification_dict

0 comments on commit 6f4856e

Please sign in to comment.