summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-03-29 14:37:41 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-03-30 15:10:56 -0300
commitc5c858f92b30862d0b8977b7559e437cdd073d7f (patch)
tree1f3bd8ea3ec2b2edb92ea1fbc457395246cac55d /service/pixelated
parent648aeebe1be3d29a6fdf3199a8d86d92de676b5a (diff)
[#932] Makes account recovery resource public
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/resources/account_recovery_resource.py5
-rw-r--r--service/pixelated/resources/login_resource.py3
-rw-r--r--service/pixelated/resources/root_resource.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/service/pixelated/resources/account_recovery_resource.py b/service/pixelated/resources/account_recovery_resource.py
index ccfdc580..8cb10fc8 100644
--- a/service/pixelated/resources/account_recovery_resource.py
+++ b/service/pixelated/resources/account_recovery_resource.py
@@ -18,19 +18,20 @@ import os
from pixelated.resources import BaseResource
from twisted.python.filepath import FilePath
-from pixelated.resources import get_protected_static_folder
+from pixelated.resources import get_public_static_folder
from twisted.web.http import OK
from twisted.web.template import Element, XMLFile, renderElement
class AccountRecoveryPage(Element):
- loader = XMLFile(FilePath(os.path.join(get_protected_static_folder(), 'account_recovery.html')))
+ loader = XMLFile(FilePath(os.path.join(get_public_static_folder(), 'account_recovery.html')))
def __init__(self):
super(AccountRecoveryPage, self).__init__()
class AccountRecoveryResource(BaseResource):
+ BASE_URL = 'account-recovery'
isLeaf = True
def __init__(self, services_factory):
diff --git a/service/pixelated/resources/login_resource.py b/service/pixelated/resources/login_resource.py
index 3e1200d7..45942ea6 100644
--- a/service/pixelated/resources/login_resource.py
+++ b/service/pixelated/resources/login_resource.py
@@ -20,6 +20,7 @@ from xml.sax import SAXParseException
from pixelated.authentication import Authenticator
from pixelated.config.leap import BootstrapUserServices
from pixelated.resources import BaseResource, UnAuthorizedResource, IPixelatedSession
+from pixelated.resources.account_recovery_resource import AccountRecoveryResource
from pixelated.resources import get_public_static_folder, respond_json
from twisted.cred.error import UnauthorizedLogin
from twisted.internet import defer
@@ -101,6 +102,8 @@ class LoginResource(BaseResource):
return self
if path == 'status':
return LoginStatusResource(self._services_factory)
+ if path == AccountRecoveryResource.BASE_URL:
+ return AccountRecoveryResource(self._services_factory)
if not self.is_logged_in(request):
return UnAuthorizedResource()
return NoResource()
diff --git a/service/pixelated/resources/root_resource.py b/service/pixelated/resources/root_resource.py
index 02f2fb62..d860c422 100644
--- a/service/pixelated/resources/root_resource.py
+++ b/service/pixelated/resources/root_resource.py
@@ -92,7 +92,7 @@ class RootResource(BaseResource):
def initialize(self, provider=None, disclaimer_banner=None, authenticator=None):
self._child_resources.add('assets', File(self._protected_static_folder))
- self._child_resources.add('account-recovery', AccountRecoveryResource(self._services_factory))
+ self._child_resources.add(AccountRecoveryResource.BASE_URL, AccountRecoveryResource(self._services_factory))
self._child_resources.add('backup-account', BackupAccountResource(self._services_factory, authenticator))
self._child_resources.add('sandbox', SandboxResource(self._protected_static_folder))
self._child_resources.add('keys', KeysResource(self._services_factory))