Add tower-sessions crate

This commit is contained in:
Ethan Girouard 2024-03-01 15:15:48 -05:00
parent e1e3fe52d4
commit d50afbf6e7
Signed by: eta357
GPG Key ID: 7BCDC36DFD11C146
2 changed files with 145 additions and 23 deletions

167
Cargo.lock generated
View File

@ -53,7 +53,7 @@ dependencies = [
"actix-service", "actix-service",
"actix-utils", "actix-utils",
"ahash 0.8.6", "ahash 0.8.6",
"base64 0.21.5", "base64 0.21.7",
"bitflags 2.4.1", "bitflags 2.4.1",
"brotli", "brotli",
"bytes", "bytes",
@ -63,7 +63,7 @@ dependencies = [
"flate2", "flate2",
"futures-core", "futures-core",
"h2", "h2",
"http", "http 0.2.11",
"httparse", "httparse",
"httpdate", "httpdate",
"itoa", "itoa",
@ -114,7 +114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511"
dependencies = [ dependencies = [
"bytestring", "bytestring",
"http", "http 0.2.11",
"regex", "regex",
"serde", "serde",
"tracing", "tracing",
@ -205,7 +205,7 @@ dependencies = [
"bytes", "bytes",
"bytestring", "bytestring",
"cfg-if", "cfg-if",
"cookie", "cookie 0.16.2",
"derive_more", "derive_more",
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
@ -423,13 +423,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum-core", "axum-core 0.3.4",
"axum-macros", "axum-macros",
"bitflags 1.3.2", "bitflags 1.3.2",
"bytes", "bytes",
"futures-util", "futures-util",
"http", "http 0.2.11",
"http-body", "http-body 0.4.6",
"hyper", "hyper",
"itoa", "itoa",
"matchit", "matchit",
@ -458,14 +458,34 @@ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
"futures-util", "futures-util",
"http", "http 0.2.11",
"http-body", "http-body 0.4.6",
"mime", "mime",
"rustversion", "rustversion",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
] ]
[[package]]
name = "axum-core"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "axum-macros" name = "axum-macros"
version = "0.3.8" version = "0.3.8"
@ -501,9 +521,9 @@ checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.21.5" version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]] [[package]]
name = "base64ct" name = "base64ct"
@ -803,6 +823,17 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "cookie"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8"
dependencies = [
"percent-encoding",
"time",
"version_check",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.4" version = "0.9.4"
@ -1235,7 +1266,7 @@ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
"futures-util", "futures-util",
"http", "http 0.2.11",
"indexmap", "indexmap",
"slab", "slab",
"tokio", "tokio",
@ -1324,6 +1355,17 @@ dependencies = [
"itoa", "itoa",
] ]
[[package]]
name = "http"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]] [[package]]
name = "http-body" name = "http-body"
version = "0.4.6" version = "0.4.6"
@ -1331,7 +1373,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
dependencies = [ dependencies = [
"bytes", "bytes",
"http", "http 0.2.11",
"pin-project-lite",
]
[[package]]
name = "http-body"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
dependencies = [
"bytes",
"http 1.0.0",
]
[[package]]
name = "http-body-util"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840"
dependencies = [
"bytes",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"pin-project-lite", "pin-project-lite",
] ]
@ -1370,8 +1435,8 @@ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2",
"http", "http 0.2.11",
"http-body", "http-body 0.4.6",
"httparse", "httparse",
"httpdate", "httpdate",
"itoa", "itoa",
@ -1613,7 +1678,7 @@ dependencies = [
"axum", "axum",
"cfg-if", "cfg-if",
"futures", "futures",
"http", "http 0.2.11",
"hyper", "hyper",
"leptos", "leptos",
"leptos_integration_utils", "leptos_integration_utils",
@ -1756,7 +1821,7 @@ version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22207568e096ac153ba8da68635e3136c1ec614ea9012736fa861c05bfb2eeff" checksum = "22207568e096ac153ba8da68635e3136c1ec614ea9012736fa861c05bfb2eeff"
dependencies = [ dependencies = [
"base64 0.21.5", "base64 0.21.7",
"cfg-if", "cfg-if",
"futures", "futures",
"indexmap", "indexmap",
@ -1846,7 +1911,7 @@ dependencies = [
"diesel_migrations", "diesel_migrations",
"dotenv", "dotenv",
"futures", "futures",
"http", "http 0.2.11",
"lazy_static", "lazy_static",
"leptos", "leptos",
"leptos_actix", "leptos_actix",
@ -1862,6 +1927,7 @@ dependencies = [
"tokio", "tokio",
"tower", "tower",
"tower-http", "tower-http",
"tower-sessions",
"wasm-bindgen", "wasm-bindgen",
] ]
@ -1900,6 +1966,7 @@ checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"scopeguard", "scopeguard",
"serde",
] ]
[[package]] [[package]]
@ -2482,14 +2549,14 @@ version = "0.11.23"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
dependencies = [ dependencies = [
"base64 0.21.5", "base64 0.21.7",
"bytes", "bytes",
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2",
"http", "http 0.2.11",
"http-body", "http-body 0.4.6",
"hyper", "hyper",
"ipnet", "ipnet",
"js-sys", "js-sys",
@ -3105,6 +3172,23 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "tower-cookies"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fd0118512cf0b3768f7fcccf0bef1ae41d68f2b45edc1e77432b36c97c56c6d"
dependencies = [
"async-trait",
"axum-core 0.4.3",
"cookie 0.18.0",
"futures-util",
"http 1.0.0",
"parking_lot",
"pin-project-lite",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "tower-http" name = "tower-http"
version = "0.4.4" version = "0.4.4"
@ -3115,8 +3199,8 @@ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
"futures-util", "futures-util",
"http", "http 0.2.11",
"http-body", "http-body 0.4.6",
"http-range-header", "http-range-header",
"httpdate", "httpdate",
"mime", "mime",
@ -3142,6 +3226,43 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
[[package]]
name = "tower-sessions"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5dfd131ee564762468250d3dbb8a04f3bc933bcc9bd4f0958ce8acbfb578b73"
dependencies = [
"async-trait",
"http 1.0.0",
"time",
"tokio",
"tower-cookies",
"tower-layer",
"tower-service",
"tower-sessions-core",
"tracing",
]
[[package]]
name = "tower-sessions-core"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bed2607e4db384eed7a932a53c10f64202e73e9a970b6a7410bcbc018fd7c689"
dependencies = [
"async-trait",
"base64 0.21.7",
"futures",
"http 1.0.0",
"parking_lot",
"rand",
"serde",
"serde_json",
"thiserror",
"time",
"tokio",
"tracing",
]
[[package]] [[package]]
name = "tracing" name = "tracing"
version = "0.1.40" version = "0.1.40"

View File

@ -46,6 +46,7 @@ axum = { version = "0.6.4", optional = true }
tower = { veresion = "0.4.13", optional = true } tower = { veresion = "0.4.13", optional = true }
tower-http = { version = "0.4", optional = true, features = ["fs"] } tower-http = { version = "0.4", optional = true, features = ["fs"] }
thiserror = "1.0.57" thiserror = "1.0.57"
tower-sessions = { version = "0.10.4", default-features = false }
[features] [features]
csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"] csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"]