Skip to content

Commit

Permalink
Merge pull request #57 from bookernath/remove-streql-dependency
Browse files Browse the repository at this point in the history
Remove dependency on streql
  • Loading branch information
bookernath authored Jul 20, 2017
2 parents b857e6e + 305fa18 commit ba09742
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bigcommerce API Python Client
Wrapper over the ``requests`` library for communicating with the Bigcommerce v2 API.

Install with ``pip install bigcommerce`` or ``easy_install bigcommerce``. Tested with
python 2.7 and 3.4, and only requires ``requests`` and ``streql``.
python 2.7.7+ and 3.4, and only requires ``requests`` and ``pyjwt``.

Usage
-----
Expand Down
3 changes: 1 addition & 2 deletions bigcommerce/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import json # only used for urlencode querystr
import logging
import streql
import requests

from bigcommerce.exception import *
Expand Down Expand Up @@ -216,7 +215,7 @@ def verify_payload(signed_payload, client_secret):
dc_json = base64.b64decode(encoded_json)
signature = base64.b64decode(encoded_hmac)
expected_sig = hmac.new(client_secret.encode(), base64.b64decode(encoded_json), hashlib.sha256).hexdigest()
authorised = streql.equals(signature, expected_sig)
authorised = hmac.compare_digest(signature, expected_sig.encode())
return json.loads(dc_json.decode()) if authorised else False

def fetch_token(self, client_secret, code, context, scope, redirect_uri,
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ mock==1.0.1
nose==1.3.0
nose-cov==1.6
requests==2.1.0
streql==3.0.2
pyjwt==1.4.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(fname):
version = VERSION,

packages = find_packages(),
install_requires = ['requests>=2.1.0', 'streql>=3.0.2', 'pyjwt>=1.4.0'],
install_requires = ['requests>=2.1.0', 'pyjwt>=1.4.0'],


url = 'https://github.com/bigcommerce/bigcommerce-api-python',
Expand Down

0 comments on commit ba09742

Please sign in to comment.