From 70f101f9d437828b12dba7a0a03389a87d6a0c4e Mon Sep 17 00:00:00 2001 From: JR Conlin Date: Wed, 4 Dec 2024 13:53:56 -0800 Subject: [PATCH] Chore/2410 update (#1618) * chore: Update pyo3 Closes: #1617 --------- Co-authored-by: Philip Jenvey --- Cargo.lock | 26 +++++++++++++------------- syncstorage-db-common/src/util.rs | 2 +- syncstorage-spanner/src/models.rs | 6 +----- tokenserver-auth/Cargo.toml | 2 +- tokenserver-auth/src/oauth/py.rs | 5 ++--- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ef24c86a0..cdad93c599 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1241,9 +1241,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -2045,15 +2045,15 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "pyo3" -version = "0.21.2" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +checksum = "3d922163ba1f79c04bc49073ba7b32fd5a8d3b76a87c955921234b8e77333c51" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", - "parking_lot", + "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -2063,9 +2063,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.2" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +checksum = "bc38c5feeb496c8321091edf3d63e9a6829eab4b863b4a6a65f26f3e9cc6b179" dependencies = [ "once_cell", "target-lexicon", @@ -2073,9 +2073,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.2" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +checksum = "94845622d88ae274d2729fcefc850e63d7a3ddff5e3ce11bd88486db9f1d357d" dependencies = [ "libc", "pyo3-build-config", @@ -2083,9 +2083,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.2" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +checksum = "e655aad15e09b94ffdb3ce3d217acf652e26bbc37697ef012f5e5e348c716e5e" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -2095,9 +2095,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.21.2" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +checksum = "ae1e3f09eecd94618f60a455a23def79f79eba4dc561a97324bf9ac8c6df30ce" dependencies = [ "heck", "proc-macro2", diff --git a/syncstorage-db-common/src/util.rs b/syncstorage-db-common/src/util.rs index 97350eee6e..4e2858a634 100644 --- a/syncstorage-db-common/src/util.rs +++ b/syncstorage-db-common/src/util.rs @@ -1,4 +1,4 @@ -use std::{convert::TryInto, u64}; +use std::convert::TryInto; use chrono::{ offset::{FixedOffset, TimeZone, Utc}, diff --git a/syncstorage-spanner/src/models.rs b/syncstorage-spanner/src/models.rs index 8e6a636f8c..f270962b38 100644 --- a/syncstorage-spanner/src/models.rs +++ b/syncstorage-spanner/src/models.rs @@ -1292,11 +1292,7 @@ impl SpannerDb { // most databases) so we specify a max value with offset subtracted // to avoid overflow errors (that only occur w/ a FORCE_INDEX= // directive) OutOfRange: 400 int64 overflow: + offset - query = format!( - "{} LIMIT {}", - query, - i64::max_value() - offset.offset as i64 - ); + query = format!("{} LIMIT {}", query, i64::MAX - offset.offset as i64); }; if let Some(offset) = params.offset { diff --git a/tokenserver-auth/Cargo.toml b/tokenserver-auth/Cargo.toml index 5ee8f95e7b..7dacffafcc 100644 --- a/tokenserver-auth/Cargo.toml +++ b/tokenserver-auth/Cargo.toml @@ -28,7 +28,7 @@ syncserver-common = { path = "../syncserver-common" } tokenserver-common = { path = "../tokenserver-common" } tokenserver-settings = { path = "../tokenserver-settings" } tokio = { workspace = true } -pyo3 = { version = "0.21", features = ["auto-initialize"], optional = true } +pyo3 = { version = "0.22", features = ["auto-initialize"], optional = true } [dev-dependencies] diff --git a/tokenserver-auth/src/oauth/py.rs b/tokenserver-auth/src/oauth/py.rs index d6f0c45b12..3569b3f777 100644 --- a/tokenserver-auth/src/oauth/py.rs +++ b/tokenserver-auth/src/oauth/py.rs @@ -19,9 +19,8 @@ use std::{sync::Arc, time::Duration}; /// The verifier used to verify OAuth tokens. #[derive(Clone)] pub struct Verifier { - // Note that we do not need to use an Arc here, since Py is already a reference-counted // pointer - inner: Py, + inner: Arc>, timeout: u64, blocking_threadpool: Arc, } @@ -103,7 +102,7 @@ impl Verifier { })?; Ok(Self { - inner, + inner: Arc::new(inner), timeout: settings.fxa_oauth_request_timeout, blocking_threadpool, })