mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 21:17:54 +00:00
A better name for the API.
This commit is contained in:
parent
6c514dfda5
commit
c921b153f4
@ -47,7 +47,7 @@ def _authorization_decorator(f):
|
|||||||
return route
|
return route
|
||||||
|
|
||||||
|
|
||||||
def _route(app, *route_args, **route_kwargs):
|
def _authorized_route(app, *route_args, **route_kwargs):
|
||||||
"""
|
"""
|
||||||
Like Klein's @route, but with additional support for checking the
|
Like Klein's @route, but with additional support for checking the
|
||||||
``Authorization`` header as well as ``X-Tahoe-Authorization`` headers. The
|
``Authorization`` header as well as ``X-Tahoe-Authorization`` headers. The
|
||||||
@ -89,6 +89,6 @@ class HTTPServer(object):
|
|||||||
# TODO if data is big, maybe want to use a temporary file eventually...
|
# TODO if data is big, maybe want to use a temporary file eventually...
|
||||||
return dumps(data)
|
return dumps(data)
|
||||||
|
|
||||||
@_route(_app, "/v1/version", methods=["GET"])
|
@_authorized_route(_app, "/v1/version", methods=["GET"])
|
||||||
def version(self, request, authorization):
|
def version(self, request, authorization):
|
||||||
return self._cbor(request, self._storage_server.remote_get_version())
|
return self._cbor(request, self._storage_server.remote_get_version())
|
||||||
|
Loading…
Reference in New Issue
Block a user