Browse Source

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 months ago
parent
commit
e38e3bcc3b
No account linked to committer's email address
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      api/utils/__init__.py

+ 5
- 0
api/utils/__init__.py View File

import uuid import uuid
import requests import requests
import logging import logging
import copy
from enum import Enum, IntEnum from enum import Enum, IntEnum
import importlib import importlib
from Cryptodome.PublicKey import RSA from Cryptodome.PublicKey import RSA
def show_configs(): def show_configs():
msg = f"Current configs, from {conf_realpath(SERVICE_CONF)}:" msg = f"Current configs, from {conf_realpath(SERVICE_CONF)}:"
for k, v in CONFIGS.items(): 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}" msg += f"\n\t{k}: {v}"
logging.info(msg) logging.info(msg)



Loading…
Cancel
Save