Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .cargo/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Settings for clippy, found through CLIPPY_CONF_DIR in config.toml.

# Time comes from the clock of the Ark connection, so the calls it replaces are
# banned. The first group is darkbio-clock's recommended list, crossbeam's
# entries included. The second covers crypto's functions that read the system
# time themselves, and the third chrono's reads of the wall time.
disallowed-methods = [
{ path = "std::time::Instant::now", reason = "use Clock::now" },
{ path = "std::time::Instant::elapsed", reason = "use Clock::elapsed" },
{ path = "std::time::SystemTime::now", reason = "use Clock::system_time" },
{ path = "std::time::SystemTime::elapsed", reason = "use Clock::system_time" },
{ path = "std::thread::sleep", reason = "use Clock::sleep" },
{ path = "std::thread::park_timeout", reason = "use a clock condvar" },
{ path = "std::sync::Condvar::wait_timeout", reason = "use darkbio_clock::sync::Condvar" },
{ path = "std::sync::Condvar::wait_timeout_while", reason = "use darkbio_clock::sync::Condvar" },
{ path = "std::sync::mpsc::Receiver::recv_timeout", reason = "use a crossbeam receiver with Clock::recv_timeout" },
{ path = "crossbeam_channel::after", reason = "use Clock::after" },
{ path = "crossbeam_channel::at", reason = "use Clock::at" },
{ path = "crossbeam_channel::tick", reason = "arm Clock::at per period" },
{ path = "crossbeam_channel::Receiver::recv_timeout", reason = "use Clock::recv_timeout" },
{ path = "crossbeam_channel::Receiver::recv_deadline", reason = "use Clock::recv_deadline" },
{ path = "crossbeam_channel::Sender::send_timeout", reason = "select against a clock timer" },
{ path = "crossbeam_channel::Sender::send_deadline", reason = "select against a clock timer" },
{ path = "crossbeam_channel::Select::select_timeout", reason = "select against a clock timer" },
{ path = "crossbeam_channel::Select::select_deadline", reason = "select against a clock timer" },
{ path = "crossbeam_channel::Select::ready_timeout", reason = "select against a clock timer" },
{ path = "crossbeam_channel::Select::ready_deadline", reason = "select against a clock timer" },

{ path = "darkbio_crypto::cose::sign", reason = "use cose::sign_at with the clock's wall time" },
{ path = "darkbio_crypto::cose::sign_detached", reason = "use cose::sign_detached_at with the clock's wall time" },
{ path = "darkbio_crypto::cose::verify", reason = "use cose::verify_at with the clock's wall time" },
{ path = "darkbio_crypto::cose::verify_detached", reason = "use cose::verify_detached_at with the clock's wall time" },
{ path = "darkbio_crypto::cose::seal", reason = "use cose::seal_at with the clock's wall time" },
{ path = "darkbio_crypto::cose::open", reason = "use cose::open_at with the clock's wall time" },
{ path = "darkbio_crypto::cwt::issue", reason = "use cwt::issue_at with the clock's wall time" },

{ path = "chrono::Utc::now", reason = "convert Clock::system_time" },
{ path = "chrono::Local::now", reason = "convert Clock::system_time" },
]
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Settings for every cargo command run inside this repository.

[env]
# Clippy only searches the crate directory and its parents for its settings,
# so point it at the ones kept here.
CLIPPY_CONF_DIR = { value = ".cargo", relative = true }
76 changes: 51 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ test = true
[dependencies]
chrono = { version = "0.4.41", features = ["serde"] }
clap = { version = "4.5.60", features = ["derive"] }
darkbio-crypto = { version = "0.18.2", features = ["cbor", "xdsa"] }
darkbio-trust = { version = "0.5.1", features = ["release", "staging", "develop"] }
darkbio-wire = "0.10.0"
darkbio-clock = { version = "0.3", features = ["crossbeam"] }
darkbio-crypto = { version = "0.19.1", features = ["cbor", "xdsa"] }
darkbio-trust = { version = "0.6.0", features = ["release", "staging", "develop"] }
darkbio-wire = "0.12.0"
hex = "0.4.3"
console = "0.15.11"
base64 = "0.23.1"
Expand All @@ -56,6 +57,9 @@ windows-sys = { version = "0.61", features = ["Win32_System_Console", "Win32_Sys
[target.'cfg(unix)'.dependencies]
signal-hook = "0.3"

[dev-dependencies]
darkbio-clock = { version = "0.3", features = ["crossbeam", "test-clock"] }

# Firmware uploads push megabytes through the crypto, which crawls unoptimized,
# so dependencies build optimized under the dev profile too. The CLI and its
# connection library stay unoptimized for debugging.
Expand Down
Loading
Loading