Skip to content

Commit

Permalink
Unit tests for serving source
Browse files Browse the repository at this point in the history
Signed-off-by: Sreekanth <[email protected]>
  • Loading branch information
BulkBeing committed Jan 3, 2025
1 parent 57c4cb7 commit e893964
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 11 deletions.
155 changes: 146 additions & 9 deletions rust/Cargo.lock

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

2 changes: 2 additions & 0 deletions rust/serving/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ backoff.workspace = true
axum.workspace = true
axum-server.workspace = true
bytes.workspace = true
rustls.workspace = true
axum-macros = "0.4.1"
hyper-util = { version = "0.1.6", features = ["client-legacy"] }
serde = { version = "1.0.204", features = ["derive"] }
Expand All @@ -35,4 +36,5 @@ prometheus-client = "0.22.3"
thiserror = "1.0.63"

[dev-dependencies]
reqwest = {version= "0.12.12", features = ["json"]}
rustls.workspace = true
3 changes: 3 additions & 0 deletions rust/serving/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ pub(crate) async fn serve<T>(
where
T: Clone + Send + Sync + Store + 'static,
{
rustls::crypto::aws_lc_rs::default_provider()
.install_default()
.expect("Failed to set crypto provider");
let (cert, key) = generate_certs()?;

let tls_config = RustlsConfig::from_pem(cert.pem().into(), key.serialize_pem().into())
Expand Down
Loading

0 comments on commit e893964

Please sign in to comment.