Skip to content

Commit

Permalink
feat: hide sensitive config data (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pochemuta authored Mar 29, 2024
1 parent b46b416 commit 709ca42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

logger = logging.getLogger(__name__)

REDACTED_KEYS = ("key", "token")


class ConfigManager(Singleton):
def __init__(self, config_path: str = "", config_override_path: str = ""):
Expand Down Expand Up @@ -141,7 +139,7 @@ def redact(config: dict) -> dict:
redacted_config[key] = ConfigManager.redact(value)
else:
redacted_config[key] = value
for redacted_key in REDACTED_KEYS:
for redacted_key in consts.REDACTED_KEYS:
if redacted_key in key:
redacted_config[key] = "XXXXX"
break
Expand Down
2 changes: 2 additions & 0 deletions src/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class AppSource(Enum):
# Vk consts
VK_POST_LINK = "https://vk.com/{group_alias}?w=wall-{group_id}_{post_id}"

# List of keys whose values need to be hidden
REDACTED_KEYS = ("key", "token", "id", "hash", "session")

# Report enum
class ReportPeriod(Enum):
Expand Down

0 comments on commit 709ca42

Please sign in to comment.