From 2af657a45b459d71eda0aa52308da1bdc0bf6ff4 Mon Sep 17 00:00:00 2001 From: peg Date: Wed, 5 Nov 2025 14:23:45 +0100 Subject: [PATCH 1/2] Add simple CI to run cargo test --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..93e8fc1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test + +on: [push, pull_request] + +jobs: + build_and_test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: rustfmt, clippy + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Run cargo clippy + run: cargo clippy -- -D warnings + + - name: Run cargo test + run: cargo test From adf31b4d7a57b239bcc7eb1c5e6b0d9d613fd44c Mon Sep 17 00:00:00 2001 From: peg Date: Wed, 5 Nov 2025 14:44:22 +0100 Subject: [PATCH 2/2] Clippy --- src/lib.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c16a0ff..63c0d39 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,10 +39,7 @@ impl ProxyServer { .with_single_cert(cert_chain.clone(), key) .expect("Failed to create rustls server config"); - let server = - Self::new_with_tls_config(cert_chain, server_config.into(), local, target).await; - - server + Self::new_with_tls_config(cert_chain, server_config.into(), local, target).await } /// Start with preconfigured TLS @@ -133,10 +130,7 @@ impl ProxyClient { .with_root_certificates(root_store) .with_no_client_auth(); - let client = - Self::new_with_tls_config(client_config.into(), address, server_address, server_name) - .await; - client + Self::new_with_tls_config(client_config.into(), address, server_address, server_name).await } pub async fn new_with_tls_config( @@ -151,7 +145,7 @@ impl ProxyClient { Self { connector, listener, - target: target.into(), + target, target_name, attestation_platform: MockAttestation, }