Skip to content

Commit

Permalink
mask dropbox-token
Browse files Browse the repository at this point in the history
  • Loading branch information
CoCo-Japan-pan committed Mar 16, 2024
1 parent 46e8848 commit 597b24a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion onlinejudge_verify/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import math
import os
import pathlib
import re
import subprocess
import time
import traceback
Expand Down Expand Up @@ -37,7 +38,10 @@ def succeeded(self) -> bool:

def exec_command(command: List[str]):
# NOTE: secrets like YUKICODER_TOKEN are masked
logger.info('$ %s', ' '.join(command))
# dropbox-tokenを新規に取得する場合は、そのトークンが表示されるのでそれもマスクする
dropbox_token_pattern = re.compile(r'(--dropbox-token)\s+\w+')
message = dropbox_token_pattern.sub(r'\1 ***', ' '.join(command))
logger.info('$ %s', message)

cwd = pathlib.Path.cwd()
try:
Expand Down

0 comments on commit 597b24a

Please sign in to comment.