crossbar.bridge.rest.common

Attributes

Exceptions

_InvalidUnicode

Invalid Unicode was found.

Classes

_CommonResource

Shared components between PublisherResource and CallerResource.

Functions

_confirm_github_signature(request, secret_token, raw_body)

confirm that signature headers from GitHub are present and valid

_constant_compare(a, b)

Compare the two byte-strings 'a' and 'b' using a constant-time

_hmac_sha256(key, data)

Module Contents

_ALLOWED_CONTENT_TYPES[source]
class _CommonResource(options: Dict[str, Any], session: autobahn.twisted.wamp.ApplicationSession)[source]

Bases: twisted.web.resource.Resource

Shared components between PublisherResource and CallerResource.

_complete_request(request, code, body, **kwargs)[source]

Called when client request is complete.

_debug = False[source]
_deny_request(request, code, **kwargs)[source]

Called when client request is denied.

_fail_request(request, **kwargs)[source]

Called when client request fails.

_key = None[source]
_options[source]
_post_body_limit[source]
abstractmethod _process(request, event)[source]
_render_request(request)[source]

Receives an HTTP/POST|PUT request, and then calls the Publisher/Caller processor.

_require_ip = None[source]
_require_tls[source]
_secret = None[source]
_session[source]
_set_common_headers(request)[source]

Set common HTTP response headers.

_timestamp_delta_limit[source]
decode_as_json = True[source]
isLeaf = True[source]
log[source]
render(request)[source]

Handle the request. All requests start here.

exception _InvalidUnicode[source]

Bases: BaseException

Invalid Unicode was found.

_confirm_github_signature(request, secret_token, raw_body)[source]

confirm that signature headers from GitHub are present and valid

_constant_compare(a, b)[source]

Compare the two byte-strings ‘a’ and ‘b’ using a constant-time algorithm. The byte-strings should be the same length.

_hmac_sha256(key, data)[source]
Returns:

the HMAC-SHA256 of ‘data’ using ‘key’

_nonce[source]
_validator[source]