diff options
author | NavaL <ayoyo@thoughtworks.com> | 2016-06-23 12:13:20 +0200 |
---|---|---|
committer | NavaL <ayoyo@thoughtworks.com> | 2016-06-23 12:13:20 +0200 |
commit | f1e5f54048cfadec42990f3dfb212c7147bf5faa (patch) | |
tree | 00e0b29d62a2b90fc350a25c18b833f6e6ad1330 /service/pixelated/resources | |
parent | 3b678f8d23a116a231be04e6f4da2219bd636362 (diff) |
refactoring: renaming services factory methods to relate them to user services sessions
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/__init__.py | 2 | ||||
-rw-r--r-- | service/pixelated/resources/auth.py | 2 | ||||
-rw-r--r-- | service/pixelated/resources/login_resource.py | 2 | ||||
-rw-r--r-- | service/pixelated/resources/logout_resource.py | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/service/pixelated/resources/__init__.py b/service/pixelated/resources/__init__.py index 8fc8080a..0015db16 100644 --- a/service/pixelated/resources/__init__.py +++ b/service/pixelated/resources/__init__.py @@ -72,7 +72,7 @@ class BaseResource(Resource): def is_logged_in(self, request): session = self.get_session(request) - return session.is_logged_in() and self._services_factory.is_logged_in(session.user_uuid) + return session.is_logged_in() and self._services_factory.has_session(session.user_uuid) def get_session(self, request): return IPixelatedSession(request.getSession()) diff --git a/service/pixelated/resources/auth.py b/service/pixelated/resources/auth.py index a6ab5396..5aedad3a 100644 --- a/service/pixelated/resources/auth.py +++ b/service/pixelated/resources/auth.py @@ -82,7 +82,7 @@ class SessionChecker(object): def requestAvatarId(self, credentials): session = self.get_session(credentials.request) - if session.is_logged_in() and self._services_factory.is_logged_in(session.user_uuid): + if session.is_logged_in() and self._services_factory.has_session(session.user_uuid): return defer.succeed(session.user_uuid) return defer.succeed(ANONYMOUS) diff --git a/service/pixelated/resources/login_resource.py b/service/pixelated/resources/login_resource.py index eaa21bd9..ab91176a 100644 --- a/service/pixelated/resources/login_resource.py +++ b/service/pixelated/resources/login_resource.py @@ -159,7 +159,7 @@ class LoginResource(BaseResource): @defer.inlineCallbacks def _setup_user_services(self, leap_session, request): user_id = leap_session.user_auth.uuid - if not self._services_factory.is_logged_in(user_id): + if not self._services_factory.has_session(user_id): yield self._services_factory.create_services_from(leap_session) self._services_factory.map_email(self.creds.username, user_id) diff --git a/service/pixelated/resources/logout_resource.py b/service/pixelated/resources/logout_resource.py index 4c700afe..a4fe584f 100644 --- a/service/pixelated/resources/logout_resource.py +++ b/service/pixelated/resources/logout_resource.py @@ -28,9 +28,9 @@ class LogoutResource(BaseResource): @defer.inlineCallbacks def _execute_logout(self, request): - session = self.get_session(request) - yield self._services_factory.log_out_user(session.user_uuid) - session.expire() + http_session = self.get_session(request) + yield self._services_factory.destroy_session(http_session.user_uuid) + http_session.expire() def render_POST(self, request): def _redirect_to_login(_): |