File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 77import sys
88from typing import cast
99
10-
1110import uvicorn
1211from uvicorn .supervisors import Multiprocess
1312
Original file line number Diff line number Diff line change 2121import datetime
2222import pathlib
2323import subprocess
24- from hmac import HMAC , compare_digest
2524from hashlib import sha256
25+ from hmac import HMAC , compare_digest
2626from typing import Dict , Optional , Union
2727
2828import 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 )
You can’t perform that action at this time.
0 commit comments