Skip to content

Commit

Permalink
feat: Disable signature verification when not needed (#242)
Browse files Browse the repository at this point in the history
`ring` is failing to compile for wasm targets.
Only the signature verification requires `ring` and is only useful
when either `hyper` or `axum` features are enabled.
This add a `signature-verifier` feature which enable the optional
dependency `ring`.
The feature `hyper` enables the feature `signature-verifier`.
  • Loading branch information
dax authored Feb 28, 2024
1 parent 750ac1b commit 4bd1bfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ path = "src/lib.rs"

[features]
default = []
hyper = ["dep:tokio", "dep:http-body-util", "dep:hyper", "dep:hyper-rustls", "dep:hyper-util", "dep:tokio-stream","dep:tokio-tungstenite", "dep:signal-hook", "dep:signal-hook-tokio"]
signature-verifier = ["dep:ring"]
hyper = ["dep:tokio", "dep:http-body-util", "dep:hyper", "dep:hyper-rustls", "dep:hyper-util", "dep:tokio-stream","dep:tokio-tungstenite", "dep:signal-hook", "dep:signal-hook-tokio", "signature-verifier"]
axum = ["hyper", "dep:axum", "dep:tower"]

[dependencies]
Expand All @@ -37,7 +38,7 @@ futures-locks = "0.7"
base64 = "0.21"
hex = "0.4"
tracing = "0.1"
ring = "0.17"
ring = { version = "0.17", optional = true }
lazy_static = "1.4"
http = "1.0"
async-trait = "0.1"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ pub mod errors;
pub mod listener;
mod ratectl;
mod scroller;
#[cfg(feature = "signature-verifier")]
pub mod signature_verifier;
pub mod socket_mode;

Expand Down

0 comments on commit 4bd1bfc

Please sign in to comment.