diff --git a/.circleci/config.yml b/.circleci/config.yml index cb74a24c..1c10173a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -225,7 +225,7 @@ commands: jobs: checks: docker: - - image: cimg/rust:1.81.0 # RUST_VER + - image: cimg/rust:1.86 # RUST_VER auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -242,7 +242,7 @@ jobs: build-and-test: docker: - - image: cimg/rust:1.81.0 # RUST_VER + - image: cimg/rust:1.86 # RUST_VER auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -296,7 +296,7 @@ jobs: #- save-sccache-cache build-mysql-image: docker: - - image: cimg/rust:1.81.0 # RUST_VER + - image: cimg/rust:1.86 # RUST_VER auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -331,7 +331,7 @@ jobs: build-spanner-image: docker: - - image: cimg/rust:1.81.0 # RUST_VER + - image: cimg/rust:1.86 # RUST_VER auth: username: $DOCKER_USER password: $DOCKER_PASS diff --git a/Cargo.toml b/Cargo.toml index 8828e398..9c35a06f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ authors = [ "Mozilla Services Engineering ", ] edition = "2021" +rust-version = "1.86" license = "MPL-2.0" [workspace.dependencies] diff --git a/Dockerfile b/Dockerfile index 76eca682..e205ca1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ ARG DATABASE_BACKEND=spanner ARG MYSQLCLIENT_PKG=libmariadb-dev-compat # NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml -FROM docker.io/lukemathwalker/cargo-chef:0.1.67-rust-1.81-bullseye AS chef +# RUST_VER +FROM docker.io/lukemathwalker/cargo-chef:0.1.71-rust-1.86-bullseye AS chef WORKDIR /app FROM chef AS planner diff --git a/requirements.txt b/requirements.txt index 578b97fd..4a338a02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ cryptography==44.0.2 -pyfxa==0.7.7 +pyfxa==0.8.1 tokenlib==2.0.0 diff --git a/syncserver-common/src/lib.rs b/syncserver-common/src/lib.rs index b6ed89b7..5c67b0d4 100644 --- a/syncserver-common/src/lib.rs +++ b/syncserver-common/src/lib.rs @@ -69,7 +69,6 @@ pub trait ReportableError: std::fmt::Display + std::fmt::Debug { /// [ReportableError] if it implements the trait. Otherwise callers of this /// method will likely subsequently call [Error::source] to return the /// source (if any) as the parent [Error] trait. - fn reportable_source(&self) -> Option<&(dyn ReportableError + 'static)> { None } diff --git a/syncserver/src/tokenserver/extractors.rs b/syncserver/src/tokenserver/extractors.rs index f41f6793..d02875be 100644 --- a/syncserver/src/tokenserver/extractors.rs +++ b/syncserver/src/tokenserver/extractors.rs @@ -60,7 +60,7 @@ impl TokenserverRequest { /// `keys_changed_at` <= `generation` at all times. /// /// * `client_state` is a key fingerprint and should never change back - /// to a previously-seen value. + /// to a previously-seen value. /// /// Callers who provide identity claims that violate any of these rules /// either have stale credetials (in which case they should re-authenticate) diff --git a/syncserver/src/tokenserver/mod.rs b/syncserver/src/tokenserver/mod.rs index 9de40b03..11fdcde7 100644 --- a/syncserver/src/tokenserver/mod.rs +++ b/syncserver/src/tokenserver/mod.rs @@ -182,7 +182,7 @@ impl fmt::Display for LogItems { struct LogItemsMutator<'a>(&'a HttpRequest); -impl<'a> LogItemsMutator<'a> { +impl LogItemsMutator<'_> { pub fn insert(&mut self, k: String, v: String) { let mut exts = self.0.extensions_mut(); diff --git a/syncserver/src/web/extractors.rs b/syncserver/src/web/extractors.rs index f53f34e5..686ffe3e 100644 --- a/syncserver/src/web/extractors.rs +++ b/syncserver/src/web/extractors.rs @@ -1557,7 +1557,7 @@ impl FromRequest for PreConditionHeaderOpt { /// Extract and validate the precondition headers fn from_request(req: &HttpRequest, _payload: &mut Payload) -> Self::Future { let req = req.clone(); - Box::pin(async move { Self::extrude(req.headers()).map_err(Into::into) }) + Box::pin(async move { Self::extrude(req.headers()) }) } } diff --git a/syncserver/src/web/handlers.rs b/syncserver/src/web/handlers.rs index c1827ed8..1128bda7 100644 --- a/syncserver/src/web/handlers.rs +++ b/syncserver/src/web/handlers.rs @@ -185,7 +185,6 @@ pub async fn delete_collection( Ok(resp.json(timestamp)) }) .await - .map_err(Into::into) } pub async fn get_collection( diff --git a/syncserver/src/web/middleware/rejectua.rs b/syncserver/src/web/middleware/rejectua.rs index b71a56f9..79f7f17b 100644 --- a/syncserver/src/web/middleware/rejectua.rs +++ b/syncserver/src/web/middleware/rejectua.rs @@ -37,7 +37,7 @@ pub fn reject_user_agent( + 'static), ) -> LocalBoxFuture<'static, Result>, actix_web::Error>> { match request.headers().get(USER_AGENT).cloned() { - Some(header) if header.to_str().map_or(false, should_reject) => Box::pin(async move { + Some(header) if header.to_str().is_ok_and(should_reject) => Box::pin(async move { trace!("Rejecting User-Agent: {:?}", header); let (req, payload) = request.into_parts(); MetricsWrapper::extract(&req) diff --git a/syncstorage-db-common/src/lib.rs b/syncstorage-db-common/src/lib.rs index 06077b2d..557ccdc0 100644 --- a/syncstorage-db-common/src/lib.rs +++ b/syncstorage-db-common/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(non_local_definitions)] pub mod error; pub mod params; pub mod results; @@ -229,7 +230,7 @@ pub trait Db: Debug { ) } - /// Internal methods used by the db tests + // Internal methods used by the db tests fn get_collection_id(&self, name: String) -> DbFuture<'_, i32, Self::Error>; diff --git a/syncstorage-mysql/src/lib.rs b/syncstorage-mysql/src/lib.rs index 4a933900..ea1541b5 100644 --- a/syncstorage-mysql/src/lib.rs +++ b/syncstorage-mysql/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(non_local_definitions)] #[macro_use] extern crate diesel; #[macro_use] diff --git a/syncstorage-spanner/src/models.rs b/syncstorage-spanner/src/models.rs index f270962b..967e777f 100644 --- a/syncstorage-spanner/src/models.rs +++ b/syncstorage-spanner/src/models.rs @@ -776,7 +776,6 @@ impl SpannerDb { } else { sync_timestamp_from_rfc3339(row[0].get_string_value()) } - .map_err(Into::into) } async fn get_storage_usage_async( @@ -1502,7 +1501,6 @@ impl SpannerDb { } else { SyncTimestamp::from_i64(0).map_err(|e| DbError::integrity(e.to_string())) } - .map_err(Into::into) } async fn put_bso_async(&self, params: params::PutBso) -> DbResult { diff --git a/syncstorage-spanner/src/pool.rs b/syncstorage-spanner/src/pool.rs index a62de811..c5704449 100644 --- a/syncstorage-spanner/src/pool.rs +++ b/syncstorage-spanner/src/pool.rs @@ -124,11 +124,10 @@ impl DbPool for SpannerDbPool { self.get_async() .await .map(|db| Box::new(db) as Box>) - .map_err(Into::into) } fn validate_batch_id(&self, id: String) -> DbResult<()> { - super::batch::validate_batch_id(&id).map_err(Into::into) + super::batch::validate_batch_id(&id) } fn box_clone(&self) -> Box> { diff --git a/tokenserver-db/src/lib.rs b/tokenserver-db/src/lib.rs index 34447c3d..86fa5c57 100644 --- a/tokenserver-db/src/lib.rs +++ b/tokenserver-db/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(non_local_definitions)] extern crate diesel; #[macro_use] extern crate diesel_migrations; diff --git a/tools/integration_tests/requirements.txt b/tools/integration_tests/requirements.txt index ed1e2eeb..a2646382 100644 --- a/tools/integration_tests/requirements.txt +++ b/tools/integration_tests/requirements.txt @@ -6,11 +6,11 @@ psutil pyjwt pyramid pyramid_hawkauth -pyfxa +pyfxa==0.8.1 pytest requests simplejson -sqlalchemy +sqlalchemy==1.4.46 tokenlib webtest wsgiproxy2 diff --git a/tools/integration_tests/tokenserver/test_e2e.py b/tools/integration_tests/tokenserver/test_e2e.py index 379ee77a..3c6b1638 100644 --- a/tools/integration_tests/tokenserver/test_e2e.py +++ b/tools/integration_tests/tokenserver/test_e2e.py @@ -33,8 +33,6 @@ PASSWORD_LENGTH = 32 SCOPE = 'https://identity.mozilla.com/apps/oldsync' -@unittest.skip("Pending PyFxA oauth fix: " - "https://github.com/mozilla/PyFxA/issues/101") class TestE2e(TestCase, unittest.TestCase): def setUp(self):