Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
279 lines (265 loc) · 10.1 KB
/
Copy pathCargo.toml
File metadata and controls
279 lines (265 loc) · 10.1 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
[workspace]
default-members = [
"crate/server",
"crate/clients/pkcs11/provider",
"crate/clients/ckms",
]
members = [
# Common crates
"crate/kmip",
# Client crates
"crate/clients/client_utils",
"crate/clients/client",
"crate/clients/wasm",
"crate/clients/clap",
"crate/clients/ckms",
"crate/clients/k8s/plugin",
"crate/clients/k8s/operator",
"crate/clients/k8s/csi_provider",
"crate/clients/pkcs11/module",
"crate/clients/pkcs11/provider",
"crate/clients/cng",
# Server crates
"crate/access",
"crate/crypto",
"crate/hsm/base_hsm",
"crate/hsm/aws_cloudhsm",
"crate/hsm/gcp_cloud_hsm",
"crate/hsm/crypt2pay",
"crate/hsm/kryoptic",
"crate/hsm/proteccio",
"crate/hsm/smartcardhsm",
"crate/hsm/softhsm2",
"crate/hsm/utimaco",
"crate/interfaces",
"crate/server",
"crate/server_database",
# Test crates
"crate/test_kms_server",
]
# Do that if you don't want to enable `dev` feature by default due to the `dev-dependencies` of the cli.
# For more details, read: https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2
# note: resolver defaults to 2 in 2021 edition crate, but defaults to 1 in virtual workspace
resolver = "2"
[workspace.lints.rust]
# ── Core lint groups ──────────────────────────────────────────────────
nonstandard_style = "deny"
future_incompatible = "deny"
keyword_idents = "deny"
let_underscore = "deny"
unreachable_pub = "deny"
unused = "deny"
unsafe_code = "deny"
# ── Safety & security (new in 1.92–1.97) ─────────────────────────────
# All unsafe operations inside unsafe fns must be in explicit unsafe { } blocks.
unsafe-op-in-unsafe-fn = "deny"
# Unsafe attributes (e.g. unsafe(no_mangle)) must be inside unsafe { }.
unsafe-attr-outside-unsafe = "deny"
# All extern declarations must be marked `unsafe extern`.
missing-unsafe-on-extern = "deny"
# Non-binding `let _ = expr` on types with Drop (lock guards, etc.) — forces `let _guard =`.
let-underscore-drop = "deny"
# ── Edition 2024 migration hardening ─────────────────────────────────
# Items that became unsafe in edition 2024 must not be used as safe.
deprecated-safe-2024 = "deny"
# `if let` temporary lifetime rescoping in edition 2024.
if-let-rescope = "deny"
# `impl Trait` captures more lifetimes in edition 2024; flag potential changes now.
impl-trait-overcaptures = "deny"
# Emit a warning when `expr` fragment specifier semantics change in 2024.
edition-2024-expr-fragment-specifier = "deny"
# Keywords reserved in edition 2024 must not be used as identifiers.
keyword-idents-2024 = "deny"
# Tail-expression drop order changes in edition 2024.
tail-expr-drop-order = "deny"
# Prelude trait method collisions in edition 2024.
rust-2024-prelude-collisions = "deny"
# ── API correctness ───────────────────────────────────────────────────
refining_impl_trait = "deny"
[workspace.lints.clippy]
# Main clippy categories
pedantic = { level = "deny", priority = 90 }
all = { level = "deny", priority = 80 }
suspicious = { level = "deny", priority = 70 }
complexity = { level = "deny", priority = 60 }
perf = { level = "deny", priority = 50 }
style = { level = "deny", priority = 40 }
cargo = { level = "deny", priority = 30 }
nursery = { level = "deny", priority = 20 }
# Common allows (to be selectively enabled by crates as needed)
similar_names = { level = "allow", priority = 91 }
too_many_lines = { level = "allow", priority = 91 }
ref_option = { level = "allow", priority = 91 }
missing_errors_doc = { level = "allow", priority = 91 }
multiple_crate_versions = { level = "allow", priority = 31 }
redundant_pub_crate = { level = "allow", priority = 21 }
future_not_send = { level = "allow", priority = 21 }
cognitive_complexity = { level = "allow", priority = 21 }
significant_drop_tightening = { level = "allow", priority = 21 }
iter_with_drain = { level = "allow", priority = 21 }
too_long_first_doc_paragraph = { level = "allow", priority = 21 }
# Restriction lints (from server and other crates)
module_name_repetitions = "allow"
unwrap_used = "deny"
get_unwrap = "deny"
expect_used = "deny"
indexing_slicing = "deny"
missing_asserts_for_indexing = "deny"
unwrap_in_result = "deny"
assertions_on_result_states = "deny"
panic = "deny"
panic_in_result_fn = "deny"
renamed_function_params = "deny"
verbose_file_reads = "deny"
str_to_string = "deny"
implicit_clone = "deny"
unreachable = "deny"
as_conversions = "deny"
print_stdout = "deny"
empty_structs_with_brackets = "deny"
unseparated_literal_suffix = "deny"
map_err_ignore = "deny"
redundant_clone = "deny"
[workspace.package]
version = "5.28.0"
edition = "2024"
rust-version = "1.87.0"
authors = [
"Bruno Grieder <bruno.grieder@cosmian.com>",
"Emmanuel Coste <emmanuel.coste@cosmian.com>",
]
license = "BUSL-1.1" # "Business Source License 1.1"
license-file = "LICENSE"
repository = "https://github.com/Cosmian/kms"
homepage = "https://github.com/Cosmian/kms"
keywords = ["kms", "cosmian"]
categories = ["security"]
[profile.release]
# Deterministic build configuration for reproducible binaries
# These settings ensure the same source produces identical binaries across builds
lto = "fat" # Fat LTO: maximum cross-crate optimization for smallest binaries
strip = "symbols" # Strip symbol tables for smaller binaries
opt-level = "z" # Optimize for size while maintaining performance
codegen-units = 1 # Single codegen unit: best optimization and determinism
panic = "abort" # Smaller binaries, no unwinding tables
incremental = false # Disable incremental compilation for determinism
debug = 0 # No debug info (timestamps/paths)
overflow-checks = true # Catch integer overflows in release builds (ANSSI LANG-ARITH)
[profile.bench]
# Flamegraph-friendly profile: max-speed optimizations + symbol visibility.
# Overrides release for the following reasons:
# opt-level = 3 → release uses "z" (size) which costs 15–40% throughput;
# benchmarks must measure server speed, not binary size.
# strip = "none" → perf / cargo-flamegraph need symbol tables to resolve frames.
# debug = 2 → full DWARF info: enables line-level flamegraph attribution
# and DWARF-based stack unwinding by perf.
# lto = "thin" → faster link than fat-LTO; still enables cross-crate inlining.
inherits = "release"
opt-level = 3 # Speed over size — critical for throughput benchmarks
strip = "none" # MUST be none — perf needs symbol tables
debug = 2 # Full DWARF: line-level attribution + reliable unwinding
codegen-units = 1 # Keep single CGU for realistic inlining
[profile.dev]
strip = "debuginfo"
incremental = false
panic = "abort" # prevent UB from unwinding panics across extern "C" boundary
# proc-macros and build-scripts
[profile.dev.build-override]
strip = "debuginfo"
incremental = false
# external dependencies
[profile.dev.package."*"]
opt-level = 0
[workspace.dependencies]
actix-cors = "0.6"
actix-files = "0.6"
actix-http = "3.12"
actix-identity = "0.6"
actix-rt = "2.10"
actix-session = { version = "0.8" }
actix-server = { version = "2.5", default-features = false }
actix-tls = "3.4"
actix-web = { version = "4.12", default-features = false }
async-recursion = "1.1"
async-trait = "0.1"
axum = "0.8"
axum-server = "0.8"
base64 = "0.22"
bitflags = "2.9"
cc = "1.4"
chrono = "0.4"
clap = { version = "4.5", default-features = false }
clap-config-fallback = { version = "0.1", features = ["derive"] }
dashmap = "6"
criterion = { version = "0.6", default-features = false, features = [
"html_reports",
"async_tokio",
] }
cosmian_config_utils = "0.7"
cosmian_crypto_core = { version = "11.0", default-features = false, features = ["ser"] }
cosmian_logger = "0.8"
der = { version = "0.7", default-features = false }
dialoguer = { version = "0.11", default-features = false, features = ["editor", "fuzzy-select", "history", "password", "completion"] }
dotenvy = "0.15"
futures = "0.3"
hex = { version = "0.4", default-features = false }
humantime = "2"
hyper-util = "0.1"
hmac = { version = "0.12", features = ["std"] }
http = "1.4"
jsonwebtoken = { version = "10.3", features = ["rust_crypto"] }
k8s-openapi = "0.24"
kube = "0.99"
lazy_static = "1.5"
leb128 = "0.2"
libloading = "0.8"
log = { version = "0.4", default-features = false }
lru = "0.18"
moka = { version = "0.12", default-features = false, features = ["future"] }
native-tls = { version = "0.2", default-features = false }
num-format = "0.4"
itertools = "0.10"
num-bigint = { version = "0.4", default-features = false }
num-traits = "0.2"
num-bigint-dig = { version = "0.8", default-features = false }
openssl = { version = "0.10", default-features = false }
opentelemetry = "0.32"
opentelemetry-otlp = { version = "0.32", features = ["metrics", "grpc-tonic"] }
opentelemetry_sdk = { version = "0.32", features = ["metrics"] }
pem = "3.0"
prost = "0.13"
pkcs11-sys = "0.2"
rand = "0.10"
rcgen = { version = "0.13", default-features = false }
regex = { version = "1.11", default-features = false }
reqwest = { version = "0.12", default-features = false }
rustls = { version = "0.23", default-features = false }
schemars = "0.8"
scratchstack-aws-signature = "0.11"
pgp = { version = "0.21", default-features = false }
serde = "1.0"
serde_ignored = "0.1"
serde_json = "1.0"
serde_yaml = "0.9"
sha2 = { version = "0.10", default-features = false }
sha3 = { version = "0.10", default-features = false }
strum = { version = "0.27", default-features = false }
strum_macros = { version = "0.27", default-features = false }
thiserror = "2.0"
time = "0.3"
tiny-keccak = "2.0"
tempfile = "3.19"
tokio = { version = "1.44", default-features = false }
tokio-postgres = { version = "0.7.18", default-features = false }
tokio-stream = "0.1"
tonic = "0.12"
tower = "0.4"
toml = "0.9"
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false }
subtle = "2.6"
url = "2.5"
uuid = "=1.11.1"
x509-cert = { version = "0.2", default-features = false }
x509-parser = "0.17"
zeroize = { version = "1.8", default-features = false }