-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
191 lines (160 loc) · 5.23 KB
/
Copy pathCargo.toml
File metadata and controls
191 lines (160 loc) · 5.23 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
[package]
name = "nsip"
version = "0.7.3"
edition = "2024"
rust-version = "1.92"
description = "NSIP Search API client for nsipsearch.nsip.org/api"
license = "MIT"
authors = ["Robert Allen <zircote@gmail.com>"]
repository = "https://github.com/zircote/nsip"
homepage = "https://github.com/zircote/nsip"
documentation = "https://docs.rs/nsip"
readme = "README.md"
keywords = ["nsip", "livestock", "api", "search"]
categories = ["api-bindings"]
# RFC 9457 error envelope configuration (read by build.rs).
#
# `error-type-uri-base` is the stable base for every error's `type` / `docs_url`
# URI. Override it (e.g. in a fork) to point the error catalog at your own docs;
# omit it to use the default below.
#
# `[package.metadata.nsip.error-slugs]` optionally remaps individual error pages.
# Each key maps to the envelope `type` slug for one error; unspecified errors
# keep their default slug. Valid keys (default slug):
# api-error (api/error) empty-lpn-id (cli/empty-lpn-id)
# api-not-found (api/not-found) invalid-breed-id (cli/invalid-breed-id)
# api-timeout (api/timeout) page-range (cli/page-range)
# api-connection (api/connection) empty-search (cli/empty-search)
# api-upstream-parse (api/upstream-parse) compare-arity (cli/compare-arity)
# validation (cli/validation) missing-argument (mcp/missing-argument)
# unknown-transport (cli/unknown-transport) unknown-resource (mcp/unknown-resource)
# invalid-cursor (mcp/invalid-cursor)
# Note: slug overrides affect the machine-readable envelope (`type`/`docs_url`);
# the human (miette) terminal link uses the default slug. See
# docs/reference/ERROR-ENVELOPE.md.
[package.metadata.nsip]
error-type-uri-base = "https://github.com/zircote/nsip/blob/main/docs/reference/errors"
# [package.metadata.nsip.error-slugs]
# api-timeout = "errors/timeout"
[lib]
name = "nsip"
path = "crates/lib.rs"
[[bin]]
name = "nsip"
path = "crates/main.rs"
[dependencies]
# Core dependencies
thiserror = "2.0.18"
# Diagnostic rendering (human-facing pretty error output; RFC 9457 JSON is hand-rolled)
miette = { version = "7.6", features = ["fancy"] }
# Async runtime
tokio = { version = "1.52", features = ["full"] }
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
schemars = "1.0"
# Regex (for parsing HTML in lineage responses)
regex = "1"
# HTTP client
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
# CLI
clap = { version = "4.6", features = ["derive"] }
clap_complete = "4.6"
clap_mangen = "0.3"
# MCP server
rmcp = { version = "2.2", features = [
"server",
"transport-io",
"transport-streamable-http-server",
"transport-streamable-http-server-session",
"elicitation",
"schemars",
] }
# HTTP transport for MCP
axum = "0.8"
tower = "0.5"
tower-http = { version = "0.7", features = ["cors"] }
# OAuth 2.1
jsonwebtoken = { version = "10", features = ["rust_crypto"] }
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
sha2 = "0.11"
subtle = "2"
base64 = "0.22"
rand = "0.10"
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
# OpenTelemetry (optional, behind `telemetry` feature)
opentelemetry = { version = "0.32", optional = true }
opentelemetry_sdk = { version = "0.32", optional = true }
tracing-opentelemetry = { version = "0.33", optional = true }
[build-dependencies]
# Parse [package.metadata.nsip] from Cargo.toml in build.rs. Build-only — does
# not affect the runtime dependency tree.
toml = "1"
[dev-dependencies]
# Testing
proptest = "1.11.0"
test-case = "3.3.1"
# Async / HTTP mocking
tokio-test = "0.4"
wiremock = "0.6"
# Concurrency primitives used only by docs examples (examples/batch_query_concurrent.rs)
futures = "0.3.32"
# CLI integration tests
assert_cmd = "2.2"
predicates = "3.1"
tempfile = "3.27.0"
[profile.dev]
# Faster compile times during development
debug = 1
opt-level = 0
[profile.release]
# Optimize for size and speed
opt-level = 3
lto = "thin"
codegen-units = 1
panic = "abort"
strip = true
[profile.release-debug]
inherits = "release"
debug = true
strip = false
[lints.rust]
# Enable additional warnings
unsafe_code = "forbid"
missing_docs = "warn"
rust_2024_compatibility = { level = "warn", priority = -1 }
[lints.clippy]
# Deny all warnings in CI
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
# Specific lints to deny
unwrap_used = "deny"
expect_used = "deny"
panic = "deny"
todo = "deny"
unimplemented = "deny"
dbg_macro = "deny"
print_stdout = "deny"
print_stderr = "deny"
# Allow in certain contexts (can be overridden per-module)
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
redundant_pub_crate = "allow"
# Allow multiple crate versions (can't control transitive deps)
multiple_crate_versions = "allow"
# Suggests Duration::from_mins (stable in 1.95) but our MSRV is 1.92
duration_suboptimal_units = "allow"
[features]
default = []
telemetry = [
"dep:opentelemetry",
"dep:opentelemetry_sdk",
"dep:tracing-opentelemetry",
]