Skip to content

Commit

Permalink
[Misc] use more reliable way to detect the sensitive variables and re…
Browse files Browse the repository at this point in the history
…place the value with dummy string
  • Loading branch information
ycool committed Nov 7, 2024
1 parent ccde239 commit a7a6611
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions collect_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,12 @@ def is_xnnpack_available():

def get_env_vars():
env_vars = ''
BLACK_LIST=('S3_SECRET_ACCESS_KEY', 'VLLM_API_KEY', 'S3_ACCESS_KEY_ID')
secret_terms=('secret', 'token', 'api', 'access', 'password')
for k, v in os.environ.items():
if k in BLACK_LIST:
continue
if any(term in k.lower() for term in secret_terms):
v = '***'
if k not in environment_variables:
continue
v = '***'
env_vars = env_vars + "{}={}".format(k, v) + "\n"
return env_vars

Expand Down

0 comments on commit a7a6611

Please sign in to comment.