diff --git a/src/_zkapauthorizer/resource.py b/src/_zkapauthorizer/resource.py index c180a5b064a9a74e8bfb38126dd446f3fdab3d1a..6e5409bbc16a696e076d1d9d8de64e0a1460223a 100644 --- a/src/_zkapauthorizer/resource.py +++ b/src/_zkapauthorizer/resource.py @@ -78,8 +78,8 @@ def from_configuration(node_config, store, redeemer=None): ), ) root.putChild( - b"zkap", - _ZKAPCollection( + b"blinded-token", + _BlindedTokenCollection( store, controller, ), @@ -96,10 +96,10 @@ def application_json(request): request.responseHeaders.setRawHeaders(u"content-type", [u"application/json"]) -class _ZKAPCollection(Resource): +class _BlindedTokenCollection(Resource): """ - This class implements inspection of ZKAPs. Users **GET** this resource to - find out about ZKAPs in the system. + This class implements inspection of blinded tokens. Users **GET** this + resource to find out about blinded tokens in the system. """ _log = Logger() @@ -110,10 +110,10 @@ class _ZKAPCollection(Resource): def render_GET(self, request): """ - Retrieve some ZKAPs and associated informatin. + Retrieve some blinded tokens and associated information. """ application_json(request) - return dumps({u"total": 0, u"zkaps": []}) + return dumps({u"total": 0, u"blinded-tokens": []}) diff --git a/src/_zkapauthorizer/tests/test_client_resource.py b/src/_zkapauthorizer/tests/test_client_resource.py index 0bab6d268c3bad30a0869c90d146519b40647f4d..430d81d51e7545568eb990cbde480a9db4c1016b 100644 --- a/src/_zkapauthorizer/tests/test_client_resource.py +++ b/src/_zkapauthorizer/tests/test_client_resource.py @@ -209,7 +209,7 @@ class ResourceTests(TestCase): """ General tests for the resources exposed by the plugin. """ - @given(tahoe_configs(), requests(just([u"zkap"]) | just([u"voucher"]))) + @given(tahoe_configs(), requests(just([u"blinded-token"]) | just([u"voucher"]))) def test_reachable(self, get_config, request): """ A resource is reachable at a child of the resource returned by @@ -224,19 +224,22 @@ class ResourceTests(TestCase): ) -class ZKAPTests(TestCase): +class BlindedTokenTests(TestCase): """ - Tests relating to ``/zkap`` as implemented by the + Tests relating to ``/blinded-token`` as implemented by the ``_zkapauthorizer.resource`` module. """ def setUp(self): - super(ZKAPTests, self).setUp() + super(BlindedTokenTests, self).setUp() self.useFixture(CaptureTwistedLogs()) @given(tahoe_configs()) def test_get(self, get_config): """ + When the blinded token collection receives a **GET**, the response is the + total number of blinded tokens in the system and the blinded tokens + themselves. """ tempdir = self.useFixture(TempDir()) config = get_config(tempdir.join(b"tahoe"), b"tub.port") @@ -244,7 +247,7 @@ class ZKAPTests(TestCase): agent = RequestTraversalAgent(root) requesting = agent.request( b"GET", - b"http://127.0.0.1/zkap", + b"http://127.0.0.1/blinded-token", ) self.addDetail( u"requesting result", @@ -260,7 +263,7 @@ class ZKAPTests(TestCase): succeeded( Equals({ u"total": 0, - u"zkaps": [], + u"blinded-tokens": [], }), ) ),