From e3999c4906348dadcc85eec1df9a48e776deccd5 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Thu, 23 Feb 2017 00:35:33 +0100 Subject: [feature] require authentication token for api implements a global auth token for the app. this token is written to .config/leap/authtoken, and passed to the anchor part of the landing URI when opening the index resource by the browser. - Resolves: #8765 --- tests/unit/core/test_web_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/core/test_web_api.py b/tests/unit/core/test_web_api.py index 5b51869f..10356f02 100644 --- a/tests/unit/core/test_web_api.py +++ b/tests/unit/core/test_web_api.py @@ -131,7 +131,7 @@ class RESTApiTests(unittest.TestCase): def setUp(self): dispatcher = dummyDispatcherFactory() - api = web.api.Api(dispatcher) + api = web.api.Api(dispatcher, ['aaa']) root = resource.Resource() root.putChild(b"API", api) plainSite = Site(root) @@ -205,7 +205,8 @@ class RESTApiTests(unittest.TestCase): uri = networkString("http://127.0.0.1:%d/API/%s" % ( self.plainPortno, path)) return client.getPage( - uri, method=method, timeout=1, postdata=postdata) + uri, method=method, timeout=1, postdata=postdata, + headers={'X-Bitmask-Auth': 'aaa'}) def assertCall(self, returned, expected): data = json.loads(returned) -- cgit v1.2.3