From 2d3f56c8dc4b6ec6639175641b1ed7ad90450a39 Mon Sep 17 00:00:00 2001 From: Bruno Henrique Date: Thu, 4 Feb 2021 10:55:36 -0300 Subject: [PATCH 1/2] Adding .idea (Pycharm) folder to .gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index e3ea440..a28f12c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,8 @@ htmlcov/ # testing py test.py + +#Pycharm +.idea +.idea/ +.idea/* From 19f58a873a865c3b63ecb67d8a0c7e595c5d357d Mon Sep 17 00:00:00 2001 From: Bruno Henrique Date: Thu, 4 Feb 2021 11:01:32 -0300 Subject: [PATCH 2/2] Exposing _request and _response with get_request() and get_response() --- fastapi_jwt_auth/auth_jwt.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fastapi_jwt_auth/auth_jwt.py b/fastapi_jwt_auth/auth_jwt.py index 4110bdb..48f9928 100644 --- a/fastapi_jwt_auth/auth_jwt.py +++ b/fastapi_jwt_auth/auth_jwt.py @@ -36,6 +36,18 @@ def __init__(self,req: Request = None, res: Response = None): auth = req.headers.get(self._header_name.lower()) if auth: self._get_jwt_from_headers(auth) + def get_request(self): + """ + Get incoming request + """ + return self._request + + def get_response(self): + """ + Get response from endpoint + """ + return self._response + def _get_jwt_from_headers(self,auth: str) -> "AuthJWT": """ Get token from the headers