mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
Replaced API keys with last 4 characters for debugging purposes.
This commit is contained in:
parent
e9904172f1
commit
24e34a4a8d
1 changed files with 5 additions and 3 deletions
|
@ -140,11 +140,13 @@ def format_settings(parser, args):
|
||||||
|
|
||||||
|
|
||||||
def scrub_sensitive_info(args, text):
|
def scrub_sensitive_info(args, text):
|
||||||
# Replace sensitive information with placeholder
|
# Replace sensitive information with last 4 characters
|
||||||
if text and args.openai_api_key:
|
if text and args.openai_api_key:
|
||||||
text = text.replace(args.openai_api_key, "***")
|
last_4 = args.openai_api_key[-4:]
|
||||||
|
text = text.replace(args.openai_api_key, f"...{last_4}")
|
||||||
if text and args.anthropic_api_key:
|
if text and args.anthropic_api_key:
|
||||||
text = text.replace(args.anthropic_api_key, "***")
|
last_4 = args.anthropic_api_key[-4:]
|
||||||
|
text = text.replace(args.anthropic_api_key, f"...{last_4}")
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue