style: fix cargo fmt compliance for mtls.rs closure and packages matches!
Some checks failed
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Failing after 3s
CI/CD Pipeline / Unit Tests (push) Failing after 2s
CI/CD Pipeline / Build Debian Package (push) Has been skipped
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Has been skipped
CI/CD Pipeline / Build RPM Package (push) Has been skipped
CI/CD Pipeline / Build Alpine Package (push) Has been skipped
CI/CD Pipeline / Build Arch Package (push) Has been skipped
CI/CD Pipeline / Security Audit (push) Failing after 2s
Some checks failed
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Failing after 3s
CI/CD Pipeline / Unit Tests (push) Failing after 2s
CI/CD Pipeline / Build Debian Package (push) Has been skipped
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Has been skipped
CI/CD Pipeline / Build RPM Package (push) Has been skipped
CI/CD Pipeline / Build Alpine Package (push) Has been skipped
CI/CD Pipeline / Build Arch Package (push) Has been skipped
CI/CD Pipeline / Security Audit (push) Failing after 2s
This commit is contained in:
@ -81,7 +81,9 @@ impl MtlsMiddleware {
|
||||
|
||||
let config = ServerConfig::builder()
|
||||
.with_protocol_versions(&[&TLS13])
|
||||
.map_err(|e| MtlsError::ServerConfigError(format!("Failed to set TLS 1.3 only: {}", e)))?
|
||||
.map_err(|e| {
|
||||
MtlsError::ServerConfigError(format!("Failed to set TLS 1.3 only: {}", e))
|
||||
})?
|
||||
.with_client_cert_verifier(client_verifier)
|
||||
.with_single_cert(server_cert, server_key)
|
||||
.map_err(|e| MtlsError::ServerConfigError(e.to_string()))?;
|
||||
|
||||
@ -100,7 +100,10 @@ impl AptBackend {
|
||||
fn run_apt(&self, args: &[&str]) -> Result<String> {
|
||||
// Use sudo for operations that modify packages (install, upgrade, remove, purge)
|
||||
let needs_sudo = args.first().map_or(false, |&cmd| {
|
||||
matches!(cmd, "install" | "upgrade" | "remove" | "purge" | "dist-upgrade" | "autoremove")
|
||||
matches!(
|
||||
cmd,
|
||||
"install" | "upgrade" | "remove" | "purge" | "dist-upgrade" | "autoremove"
|
||||
)
|
||||
});
|
||||
let (program, cmd_args): (&str, Vec<&str>) = if needs_sudo {
|
||||
("sudo", ["apt"].iter().chain(args.iter()).copied().collect())
|
||||
|
||||
Reference in New Issue
Block a user