fix: add basic auth and oidc auth

This commit is contained in:
2024-12-31 00:52:44 +08:00
parent 4c6cc1116b
commit abd399aacd
39 changed files with 712 additions and 49 deletions

106
Cargo.lock generated
View File

@@ -299,6 +299,18 @@ 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 1.2.0",
]
[[package]]
name = "axum-core"
version = "0.4.5"
@@ -1864,6 +1876,30 @@ dependencies = [
"hashbrown 0.14.5",
]
[[package]]
name = "headers"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9"
dependencies = [
"base64 0.21.7",
"bytes",
"headers-core",
"http 1.2.0",
"httpdate",
"mime",
"sha1",
]
[[package]]
name = "headers-core"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4"
dependencies = [
"http 1.2.0",
]
[[package]]
name = "heck"
version = "0.4.1"
@@ -2528,6 +2564,33 @@ dependencies = [
"simple_asn1",
]
[[package]]
name = "jwt-authorizer"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87d72c47f96cdd849689e1a417a2b7206399b238dd8e2b1dfcea16f27185d00e"
dependencies = [
"axum",
"chrono",
"futures-core",
"futures-util",
"headers",
"http 1.2.0",
"http-body-util",
"jsonwebtoken",
"pin-project",
"reqwest",
"serde",
"serde_json",
"thiserror 1.0.69",
"tokio",
"tower-http 0.5.2",
"tower-layer",
"tower-service",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "jxl-bitstream"
version = "0.2.3"
@@ -2946,7 +3009,7 @@ dependencies = [
"tokio-util",
"toml",
"tower 0.4.13",
"tower-http",
"tower-http 0.6.2",
"tracing",
"tracing-appender",
"tracing-subscriber",
@@ -3714,6 +3777,26 @@ dependencies = [
"siphasher",
]
[[package]]
name = "pin-project"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.92",
]
[[package]]
name = "pin-project-lite"
version = "0.2.15"
@@ -4094,6 +4177,7 @@ version = "0.1.0"
dependencies = [
"async-trait",
"axum",
"axum-auth",
"bytes",
"chrono",
"eyre",
@@ -4101,6 +4185,7 @@ dependencies = [
"html-escape",
"insta",
"itertools 0.13.0",
"jwt-authorizer",
"lazy_static",
"leaky-bucket",
"lightningcss",
@@ -6091,6 +6176,25 @@ dependencies = [
"tracing",
]
[[package]]
name = "tower-http"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5"
dependencies = [
"base64 0.21.7",
"bitflags 2.6.0",
"bytes",
"http 1.2.0",
"http-body",
"http-body-util",
"mime",
"pin-project-lite",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower-http"
version = "0.6.2"