Skip to content

Commit

Permalink
expose jwt for token based logon, if set will override u/p.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvberg committed Sep 20, 2023
1 parent a12a2ca commit 67ed560
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openfeed/openfeed_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@

class OpenfeedClient(object):

def __init__(self, username, password, server="openfeed.aws.barchart.com", debug=False):
def __init__(self, username, password, server="openfeed.aws.barchart.com", debug=False, jwt=""):
self.server = server
self.username = username
self.password = password
self.debug = debug
self.jwt = jwt
self.ws = websocket.WebSocket()
self.token = None

Expand Down Expand Up @@ -625,7 +626,7 @@ def __create_login_request(self):
return openfeed_api_pb2.OpenfeedGatewayRequest(
loginRequest=openfeed_api_pb2.LoginRequest(
protocolVersion=1, clientVersion=client_version,
username=self.username, password=self.password))
username=self.username, password=self.password, jwt=self.jwt))

def __callback(self, callback, *args):
try:
Expand Down

0 comments on commit 67ed560

Please sign in to comment.