authorization: update request handlers to accept WebRequest objects

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-11-09 07:00:53 -05:00
parent ac38899d1f
commit 7cd51fe1eb
1 changed files with 4 additions and 3 deletions

View File

@ -71,12 +71,13 @@ class Authorization:
"/access/oneshot_token", ['GET'], "/access/oneshot_token", ['GET'],
self._handle_token_request, protocol=['http']) self._handle_token_request, protocol=['http'])
async def _handle_apikey_request(self, path, method, args): async def _handle_apikey_request(self, web_request):
if method.upper() == 'POST': action = web_request.get_action()
if action.upper() == 'POST':
self.api_key = self._create_api_key() self.api_key = self._create_api_key()
return self.api_key return self.api_key
async def _handle_token_request(self, path, method, args): async def _handle_token_request(self, web_request):
return self.get_access_token() return self.get_access_token()
def _read_api_key(self): def _read_api_key(self):