1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-08 11:22:10 +03:00

companion: URL_DECODE -> Auth.FRONTIER_PATH_DECODE

This commit is contained in:
Athanasius 2021-08-17 14:48:09 +01:00
parent 52a6eeb82a
commit 661ffb100b
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -239,6 +239,7 @@ class Auth(object):
FRONTIER_PATH_AUTH = '/auth' FRONTIER_PATH_AUTH = '/auth'
FRONTIER_PATH_TOKEN = '/token' FRONTIER_PATH_TOKEN = '/token'
FRONTIER_PATH_DECODE = '/decode'
def __init__(self, cmdr: str) -> None: def __init__(self, cmdr: str) -> None:
self.cmdr: str = cmdr self.cmdr: str = cmdr
@ -370,7 +371,7 @@ class Auth(object):
if r.status_code == requests.codes.ok: if r.status_code == requests.codes.ok:
# Now we need to /decode the token to check the customer_id against FID # Now we need to /decode the token to check the customer_id against FID
r = self.session.get( r = self.session.get(
FRONTIER_AUTH_SERVER + URL_DECODE, FRONTIER_AUTH_SERVER + self.FRONTIER_PATH_DECODE,
headers={ headers={
'Authorization': f'Bearer {data_token.get("access_token", "")}', 'Authorization': f'Bearer {data_token.get("access_token", "")}',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -478,7 +479,6 @@ class Session(object):
"""Methods for handling Frontier Auth and CAPI queries.""" """Methods for handling Frontier Auth and CAPI queries."""
STATE_INIT, STATE_AUTH, STATE_OK = list(range(3)) STATE_INIT, STATE_AUTH, STATE_OK = list(range(3))
URL_DECODE = '/decode'
def __init__(self) -> None: def __init__(self) -> None:
self.state = Session.STATE_INIT self.state = Session.STATE_INIT