Skip to content

Commit 276eef2

Browse files
committed
feat: integrate dotenv to handle API keys for enhanced security management
1 parent 7153831 commit 276eef2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/get_acs_result.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import sys
55

66
import requests
7+
from dotenv import find_dotenv, load_dotenv
8+
9+
load_dotenv(find_dotenv())
710

811

912
def download_file(url, output_path):
@@ -38,9 +41,7 @@ def main():
3841

3942
args = parser.parse_args()
4043

41-
# 设置常量
42-
access_key = '7c4d4edd67284c2e9c62d8b9350baaa4'
43-
api_url = f"https://openapi.test.dp.tech/openapi/v1/sandbox/job/{args.job_id}?accessKey={access_key}"
44+
api_url = f"https://openapi.test.dp.tech/openapi/v1/sandbox/job/{args.job_id}?accessKey={os.getenv('MATERIALS_ACCESS_KEY')}"
4445

4546
# 删除已存在的输出文件
4647
if os.path.exists(args.output):

0 commit comments

Comments
 (0)