harp_apps.proxy.events

Inheritance diagram of harp_apps.proxy.events

class HttpMessageEvent[source]

Bases: TransactionEvent

__init__(transaction, message, *, max_body_size=None)[source]
Parameters:
max_body_size

How many bytes of the body recorders should keep, None for all of it.

class ProxyErrorEvent[source]

Bases: TransactionEvent

__init__(transaction, error)[source]
Parameters:
class ProxyFilterEvent[source]

Bases: Event

__init__(endpoint, /, *, request, response=None, transaction=None)[source]
Parameters:
apply_script_context(context)[source]

Take into account what a script left in its execution context.

Parameters:

context (dict)

create_execution_context()[source]
execute_script(script)[source]
Parameters:

script (Callable)

set_response(response)[source]
Parameters:

response (HttpResponse)

update(mixed)[source]
Parameters:

mixed (dict | HttpResponse | Self | None)

Return type:

Self

property alternate_fingerprints: list[str]

Other fingerprints an upstream may act on for the same request (see _normalize_path_variants()).

property criteria
property fingerprint

<METHOD> <path>, with the path as rules see it (see normalize_path()), no query string.

class TransactionEvent[source]

Bases: Event

__init__(transaction)[source]
Parameters:

transaction (Transaction)

EVENT_FILTER_PROXY_REQUEST = 'proxy.filter.request'

Event fired when an incoming request is ready to be filtered, for example by the rules application.

EVENT_FILTER_PROXY_RESPONSE = 'proxy.filter.response'

Event fired when an outgoing response is ready to be filtered, for example by the rules application.

EVENT_PROXY_ERROR = 'proxy.error'

An error happened.

EVENT_TRANSACTION_ENDED = 'proxy.transaction.ended'

Event fired when a transaction is finished, once the response body has been streamed to the caller.

EVENT_TRANSACTION_MESSAGE = 'proxy.transaction.message'

Event fired when a message is sent to a transaction (either request or response).

EVENT_TRANSACTION_STARTED = 'proxy.transaction.started'

Event fired when a transaction is created.