-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
183 lines (163 loc) · 7.43 KB
/
Copy pathCargo.toml
File metadata and controls
183 lines (163 loc) · 7.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
[workspace]
resolver = "2"
members = [
"crates/offline-protocol-core",
"crates/offline-protocol-sealed",
"crates/offline-protocol-leaf",
"crates/offline-protocol-transport",
"crates/offline-protocol-router",
"crates/offline-protocol-reliability",
"crates/offline-protocol-mls",
"crates/offline-protocol-services",
"crates/offline-protocol-data",
"crates/offline-protocol-telemetry-wire",
"crates/offline-protocol",
"crates/offline-protocol-uniffi",
"crates/offline-protocol-bench",
]
# Has its own `[workspace]` table, so cargo already keeps it out. Named here so
# the exclusion is visible from the root rather than only on opening the crate:
# it builds for bare metal only, and as a member it would make every
# `cargo build --workspace` demand a Cortex-M toolchain.
exclude = ["tools/embedded-footprint"]
[workspace.package]
# The release version, shared with the `vX.Y.Z` git tag and the npm package —
# `offline-protocol 0.20.1` on crates.io is the same release as `v0.20.1` and
# `@offline-protocol/mesh-sdk@0.20.1`. This was a decoupled internal `0.x`
# until crates.io publishing landed; two numbers for one release is a
# reasonable trade while nothing is published, and a bad one once `cargo add`
# is how people consume the SDK, because crates.io then carries a version
# nothing else in the project answers to.
#
# Bump this as part of the release cut, together with the internal-dependency
# versions below and `bindings/python/pyproject.toml`. release.yml refuses to
# publish a tag whose number does not match this one — crates.io versions are
# immutable, so discovering the mismatch afterwards means the number is wrong
# forever.
version = "0.25.0"
edition = "2021"
authors = ["Offline Protocol, Inc."]
# Dual-licensed: AGPL-3.0-only for open-source use, with a separate commercial
# license offered out-of-band (see LICENSE-COMMERCIAL.md). The SPDX field carries
# only the open-source identifier because the commercial offer is not an
# SPDX-recognized license — do not change to "AGPL-3.0-only OR LicenseRef-..."
# without confirming downstream cargo-deny configurations expect that form.
license = "AGPL-3.0-only"
repository = "https://github.com/Offline-Protocol/offline-protocol-sdk"
rust-version = "1.87"
[workspace.dependencies]
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# Compact binary wire codec (Message envelope v1).
# `default-features = false` drops postcard's default `heapless-cas` feature,
# which otherwise pulls heapless 0.7 -> atomic-polyfill (unmaintained,
# RUSTSEC-2023-0089). We only use the alloc-backed `to_allocvec`/`from_bytes`,
# so `alloc` alone is sufficient and the heapless flavor is dead weight.
#
# This opt-out is now INTENT, not effect: cargo unifies features across the
# graph, and `offline-protocol-data`'s engine pulls postcard with default
# features through `serde_columnar` (upstream fix unreleased, see
# loro-dev/columnar#48). `heapless-cas` is therefore enabled workspace-wide
# regardless. Nothing compiled on our targets changes — atomic-polyfill is
# target-conditional in heapless 0.7 and never builds for iOS, Android,
# macOS, Linux or Windows — and the advisory is waived with that reasoning
# in `deny.toml` and `.cargo/audit.toml`. Keep the flag: it is what makes the
# opt-out effective again the moment the upstream fix lands.
postcard = { version = "1.0", default-features = false, features = ["alloc"] }
# Error handling
thiserror = "2.0"
# UUID generation
uuid = { version = "1.6", features = ["v4", "serde"] }
# Time handling
chrono = { version = "0.4", features = ["serde"] }
# Async runtime
tokio = "1.35"
# Logging
tracing = "0.1"
# Benchmarking
criterion = "0.8"
# MLS (Message Layer Security)
openmls = "0.7"
openmls_rust_crypto = "0.4"
openmls_basic_credential = "0.4"
openmls_traits = "0.4"
# Encoding
base64 = "0.22"
hex = "0.4"
# Only `alloc` is needed: `std` adds `std::error::Error` impls on bech32's own
# error types, which never cross this workspace's API surface.
bech32 = { version = "0.11.1", default-features = false, features = ["alloc"] }
# NFC normalization for username claims. A discovery tag is a hash of the
# normalized name, so two implementations that normalize differently derive
# different tags and silently fail to find each other; the tables are what make
# "NFC" mean one thing everywhere.
unicode-normalization = "0.1"
# Crypto
# `ecdh` backs the NIP-44 v2 conversation key (secp256k1 ECDH, x-coordinate
# only, deliberately unhashed) used to seal Nostr gift wraps.
k256 = { version = "0.13", features = ["schnorr", "ecdh"] }
sha2 = "0.10"
hkdf = "0.12"
# NIP-44 v2 is encrypt-then-MAC over a raw ChaCha20 stream — not an AEAD — so
# it needs the bare stream cipher and HMAC rather than `chacha20poly1305`.
chacha20 = "0.9"
hmac = "0.12"
subtle = "2"
rand_core = { version = "0.6", features = ["getrandom"] }
zeroize = "1"
mls-rs = { version = "=0.56.0", default-features = false }
mls-rs-crypto-rustcrypto = { version = "=0.22.1", default-features = false }
mls-rs-core = { version = "=0.27.0", default-features = false }
getrandom = { version = "0.2", default-features = false }
# At-rest sealing for install-scoped protocol-state records.
chacha20poly1305 = "0.10"
# Internal dependencies.
#
# Each carries BOTH a `path` and a `version`. The path is what every workspace
# build resolves against; the version is what `cargo package`/`cargo publish`
# rewrites the dependency to in the generated .crate manifest. Without it,
# packaging any crate that depends on a sibling fails outright:
# "all dependencies must have a version requirement specified when packaging"
# Keep these in lockstep with `workspace.package.version` above — a crate can
# only be published once its dependencies exist on the registry at the named
# version, so all eleven move together.
offline-protocol-core = { path = "crates/offline-protocol-core", version = "0.25.0" }
offline-protocol-sealed = { path = "crates/offline-protocol-sealed", version = "0.25.0" }
offline-protocol-leaf = { path = "crates/offline-protocol-leaf", version = "0.25.0" }
offline-protocol-transport = { path = "crates/offline-protocol-transport", version = "0.25.0" }
offline-protocol-router = { path = "crates/offline-protocol-router", version = "0.25.0" }
offline-protocol-reliability = { path = "crates/offline-protocol-reliability", version = "0.25.0" }
offline-protocol-mls = { path = "crates/offline-protocol-mls", version = "0.25.0" }
offline-protocol-services = { path = "crates/offline-protocol-services", version = "0.25.0" }
offline-protocol-data = { path = "crates/offline-protocol-data", version = "0.25.0" }
offline-protocol-telemetry-wire = { path = "crates/offline-protocol-telemetry-wire", version = "0.25.0" }
offline-protocol = { path = "crates/offline-protocol", version = "0.25.0" }
[workspace.lints.clippy]
unwrap_used = "deny"
[profile.dev]
opt-level = 0
debug = true
# Dependencies are never stepped into during debugging; skipping their
# debuginfo cuts target/debug size and compile/link I/O dramatically
# (this repo's dev artifacts were ~49 GB with full dep debuginfo).
[profile.dev.package."*"]
debug = false
# Same for build scripts and proc macros (serde_derive, uniffi, tls_codec_derive).
[profile.dev.build-override]
debug = false
[profile.release]
opt-level = 3
debug = false
lto = true
codegen-units = 1
strip = true
[profile.minisize]
inherits = "release"
opt-level = "z"
lto = true
codegen-units = 1
strip = true
panic = "abort"
[profile.bench]
inherits = "release"