Fix agent.enable_git_ask_pass does not show in configuration dump

This commit is contained in:
allegroai 2024-02-29 13:50:52 +02:00
parent 6657003d65
commit 05a65548da

View File

@ -243,6 +243,7 @@ class Session(_Session):
def print_configuration( def print_configuration(
self, self,
remove_secret_keys=("secret", "pass", "token", "account_key", "contents"), remove_secret_keys=("secret", "pass", "token", "account_key", "contents"),
remove_secret_keys_exceptions=("enable_git_ask_pass",),
skip_value_keys=("environment",), skip_value_keys=("environment",),
docker_args_sanitize_keys=("extra_docker_arguments", ), docker_args_sanitize_keys=("extra_docker_arguments", ),
sanitize_urls_keys=("extra_index_url", ), sanitize_urls_keys=("extra_index_url", ),
@ -251,8 +252,8 @@ class Session(_Session):
def recursive_remove_secrets(dictionary): def recursive_remove_secrets(dictionary):
for k in list(dictionary): for k in list(dictionary):
for s in remove_secret_keys: for s in remove_secret_keys:
if s in k: if s in k and k not in remove_secret_keys_exceptions:
dictionary.pop(k) dictionary[k] = '****'
break break
for s in skip_value_keys: for s in skip_value_keys:
if s == k: if s == k: