浏览代码

Mask password in log (#4129)

### What problem does this PR solve?

Mask password in log

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.15.1
Zhichang Yu 10 个月前
父节点
当前提交
e38e3bcc3b
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5
    0
      api/utils/__init__.py

+ 5
- 0
api/utils/__init__.py 查看文件

@@ -24,6 +24,7 @@ import time
import uuid
import requests
import logging
import copy
from enum import Enum, IntEnum
import importlib
from Cryptodome.PublicKey import RSA
@@ -65,6 +66,10 @@ CONFIGS = read_config()
def show_configs():
msg = f"Current configs, from {conf_realpath(SERVICE_CONF)}:"
for k, v in CONFIGS.items():
if isinstance(v, dict):
if "password" in v:
v = copy.deepcopy(v)
v["password"] = "*" * 8
msg += f"\n\t{k}: {v}"
logging.info(msg)


正在加载...
取消
保存