Add "sensitive information" warning output

This commit is contained in:
Matthias
2024-03-20 07:12:14 +01:00
parent 6dc4fa9dbf
commit b1fe5b6d8a
2 changed files with 8 additions and 1 deletions

View File

@@ -200,6 +200,12 @@ class Configuration:
config['exportfilename'] = (config['user_data_dir']
/ 'backtest_results')
if self.args.get('show_sensitive'):
logger.warning(
"Sensitive information will be shown in the upcomming output. "
"Please make sure to never share this output without redacting "
"the information yourself.")
def _process_optimize_options(self, config: Config) -> None:
# This will override the strategy configuration

View File

@@ -1581,7 +1581,7 @@ def test_start_strategy_updater(mocker, tmp_path):
assert sc_mock.call_count == 2
def test_start_show_config(capsys):
def test_start_show_config(capsys, caplog):
args = [
"show-config",
"--config",
@@ -1608,3 +1608,4 @@ def test_start_show_config(capsys):
assert "Your combined configuration is:" in captured.out
assert '"max_open_trades":' in captured.out
assert '"secret": "REDACTED"' not in captured.out
assert log_has_re(r'Sensitive information will be shown in the upcomming output.*', caplog)