Skip to content

Commit

Permalink
Allow set_token to change token_type (#10)
Browse files Browse the repository at this point in the history
* Allow set_token to change token_type

Update version to 0.7.0

* Add proper versions to requirements
  • Loading branch information
dkarchmer authored Oct 6, 2017
1 parent 3dba109 commit c82483d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v0.7.0 (2017-10-05)

* New data.report.AccumulationReportGenerator to compute sums across projects, devices and/or streams
* Allow set_token to switch token_type

### v0.6.5 (2017-09-10)

* Fixes deployment issue
Expand Down
5 changes: 4 additions & 1 deletion iotile_cloud/api/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ def __init__(self, domain=None, token_type=None):
if token_type:
self.token_type = token_type

def set_token(self, token):
def set_token(self, token, token_type=None):
self.token = token
if token_type:
self.token_type = token_type

def login(self, password, email):
data = {'email': email, 'password': password}
Expand Down Expand Up @@ -259,6 +261,7 @@ def refresh_token(self):
:return: True if token was refreshed. False otherwise
"""
assert self.token_type == DEFAULT_TOKEN_TYPE
url = '{0}/{1}'.format(self.base_url, 'auth/api-jwt-refresh/')

payload = json.dumps({'token': self.token})
Expand Down
2 changes: 1 addition & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pip
twine
tox
tox==2.6.0
10 changes: 5 additions & 5 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pytest
unittest2
pytest==3.0.6
unittest2==1.1
coverage==3.7.1
coveralls
mock
requests-mock
coveralls==1.1
mock==2.0.0
requests-mock==1.3.0
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '0.6.5'
version = '0.7.0'

0 comments on commit c82483d

Please sign in to comment.