Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
[#924] Fix typo on bonafide session variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
thaissiqueira committed Mar 15, 2017
1 parent fa6b288 commit f75fca7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions service/pixelated/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Authenticator(object):
def __init__(self, leap_provider):
self._leap_provider = leap_provider
self.domain = leap_provider.server_name
self.bonafide_sesssion = None
self.bonafide_session = None

@inlineCallbacks
def authenticate(self, username, password):
Expand All @@ -50,11 +50,11 @@ def _srp_auth(self, username, password):
def _bonafide_auth(self, user, password):
srp_provider = Api(self._leap_provider.api_uri)
credentials = Credentials(user, password)
self.bonafide_sesssion = Session(credentials, srp_provider, self._leap_provider.local_ca_crt)
yield self.bonafide_sesssion.authenticate()
self.bonafide_session = Session(credentials, srp_provider, self._leap_provider.local_ca_crt)
yield self.bonafide_session.authenticate()
returnValue(Authentication(user,
self.bonafide_sesssion.token,
self.bonafide_sesssion.uuid,
self.bonafide_session.token,
self.bonafide_session.uuid,
'session_id',
{'is_admin': False}))

Expand Down
2 changes: 1 addition & 1 deletion service/pixelated/resources/backup_account_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _render_template(self, request):
return renderElement(request, site)

def render_POST(self, request):
account_recovery = AccountRecovery(self._authenticator.bonafide_sesssion)
account_recovery = AccountRecovery(self._authenticator.bonafide_session)

def update_response(response):
request.setResponseCode(NO_CONTENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_post_updates_recovery_code(self, mock_account_recovery_init):
d = self.web.get(request)

def assert_update_recovery_code_called(_):
mock_account_recovery_init.assert_called_with(self.resource._authenticator.bonafide_sesssion)
mock_account_recovery_init.assert_called_with(self.resource._authenticator.bonafide_session)
mock_account_recovery.update_recovery_code.assert_called()

d.addCallback(assert_update_recovery_code_called)
Expand Down
2 changes: 1 addition & 1 deletion service/test/unit/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_successful_bonafide_auth_should_return_the_user_authentication_object(s
self.assertEquals('username', resulting_auth.username)
self.assertEquals('some_token', resulting_auth.token)
self.assertEquals('some_uuid', resulting_auth.uuid)
self.assertEquals(mock_srp_auth, auth.bonafide_sesssion)
self.assertEquals(mock_srp_auth, auth.bonafide_session)

def test_username_without_domain_is_not_changed(self):
username_without_domain = 'username'
Expand Down

0 comments on commit f75fca7

Please sign in to comment.