Skip to content

Commit 597b24a

Browse files
mask dropbox-token
1 parent 46e8848 commit 597b24a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

onlinejudge_verify/verify.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import math
55
import os
66
import pathlib
7+
import re
78
import subprocess
89
import time
910
import traceback
@@ -37,7 +38,10 @@ def succeeded(self) -> bool:
3738

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

4246
cwd = pathlib.Path.cwd()
4347
try:

0 commit comments

Comments
 (0)