Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tianj7 committed Sep 29, 2023
1 parent 8a993b0 commit 0f67ddd
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions fence/oidc/oidc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

from fence import logger
from cdislogging import get_logger
from flask.wrappers import Request
from authlib.oauth2.rfc6749 import OAuth2Request, JsonRequest

logger = get_logger(__name__)

Expand Down Expand Up @@ -105,3 +107,34 @@ def create_oauth2_request(self, request):

logger.debug("request.method:" + oauth_request.method)
return oauth_request


class FenceOauth2Request(FlaskOAuth2Request):
def __init__(self, request: Request):
logger.debug("logging pre constructor")
for key in request.values.keys():
logger.debug(key + " : " + request.values[key])

super().__init__(request.method, request.url, None, request.headers)
self._request = request

logger.debug("logging post constructor")
for key in self.values.keys():
logger.debug(key + " : " + self.data[key])

if self.grant_type:
logger.debug("request.grant_type:" + self.grant_type)
else:
logger.debug("request.grant_type is None")

@property
def args(self):
return self._request.args

@property
def form(self):
return self._request.form

@property
def data(self):
return self._request.values

0 comments on commit 0f67ddd

Please sign in to comment.