From 4ee00bad598deeb15251ca26876fa7d1b26aeebd Mon Sep 17 00:00:00 2001 From: SouthFox Date: Thu, 27 Jul 2023 20:30:02 +0800 Subject: [PATCH] [feat] auth flow --- demo/httpsig.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demo/httpsig.py b/demo/httpsig.py index 5e3b22c..65e7a29 100644 --- a/demo/httpsig.py +++ b/demo/httpsig.py @@ -15,7 +15,7 @@ from datetime import datetime from loguru import logger from dataclasses import dataclass -from demo.config import ID +from demo.config import ID, KEY_PATH @@ -165,3 +165,8 @@ class HTTPXSigAuth(httpx.Auth): logger.debug(f"signed request {sig_value=}") request.headers["signature"] = sig_value yield request + + +k = KEY_PATH.read_text() +k = RSA.importKey(k) +auth = HTTPXSigAuth(k)