offline-protocol 0.26.0

Main protocol engine for the Offline Protocol SDK
Documentation
[package]
name = "offline-protocol"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
# AGPL-3.0-only requires the license text to accompany the program, and a
# published crate ships on its own. Rather than `license-file = "../../LICENSE"`
# (which makes cargo warn that `license` and `license-file` are redundant on
# every invocation), each publishable crate carries its own byte-identical
# LICENSE copy; cargo packages every git-tracked file under the crate root, so
# it lands in the .crate archive. scripts/check-license-consistency.sh asserts
# the copies never drift.
repository.workspace = true
rust-version.workspace = true
description = "Main protocol engine for the Offline Protocol SDK"

[lints]
workspace = true

[features]
default = ["data", "telemetry-pipe"]
# Replicated documents. Gates the engine dependency and the store, never the
# configuration section, the storage categories, or the events: those are
# inert without the engine and gating them would fork the config surface and
# the events guard test for no binary saving.
data = ["dep:offline-protocol-data"]
# The telemetry pipe: classification, the durable batch queue, and the HTTPS
# uploader that ships accepted events to the ingest. Gates the only network
# egress, the only background thread and the only TLS stack in the workspace,
# so a build that wants none of those (a bench, a bare embedder) opts out with
# `default-features = false`. Default on for the same reason `data` is: the
# mobile bindings ship one FFI artifact, and a feature-gated UDL method would
# be a runtime checksum mismatch rather than a build error.
telemetry-pipe = ["dep:ureq", "dep:offline-protocol-telemetry-wire"]
# Test seams: a capturing stand-in for the telemetry pipe's HTTPS client, so
# a test in another crate can see every upload without a network. Enabled by
# dev-dependencies only; a shipped binary never carries it.
test-utils = []

[dependencies]
offline-protocol-core = { workspace = true }
offline-protocol-transport = { workspace = true }
offline-protocol-router = { workspace = true }
offline-protocol-reliability = { workspace = true }
# The sealed layer: the envelope codec this crate's send and receive paths
# encode with, and the canonical signing-payload construction the control
# plane signs and verifies over. Shared with a leaf node rather than
# restated here; see ADR 0022.
offline-protocol-sealed = { workspace = true }
offline-protocol-mls = { workspace = true }
offline-protocol-services = { workspace = true }
# Optional: the replicated-document layer. Default on, because the mobile
# bindings ship one FFI artifact and a feature-gated UDL object would be a
# runtime checksum mismatch rather than a build error. Native consumers that
# only want messaging opt out with `default-features = false` and pay none of
# the engine's bytes.
offline-protocol-data = { workspace = true, optional = true }
# Optional: the telemetry pipe's wire types and its HTTPS client. `ureq` with
# exactly the `rustls` feature is rustls + ring + the bundled Mozilla roots and
# no optional extra (no gzip, no SOCKS, no charset), which is the smallest TLS
# stack that still trusts a public CA without consulting the device's store.
# HTTP CONNECT proxy support is part of ureq's core rather than a feature: the
# uploader can use an HTTP CONNECT proxy selected through the environment, read
# when telemetry is enabled, and TLS still runs end to end to the ingest,
# validated against the bundled roots. The uploader names that proxy source,
# the redirect limit and the root store in its agent configuration rather than
# inheriting ureq's defaults; see docs/telemetry.md.
offline-protocol-telemetry-wire = { workspace = true, optional = true }
ureq = { version = "3.4", default-features = false, features = ["rustls"], optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
uuid = { workspace = true }
chrono = { workspace = true }
tracing = { workspace = true }
base64 = { workspace = true }
# The Nostr author key is hex on the wire and hex in the discovery record, so
# the comparison that binds the two never crosses an encoding.
hex = { workspace = true }
sha2 = "0.10"
chacha20poly1305 = { workspace = true }
rand_core = { workspace = true }
zeroize = { workspace = true }

[lib]

# The example drives the document API, which the `data` feature gates. Declared
# so that a `--no-default-features` build skips it instead of failing to
# compile a target that cannot exist in that configuration.
[[example]]
name = "replicated_notes"
required-features = ["data"]