backend.globaleaks.rest.api

Module Contents

Classes

APIResourceWrapper
backend.globaleaks.rest.api.tid_regexp = ([0-9]+)[source]
backend.globaleaks.rest.api.uuid_regexp = ([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})[source]
backend.globaleaks.rest.api.key_regexp = ([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[a-z_]{0,100})[source]
backend.globaleaks.rest.api.api_spec = [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None][source]
class backend.globaleaks.rest.api.APIResourceWrapper[source]

Bases: twisted.web.resource.Resource

_registry[source]
isLeaf = True[source]
method_map[source]
should_redirect_https(self, request)[source]
should_redirect_tor(self, request)[source]
redirect_https(self, request)[source]
redirect_tor(self, request)[source]
handle_exception(self, e, request)[source]

handle_exception is a callback that decorators all deferreds in render

It responds to properly handled GL Exceptions by pushing the error msgs to the client and it spools a mail in the case the exception is unknown and unhandled.

Parameters:
  • e – A Twisted.python.Failure instance that wraps a GLException or a normal Exception
  • request – A twisted.web.Request
preprocess(self, request)[source]
render(self, request)[source]
Parameters:requesttwisted.web.Request
Returns:empty str or NOT_DONE_YET
set_headers(self, request)[source]
parse_accept_language_header(self, request)[source]
detect_language(self, request)[source]