Attention

This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.

Storage

Storage implementations are in charge of persisting transactions and messages into a backend (database, memory, …) using eventual dependencies.

Each storages should implement the Storage protocol.

Model

../../_images/storage-model.png
  • a Transaction represents a transaction that went through the proxy. A set of request-response forms a transaction in the case of an HTTP transaction (although the response may not be present in case of an in progress transaction or a timed out transaction).

  • a Message represents an atomic message that went through the proxy. An http request or response is a message.

  • a Blob represents a binary content, for example the headers or the body of an http request or response.

Protocol

class Storage[source]
__init__(*args, **kwargs)
async create_users_once_ready(users)[source]

Create users.

Parameters:

users (Iterable[str])

async get_blob(blob_id)[source]

Retrieve a blob, by id. Blobs are content adressable, although the hash is built on the source data and blob filters may be applied to the source data before storage, meaning that the hash may not be re-computable once storage is done.

async get_facet_meta(name)[source]

Retrieve a facet’s metadata, by name.

async get_transaction(id, /, *, username)[source]

Find a transaction, by id.

Parameters:
async get_transaction_list(*, username, with_messages=False, filters=None, page=1, cursor='', text_search='')[source]

Find transactions, using optional filters, for example to be displayed in the dashboard.

Parameters:
async get_usage()[source]

Get storage usage.

async set_user_flag(*, transaction_id, username, flag, value=True)[source]

Sets or unsets a user flag on a transaction.

Parameters:
  • transaction_id (str)

  • username (str)

  • flag (int)