Skip to content

Data models: traffic and settings ​

Captured HTTP and WebSocket traffic, and the key-value settings store. Part of the data model reference.

ProxyFlow ​

File: proxy_flow.py · Table: proxy_flows · Exposure: API

One HTTP request/response exchange in a vault's history, captured by the proxy or sent from the replay tool. See HTTP history for how flows are captured and displayed.

FieldTypeNotes
vault_idFK → vaults.idNot null, indexed, ON DELETE CASCADE
sourceEnum FlowSourceNot null, default PROXY
methodString(16)Not null
schemeString(8)Not null, http or https
hostString(255)Not null, indexed
portIntegerNot null
pathTextNot null
queryTextNullable, raw query without ?
http_versionString(16)Nullable
request_headersJSONDefault [], ordered [name, value] pairs
request_bodyLargeBinaryNullable, raw bytes up to PROXY_BODY_LIMIT, content codings kept
request_sizeIntegerDefault 0, full size seen on the wire
request_truncatedBooleanDefault False
status_codeIntegerNullable, indexed; null when no response arrived
response_headersJSONDefault [], ordered [name, value] pairs
response_bodyLargeBinaryNullable, as for the request
response_sizeIntegerDefault 0
response_truncatedBooleanDefault False
mime_typeString(255)Nullable, response Content-Type without parameters
duration_msIntegerNullable
in_scopeBooleanNot null, indexed, default False; set from the vault scope at capture time
errorTextNullable, for example Dropped in intercept
interceptedBooleanNot null, default False (server default false): a side was held in intercept
editedBooleanNot null, default False (server default false): a held side was edited before sending
kindString(16)Not null, default http (server default): websocket for the handshake of a WebSocket session (WebSocket sessions)

The stored messages are always the ones that were actually sent.

Indexes: ix_flow_vault_id_desc (vault_id, id) for newest-first paging; ix_flow_vault_created (vault_id, created_at) for retention by age (Capture filters, body limits and retention).

Relationships: vault (backref Vault.proxy_flows, cascade='all, delete-orphan', passive_deletes=True).

Properties: url, the absolute URL with a non-default port and the query string.

FlowSource ​

PROXY (proxy, captured by the intercepting proxy), REPLAY (replay, sent from the replay tool)

FlowKind ​

HTTP (http), WEBSOCKET (websocket); stored as the value.


WsSession, WsFrame ​

File: websocket.py · Tables: ws_sessions, ws_frames · Exposure: API (WebSocket sessions)

WsSession (BaseModel) is the summary of one WebSocket session: flow_id (FK → proxy_flows.id, unique, ON DELETE CASCADE), client_frames, server_frames, client_bytes, server_bytes, stored_bytes, dropped_frames (integers, server default 0), extensions, protocol (String(255)), opened_at, closed_at (DateTime tz), close_code, close_reason, closed_by (client/server), error.

WsFrame (plain Base, no created/updated stamps) is one message: flow_id (FK → proxy_flows.id, ON DELETE CASCADE), seq, direction (String(8)), opcode (SmallInteger, RFC 6455 number), payload (LargeBinary, nullable), size, wire_size, truncated, masked, compressed, inflated, fragments, close_code, close_reason, observed_at (DateTime tz, not null).

Constraints and indexes: uq_ws_frame_flow_seq (flow_id, seq) for keyset paging; ix_ws_frame_flow_direction (flow_id, direction, seq).


AppSetting ​

File: app_setting.py · Table: app_settings · Exposure: indirect

A persisted workstation setting, stored as a JSON value under a dotted key. Saved values take precedence over environment defaults. It is read and written through SettingService (app/services/setting_service.py) and AppSettingRepository. There is no generic settings endpoint.

FieldTypeNotes
keyString(128)Not null, unique, indexed
valueJSONNot null

Keys in use:

KeyWritten byValue
proxy.listenPUT /api/v1/proxy/settings{"host": str, "port": int}
proxy.interceptPUT /api/v1/proxy/intercept{"requests", "responses", "in_scope_only"} booleans (the switch itself is not persisted)
proxy.intercept.rulesPUT /api/v1/proxy/intercept/rulesOrdered list of intercept filter rules
proxy.capturePUT /api/v1/proxy/captureCapture filter, rules and body limits (Capture filters, body limits and retention)
proxy.retentionPUT /api/v1/proxy/retentionHistory retention policy (Capture filters, body limits and retention)