Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauth #1374

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Oauth #1374

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Trading/Exchange/bitmart/bitmart_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class BitMartConnector(exchanges.CCXTConnector):
def _client_factory(self, force_unauth, keys_adapter=None) -> tuple:
return super()._client_factory(force_unauth, keys_adapter=self._keys_adapter)

def _keys_adapter(self, key, secret, password, uid):
def _keys_adapter(self, key, secret, password, uid, auth_token):
# use password as uid
return key, secret, "", password
return key, secret, "", password, None, None


class BitMart(exchanges.RestExchange):
Expand Down
7 changes: 5 additions & 2 deletions Trading/Exchange/coinbase/coinbase_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ class CoinbaseConnector(ccxt_connector.CCXTConnector):
def _client_factory(self, force_unauth, keys_adapter=None) -> tuple:
return super()._client_factory(force_unauth, keys_adapter=self._keys_adapter)

def _keys_adapter(self, key, secret, password, uid):
def _keys_adapter(self, key, secret, password, uid, auth_token):
if auth_token:
# when auth token is provided, force invalid keys
return "ANY_KEY", "ANY_SECRET", password, uid, auth_token, "Bearer "
# CCXT pem key reader is not expecting users to under keys pasted as text from the coinbase UI
# convert \\n to \n to make this format compatible as well
if secret and "\\n" in secret:
secret = secret.replace("\\n", "\n")
return key, secret, password, uid
return key, secret, password, uid, None, None

@_coinbase_retrier
async def _load_markets(self, client, reload: bool):
Expand Down