feat: replace axum-auth with tower_http
All checks were successful
/ build (push) Successful in 3s
/ check (push) Successful in 7s

Slightly more involde in the auth code, but it makes the rest of the
application more straight forward.

Fixes #10
This commit is contained in:
Jalil David Salamé Messina 2024-11-23 20:36:38 +01:00
parent 60aed649b1
commit 750cbbff93
Signed by: jalil
GPG key ID: F016B9E770737A0B
5 changed files with 166 additions and 75 deletions

37
Cargo.lock generated
View file

@ -120,18 +120,6 @@ dependencies = [
"tracing",
]
[[package]]
name = "axum-auth"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8169113a185f54f68614fcfc3581df585d30bf8542bcb99496990e1025e4120a"
dependencies = [
"async-trait",
"axum-core",
"base64 0.21.7",
"http",
]
[[package]]
name = "axum-client-ip"
version = "0.6.1"
@ -188,12 +176,6 @@ dependencies = [
"backtrace",
]
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "base64"
version = "0.22.1"
@ -1044,6 +1026,21 @@ dependencies = [
"tracing",
]
[[package]]
name = "tower-http"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697"
dependencies = [
"bitflags",
"bytes",
"http",
"mime",
"pin-project-lite",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-layer"
version = "0.3.3"
@ -1165,9 +1162,8 @@ name = "webnsupdate"
version = "0.3.2-dev"
dependencies = [
"axum",
"axum-auth",
"axum-client-ip",
"base64 0.22.1",
"base64",
"clap",
"clap-verbosity-flag",
"http",
@ -1175,6 +1171,7 @@ dependencies = [
"miette",
"ring",
"tokio",
"tower-http",
"tracing",
"tracing-subscriber",
]