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

Update public client - no auth #442

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions cbpro/public_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ def _send_message(self, method, endpoint, params=None, data=None):

"""
url = self.url + endpoint
if self.auth is not None and not all([
self.auth.api_key, self.auth.passphrase, self.auth.secret_key,
]):
self.auth = None
r = self.session.request(method, url, params=params, data=data,
auth=self.auth, timeout=30)
return r.json()
Expand Down Expand Up @@ -295,6 +299,11 @@ def _send_paginated_message(self, endpoint, params=None):
if params is None:
params = dict()
url = self.url + endpoint

if self.auth is not None and not all([
self.auth.api_key, self.auth.passphrase, self.auth.secret_key,
]):
self.auth = None
while True:
r = self.session.get(url, params=params, auth=self.auth, timeout=30)
results = r.json()
Expand Down