[lint] some lint
Some checks failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
SouthFox 2023-07-27 15:49:14 +08:00
parent 6b27db30b2
commit 60aa82b63d

View file

@ -6,16 +6,17 @@ import base64
import httpx import httpx
import hashlib import hashlib
from datetime import datetime
from app import logger
from demo.config import ID
from dataclasses import dataclass
from Crypto.Hash import SHA256 from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_v1_5 from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA from Crypto.PublicKey import RSA
from werkzeug.datastructures import Headers from werkzeug.datastructures import Headers
from httpx import Headers as Httpx_headers from httpx import Headers as Httpx_headers
from datetime import datetime
from loguru import logger
from dataclasses import dataclass
from demo.config import ID
@dataclass @dataclass
@ -158,7 +159,8 @@ class HTTPXSigAuth(httpx.Auth):
key_id = f"{ID}#main-key" key_id = f"{ID}#main-key"
sig_value = f'keyId="{key_id}",algorithm="rsa-sha256",headers="{sigheaders}",signature="{sig.decode()}"' # noqa: E501 sig_value = f'keyId="{key_id}",algorithm="rsa-sha256",\
headers="{sigheaders}",signature="{sig.decode()}"'
logger.debug(f"signed request {sig_value=}") logger.debug(f"signed request {sig_value=}")
r.headers["signature"] = sig_value r.headers["signature"] = sig_value
yield r yield r