Skip to content

Commit e62a3c6

Browse files
committed
black and isort
1 parent 14434be commit e62a3c6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

mystbin/backend/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import sys
88
from typing import cast
99

10-
1110
import uvicorn
1211
from uvicorn.supervisors import Multiprocess
1312

mystbin/backend/routers/admin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import datetime
2222
import pathlib
2323
import subprocess
24-
from hmac import HMAC, compare_digest
2524
from hashlib import sha256
25+
from hmac import HMAC, compare_digest
2626
from typing import Dict, Optional, Union
2727

2828
import psutil
@@ -257,14 +257,14 @@ async def release_hook(request: MystbinRequest):
257257
with open(config) as f:
258258
config = ujson.load(f)
259259

260-
SECRET = config['github_secret'].encode()
260+
SECRET = config["github_secret"].encode()
261261

262-
received_sign = request.headers.get('X-Hub-Signature-256').split('sha256=')[-1].strip()
262+
received_sign = request.headers.get("X-Hub-Signature-256").split("sha256=")[-1].strip()
263263
expected_sign = HMAC(key=SECRET, msg=await request.body(), digestmod=sha256).hexdigest()
264264
if not compare_digest(received_sign, expected_sign):
265265
return UJSONResponse({"error": "Unauthorized"}, status_code=401)
266266

267-
command = 'cd /root/MystBin/; git pull;'
267+
command = "cd /root/MystBin/; git pull;"
268268
subprocess.run(command, stdout=subprocess.PIPE, shell=True)
269269

270270
return Response(status_code=200)

0 commit comments

Comments
 (0)