Skip to main content

Crate osproxy_engine

Crate osproxy_engine 

Source
Expand description

Pipeline orchestration.

Drives a request through the stages, authenticate, authorize, classify, resolve, transform, dispatch, reverse-transform, egress (docs/04 §1), wiring the other crates together through osproxy-core types and osproxy-spi traits. It owns no low-level wire or parsing detail.

M1 lands the write-path core: build_write_batch turns a resolved routing decision plus the request body into the epoch-stamped WriteBatch the sink delivers. M2 adds the get-by-id read path: the Pipeline maps a client’s logical id to the physical id, fetches it through the Reader seam, and strips the injected tenancy fields so the client sees its logical document, the write→read round-trip symmetry the model rests on.

Structs§

AdminPolicy
The operator’s admin pass-through policy: the cluster that answers admin requests and the path prefixes permitted through. A request whose path does not match an allowed prefix is rejected, so enabling pass-through for _cat/health does not silently open _cluster/settings.
NoQueue
The default queue: async writes are unavailable. An async request against a pipeline with no queue is refused with 422, never accepted-and-dropped.
PassthroughPolicy
Where a passthrough proxy forwards a matching request: one cluster and its base URL, plus the logical-index prefixes that select which requests pass through verbatim (empty ⇒ all of them).
Pipeline
Orchestrates requests through a tenancy router and a sink.
PipelineResponse
The response the pipeline produces for a handled request.
QueueError
A failure to enqueue an async write. Carries a value-free reason only.
QueuedWrite
A mutation accepted for asynchronous fan-out: the fully-resolved, epoch-stamped WriteBatch the sync path would have dispatched, plus the correlation/idempotency id and the ordering key.
RetryPolicy
How the proxy retries a transiently-unavailable placement backend.
StreamSearch
The outcome of a streaming search: the upstream status and the response body as a live ByteBody, the hits transformed incrementally, all siblings (including aggregations) passed through verbatim, none of it buffered.

Enums§

RequestError
A failure anywhere on the request path.
WriteMode
How a mutation is dispatched.

Traits§

WriteQueue
A queue that durably accepts resolved write ops for downstream fan-out.

Functions§

build_write_batch
Builds the single-document write batch for a resolved ingest request.
op_id_for
Resolves the op id for a request: the validated client-supplied X-Op-Id, or the proxy’s own request id when the header is absent or malformed. Always returns a usable id so the loop can always be correlated.
unsupported_async
Why a mutation cannot be honored in async mode, if it cannot, a short, value-free reason for the 400. These all need read-modify-write against the document’s current state, which does not exist at enqueue time, so async rejects them rather than silently mis-applying or dropping the precondition.
valid_op_id
Whether candidate is an acceptable op id: non-empty, within MAX_OP_ID_LEN, and limited to a safe key charset (A-Za-z0-9-_.:).