Skip to content
Closed
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
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["database"]
[features]
default = []
cloudevents = ["dep:cloudevents-sdk"]
testcontainer = ["dep:testcontainers", "dep:rand", "ed25519-dalek/rand_core"]
testcontainer = ["dep:testcontainers", "dep:rand", "dep:rand_core", "ed25519-dalek/rand_core"]

[dependencies]
chrono = { version = "0.4.42", features = ["serde"] }
Expand All @@ -41,6 +41,7 @@ sha2 = "0.10.9"
hex = "0.4.3"
ed25519-dalek = { version = "2.2.0", features = ["rand_core", "pkcs8", "pem"] }
rand = { version = "0.9", optional = true }
rand_core = { version = "0.6", features = ["getrandom"], optional = true }

[dev-dependencies]
testcontainers = { version = "0.25.2", features = ["http_wait"] }
Expand Down
5 changes: 2 additions & 3 deletions src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use ed25519_dalek::{
SigningKey, VerifyingKey,
pkcs8::{EncodePrivateKey, spki::der::pem::LineEnding},
};
use rand::prelude::ThreadRng;
use rand_core::OsRng;
use testcontainers::{
ContainerAsync, CopyDataSource, GenericImage,
core::{ContainerPort, ImageExt, WaitFor, wait::HttpWaitStrategy},
Expand Down Expand Up @@ -115,8 +115,7 @@ impl ContainerBuilder {
/// The private key will be used to sign events and the public key will be used to verify them.
#[must_use]
pub fn with_signing_key(mut self) -> Self {
let mut rng: ThreadRng = rand::thread_rng();
self.signing_key = Some(SigningKey::generate(&mut rng));
self.signing_key = Some(SigningKey::generate(&mut OsRng));
self
}

Expand Down
Loading