File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,12 @@ Release History
66Upcoming
77++++++++
88
9- 1.5.2
9+ 1.5.3
10+ ++++++++++++++++++
11+
12+ - Bugfix so that ``JWTAuth `` opens the PEM private key file in ``'rb' `` mode.
13+
14+ 1.5.2 (2016-05-19)
1015++++++++++++++++++
1116
1217- Bugfix so that ``OAuth2 `` always has the correct tokens after a call to ``refresh() ``.
Original file line number Diff line number Diff line change 11# coding: utf-8
22
3- from __future__ import unicode_literals
3+ from __future__ import absolute_import , unicode_literals
44
55from datetime import datetime , timedelta
66import random
@@ -95,7 +95,7 @@ def __init__(
9595 refresh_token = None ,
9696 network_layer = network_layer ,
9797 )
98- with open (rsa_private_key_file_sys_path ) as key_file :
98+ with open (rsa_private_key_file_sys_path , 'rb' ) as key_file :
9999 self ._rsa_private_key = serialization .load_pem_private_key (
100100 key_file .read (),
101101 password = rsa_private_key_passphrase ,
@@ -182,6 +182,7 @@ def authenticate_instance(self):
182182 :rtype:
183183 `unicode`
184184 """
185+ self ._user_id = None
185186 return self ._auth_with_jwt (self ._enterprise_id , 'enterprise' )
186187
187188 def _refresh (self , access_token ):
Original file line number Diff line number Diff line change 33from __future__ import unicode_literals , absolute_import
44
55
6- __version__ = '1.5.2 '
6+ __version__ = '1.5.3 '
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def jwt_auth_init_mocks(
7373 }
7474
7575 mock_network_layer .request .return_value = successful_token_response
76- key_file_read_data = 'key_file_read_data'
76+ key_file_read_data = b 'key_file_read_data'
7777 with patch ('boxsdk.auth.jwt_auth.open' , mock_open (read_data = key_file_read_data ), create = True ) as jwt_auth_open :
7878 with patch ('cryptography.hazmat.primitives.serialization.load_pem_private_key' ) as load_pem_private_key :
7979 oauth = JWTAuth (
@@ -88,7 +88,7 @@ def jwt_auth_init_mocks(
8888 jwt_key_id = jwt_key_id ,
8989 )
9090
91- jwt_auth_open .assert_called_once_with (sentinel .rsa_path )
91+ jwt_auth_open .assert_called_once_with (sentinel .rsa_path , 'rb' )
9292 jwt_auth_open .return_value .read .assert_called_once_with () # pylint:disable=no-member
9393 load_pem_private_key .assert_called_once_with (
9494 key_file_read_data ,
You can’t perform that action at this time.
0 commit comments