Skip to main content

parse_rust_rest/
lib.rs

1//! The read and write pipelines. The behavioral heart.
2//!
3//! Never references JS types, `serde_json::Value`-as-JS-value conventions, or JS async semantics.
4//! Everything JavaScript lives behind the sidecar socket, and keeping this crate clean of it is
5//! what makes that boundary real rather than aspirational. The one `serde_json` use is
6//! `query_parse` and `write`, which read client-supplied documents, and those are JSON on the
7//! wire rather than JS values.
8//!
9//! The authorization model lives in [`clp`] and [`acl`], and its structure is the point: stage
10//! one is a gate that throws, stage two is a filter that narrows the query, and passing the gate
11//! is not authorization to read anything.
12
13#![forbid(unsafe_code)]
14#![cfg_attr(
15    not(test),
16    deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
17)]
18
19pub mod acl;
20pub mod class_security;
21pub mod clp;
22pub mod guard;
23pub mod include;
24pub mod pipeline;
25pub mod query_parse;
26pub mod relations;
27pub mod snapshot;
28pub mod write;
29
30#[cfg(test)]
31pub mod testing;
32
33pub use acl::AclScope;
34pub use class_security::enforce_class_security;
35pub use clp::{
36    validate_permission, PermissionOptions, PointerPermOutcome, ProtectedFieldPlan, WriteAction,
37};
38pub use guard::{
39    reject_reserved_keys, reject_reserved_keys_in, strip_internal_keys, to_response_body,
40};
41pub use pipeline::{
42    count, create, delete, find, get, update, CreateResponse, Ctx, FindOptions, UpdateResponse,
43};
44pub use query_parse::{parse_include, parse_where, ParsedClause, ParsedWhere};
45pub use relations::RelatedToOutcome;
46pub use snapshot::SchemaSnapshot;
47pub use write::{decode_write_body, enforce_object_id_policy, WriteBody};