diff --git a/Cargo.lock b/Cargo.lock index 3a4bc65..9f67544 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,9 +145,9 @@ dependencies = [ [[package]] name = "actix-session" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9138a66462f1e65da829f9c0de81b44a96dfe193a4f19bfea32ee2be312368" +checksum = "43da8b818ae1f11049a4d218975345fe8e56ce5a5f92c11f972abcff5ff80e87" dependencies = [ "actix-service", "actix-utils", @@ -159,7 +159,6 @@ dependencies = [ "redis", "serde", "serde_json", - "time", "tracing", ] @@ -244,9 +243,9 @@ dependencies = [ [[package]] name = "actix-web-lab" -version = "0.16.9" +version = "0.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e25a9040595caff3abdf449185bcb846bd5da0001d916212bf370e9f146009" +checksum = "55b7ac6309cfb46949171c49f7bc81d021310205a39bf0b0d0465e80a4857e3c" dependencies = [ "actix-files", "actix-http", @@ -255,37 +254,37 @@ dependencies = [ "actix-utils", "actix-web", "actix-web-lab-derive", - "ahash 0.7.6", + "ahash 0.8.3", "arc-swap", "async-trait", "bytes", "bytestring", "csv", "derive_more", - "digest", "futures-core", "futures-util", - "generic-array", - "hmac", "http", + "impl-more", + "itertools", "local-channel", + "mediatype", "mime", "once_cell", "pin-project-lite", "regex", "serde", + "serde_cbor_2", "serde_html_form", "serde_json", - "subtle", "tokio", "tracing", ] [[package]] name = "actix-web-lab-derive" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44a15d9ddb31a4f41decd22f743a154e519fb326120e8133ef9ea6283335ad2" +checksum = "e4419acd7924ac473ccd00a6efea324dd382b0b7ae31b8e06cd2c58d4d7afae6" dependencies = [ "proc-macro2", "quote", @@ -1200,6 +1199,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + [[package]] name = "hashbrown" version = "0.12.3" @@ -1403,6 +1408,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "impl-more" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14c422088773284a62e155b3e2f700a52cd3731dabe2cffd914e13f71b6bd4e" + [[package]] name = "indexmap" version = "1.9.2" @@ -1511,9 +1522,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linkify" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d9967eb7d0bc31c39c6f52e8fce42991c0cd1f7a2078326f0b7a399a584c8d" +checksum = "96dd5884008358112bc66093362197c7248ece00d46624e2cf71e50029f8cff5" dependencies = [ "memchr", ] @@ -1579,6 +1590,12 @@ dependencies = [ "digest", ] +[[package]] +name = "mediatype" +version = "0.19.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea6e62614ab2fc0faa58bb15102a0382d368f896a9fa4776592589ab55c4de7" + [[package]] name = "memchr" version = "2.5.0" @@ -2282,15 +2299,25 @@ dependencies = [ [[package]] name = "serde-aux" -version = "3.1.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a77223b653fa95f3f9864f3eb25b93e4ed170687eb42d85b6b98af21d5e1de" +checksum = "c599b3fd89a75e0c18d6d2be693ddb12cccaf771db4ff9e39097104808a014c0" dependencies = [ "chrono", "serde", "serde_json", ] +[[package]] +name = "serde_cbor_2" +version = "0.12.0-dev" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46d75f449e01f1eddbe9b00f432d616fbbd899b809c837d0fbc380496a0dd55" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.152" @@ -2749,9 +2776,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d725b8fa6ef307b3f4856913523337de45c47cc79271bafd7acfb39559e3a2da" +checksum = "4082e4d81173e0b7ad3cfb71e9eaef0dd0cbb7b139fdb56394f488a3b0760b23" dependencies = [ "actix-web", "pin-project", @@ -2927,9 +2954,9 @@ dependencies = [ [[package]] name = "validator" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07b0a1390e01c0fc35ebb26b28ced33c9a3808f7f9fbe94d3cc01e233bfeed5" +checksum = "32ad5bf234c7d3ad1042e5252b7eddb2c4669ee23f32c7dd0e9b7705f07ef591" dependencies = [ "idna 0.2.3", "lazy_static", @@ -3253,7 +3280,7 @@ dependencies = [ "actix-web-lab", "anyhow", "argon2", - "base64 0.13.1", + "base64 0.21.0", "chrono", "claims", "config", diff --git a/Cargo.toml b/Cargo.toml index d3bfce8..185aac7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,19 +27,19 @@ tracing-subscriber = { version = "0.3", features = ["registry", "env-filter"] } tracing-bunyan-formatter = "0.3" tracing-log = "0.1.1" thiserror = "1.0.24" -serde-aux = "3" +serde-aux = "4" unicode-segmentation = "1.7.1" rand = { version = "0.8", features=["std_rng"] } anyhow = "1.0.40" -base64 = "0.13.0" +base64 = "0.21.0" argon2 = { version = "0.4", features = ["std"] } -validator = "0.15.0" -tracing-actix-web = "0.6" +validator = "0.16" +tracing-actix-web = "0.7" secrecy = { version = "0.8", features = ["serde"] } actix-web-flash-messages = { version = "0.4", features = ["cookies"] } -actix-session = { version = "0.6", features = ["redis-rs-tls-session"] } +actix-session = { version = "0.7", features = ["redis-rs-tls-session"] } serde_json = "1" -actix-web-lab = "0.16" +actix-web-lab = "0.18" [dev-dependencies] once_cell = "1.7.2" @@ -49,5 +49,5 @@ quickcheck_macros = "0.9.1" fake = "~2.3.0" wiremock = "0.5" serde_json = "1.0.61" -linkify = "0.8.0" -serde_urlencoded = "0.7.1" \ No newline at end of file +serde_urlencoded = "0.7.1" +linkify = "0.9" \ No newline at end of file diff --git a/scripts/init_redis.sh b/scripts/init_redis.sh index 972ced5..44d97b4 100755 --- a/scripts/init_redis.sh +++ b/scripts/init_redis.sh @@ -15,6 +15,6 @@ docker run \ -p "6379:6379" \ -d \ --name "redis_$(date '+%s')" \ - redis:6 + redis:7 >&2 echo "Redis is ready to go!" \ No newline at end of file diff --git a/src/configuration.rs b/src/configuration.rs index ff9144e..c9496e7 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -102,7 +102,7 @@ pub fn get_configuration() -> Result { configuration_directory.join("base.yaml"), )) .add_source(config::File::from( - configuration_directory.join(&environment_filename), + configuration_directory.join(environment_filename), )) // Add in settings from environment variables (with a prefix of APP and '__' as separator) // E.g. `APP_APPLICATION__PORT=5001 would set `Settings.application.port` diff --git a/src/session_state.rs b/src/session_state.rs index 2923f23..5619290 100644 --- a/src/session_state.rs +++ b/src/session_state.rs @@ -1,4 +1,4 @@ -use actix_session::Session; +use actix_session::{Session, SessionGetError, SessionInsertError}; use actix_session::SessionExt; use actix_web::dev::Payload; use actix_web::{FromRequest, HttpRequest}; @@ -14,11 +14,11 @@ impl TypedSession { self.0.renew(); } - pub fn insert_user_id(&self, user_id: Uuid) -> Result<(), serde_json::Error> { + pub fn insert_user_id(&self, user_id: Uuid) -> Result<(), SessionInsertError> { self.0.insert(Self::USER_ID_KEY, user_id) } - pub fn get_user_id(&self) -> Result, serde_json::Error> { + pub fn get_user_id(&self) -> Result, SessionGetError> { self.0.get(Self::USER_ID_KEY) } diff --git a/src/startup.rs b/src/startup.rs index dfb07c7..5b89849 100644 --- a/src/startup.rs +++ b/src/startup.rs @@ -34,7 +34,7 @@ impl Application { "{}:{}", configuration.application.host, configuration.application.port ); - let listener = TcpListener::bind(&address)?; + let listener = TcpListener::bind(address)?; let port = listener.local_addr().unwrap().port(); let server = run( listener,