harp_apps.proxy.events¶
- class HttpMessageEvent[source]¶
Bases:
TransactionEvent- __init__(transaction, message, *, max_body_size=None)[source]¶
- Parameters:
transaction (Transaction)
message (BaseHttpMessage)
max_body_size (int | None)
- max_body_size¶
How many bytes of the body recorders should keep,
Nonefor all of it.
- class ProxyErrorEvent[source]¶
Bases:
TransactionEvent- __init__(transaction, error)[source]¶
- Parameters:
transaction (Transaction)
error (HttpError)
- class ProxyFilterEvent[source]¶
Bases:
Event- __init__(endpoint, /, *, request, response=None, transaction=None)[source]¶
- Parameters:
endpoint (str)
request (HttpRequest)
response (HttpResponse | None)
transaction (Transaction | None)
- apply_script_context(context)[source]¶
Take into account what a script left in its execution context.
- Parameters:
context (dict)
- set_response(response)[source]¶
- Parameters:
response (HttpResponse)
- 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 (seenormalize_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.