From ee87643bb21b88c52cdf6eab17e428a1da40616a Mon Sep 17 00:00:00 2001 From: Anand Krishnamoorthi Date: Mon, 3 Mar 2025 11:27:39 -0800 Subject: [PATCH] Update dependencies Specify `js` feature for `uuid` when building wasm by specifying it as a non-optional dependency in wasm binding's Cargo.toml. Signed-off-by: Anand Krishnamoorthi --- Cargo.toml | 22 +++++++++++----------- bindings/ffi/Cargo.toml | 2 +- bindings/python/Cargo.toml | 4 ++-- bindings/wasm/Cargo.toml | 8 +++++++- src/builtins/uuid.rs | 16 ++++++++-------- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7971d1ba..b51bb7d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,25 +105,25 @@ serde_json = { version = "1.0.89", default-features = false, features = ["alloc" lazy_static = { version = "1.4.0", default-features = false } # Crypto -constant_time_eq = {version = "0.3.0", optional = true, default-features = false } +constant_time_eq = {version = "0.4.0", optional = true, default-features = false } hmac = {version = "0.12.1", optional = true, default-features = false} sha2 = {version= "0.10.8", optional = true, default-features = false } hex = {version = "0.4.3", optional = true, default-features = false, features = ["alloc"] } sha1 = {version = "0.10.6", optional = true, default-features = false } md-5 = {version = "0.10.6", optional = true, default-features = false } -data-encoding = { version = "2.4.0", optional = true, default-features=false, features = ["alloc"] } -scientific = { version = "0.5.2" } +data-encoding = { version = "2.8.0", optional = true, default-features=false, features = ["alloc"] } +scientific = { version = "0.5.3" } -regex = {version = "1.10.2", optional = true, default-features = false } -semver = {version = "1.0.20", optional = true, default-features = false } +regex = {version = "1.11.1", optional = true, default-features = false } +semver = {version = "1.0.25", optional = true, default-features = false } wax = { version = "0.6.0", features = [], default-features = false, optional = true } -url = { version = "2.5.0", optional = true } -uuid = { version = "1.6.1", default-features = false, features = ["v4", "fast-rng"], optional = true } -jsonschema = { version = "0.28.1", default-features = false, optional = true } -chrono = { version = "0.4.31", optional = true } -chrono-tz = { version = "0.10.0", optional = true } -jsonwebtoken = { version = "9.2.0", optional = true } +url = { version = "2.5.4", optional = true } +uuid = { version = "1.15.1", default-features = false, features = ["v4", "fast-rng"], optional = true } +jsonschema = { version = "0.29.0", default-features = false, optional = true } +chrono = { version = "0.4.40", optional = true } +chrono-tz = { version = "0.10.1", optional = true } +jsonwebtoken = { version = "9.3.1", optional = true } itertools = { version = "0.14.0", default-features = false, optional = true } serde_yaml = {version = "0.9.16", default-features = false, optional = true } diff --git a/bindings/ffi/Cargo.toml b/bindings/ffi/Cargo.toml index c9e508a5..1db2b552 100644 --- a/bindings/ffi/Cargo.toml +++ b/bindings/ffi/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib", "staticlib"] [dependencies] anyhow = "1.0" regorus = { path = "../..", default-features = false } -serde_json = "1.0.113" +serde_json = "1.0.140" [features] default = ["ast", "std", "coverage", "regorus/arc", "regorus/full-opa"] diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 0f603ee4..72aa560b 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -18,8 +18,8 @@ coverage = ["regorus/coverage"] [dependencies] anyhow = "1.0" -ordered-float = "4.2.0" +ordered-float = "5.0.0" pyo3 = {version = "0.22.0", features = ["anyhow", "extension-module"] } regorus = { path = "../..", default-features = false, features = ["arc"] } -serde_json = "1.0.112" +serde_json = "1.0.140" diff --git a/bindings/wasm/Cargo.toml b/bindings/wasm/Cargo.toml index 0ac7c0e3..2ff042c7 100644 --- a/bindings/wasm/Cargo.toml +++ b/bindings/wasm/Cargo.toml @@ -17,8 +17,14 @@ coverage = ["regorus/coverage"] [dependencies] regorus = { path = "../..", default-features = false, features = ["arc"] } -serde_json = "1.0.111" +serde_json = "1.0.140" wasm-bindgen = "=0.2.93" +# Specify uuid as a mandatory dependency so as to enable `js` feature which is now required +# when targeting wasm32-unknown-unknown. +uuid = { version = "1.15.1", default-features = false, features = ["v4", "fast-rng", "js"]} [dev-dependencies] wasm-bindgen-test = "0.3.40" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] } diff --git a/src/builtins/uuid.rs b/src/builtins/uuid.rs index 8fb8aed5..e10ea7b9 100644 --- a/src/builtins/uuid.rs +++ b/src/builtins/uuid.rs @@ -132,16 +132,16 @@ fn timestamp(uuid: &Uuid) -> Option { const fn decode_rfc4122_timestamp(uuid: &Uuid) -> (u64, u16) { let bytes = uuid.as_bytes(); - let ticks: u64 = ((bytes[6] & 0x0F) as u64) << 56 - | (bytes[7] as u64) << 48 - | (bytes[4] as u64) << 40 - | (bytes[5] as u64) << 32 - | (bytes[0] as u64) << 24 - | (bytes[1] as u64) << 16 - | (bytes[2] as u64) << 8 + let ticks: u64 = (((bytes[6] & 0x0F) as u64) << 56) + | ((bytes[7] as u64) << 48) + | ((bytes[4] as u64) << 40) + | ((bytes[5] as u64) << 32) + | ((bytes[0] as u64) << 24) + | ((bytes[1] as u64) << 16) + | ((bytes[2] as u64) << 8) | (bytes[3] as u64); - let counter: u16 = ((bytes[8] & 0x3F) as u16) << 8 | (bytes[9] as u16); + let counter: u16 = (((bytes[8] & 0x3F) as u16) << 8) | (bytes[9] as u16); (ticks, counter) }