mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 13:32:08 +00:00
no sensitive keys
This commit is contained in:
@@ -5,6 +5,17 @@ import os
|
||||
from openbb_terminal.base_helpers import load_env_vars, strtobool
|
||||
from .helper_classes import TerminalStyle as _TerminalStyle
|
||||
|
||||
SENSITIVE_KEYS = [
|
||||
"RH_USERNAME",
|
||||
"RH_PASSWORD",
|
||||
"DG_USERNAME",
|
||||
"DG_PASSWORD",
|
||||
"DG_TOTP_SECRET",
|
||||
"OANDA_ACCOUNT_TYPE",
|
||||
"OANDA_ACCOUNT",
|
||||
"OANDA_TOKEN",
|
||||
]
|
||||
|
||||
# Terminal UX section
|
||||
MPL_STYLE = os.getenv("OPENBB_MPLSTYLE") or "dark"
|
||||
PMF_STYLE = os.getenv("OPENBB_PMFSTYLE") or "dark"
|
||||
|
||||
@@ -240,7 +240,11 @@ def set_key(env_var_name: str, env_var_value: str, persist: bool = False) -> Non
|
||||
setattr(cfg, env_var_name, env_var_value)
|
||||
|
||||
# Send api key to server
|
||||
if not User.is_guest():
|
||||
if (
|
||||
not User.is_guest()
|
||||
and env_var_name not in cfg.SENSITIVE_KEYS
|
||||
and env_var_name.startswith("API_")
|
||||
):
|
||||
patch_user_configs(key=env_var_name, value=env_var_value, type_="keys")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user