cel-rs-rb 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43135286f54e827165a6dbb9212d5f39a94511b7689c3f1eb7a36413eaa5a5b0
4
- data.tar.gz: c5d01546ad8635828a8f6c8d7a2221248eb6cc0e9d3429e149a844d0d393108e
3
+ metadata.gz: 13a612624d0d6c97974c52a683251f5166c26f2d327580a28e6a86a93b1a204e
4
+ data.tar.gz: 28241f0702e1a80b38fa0d9b87e633b0b3ea7ab43951d8e22960c1e698cb6905
5
5
  SHA512:
6
- metadata.gz: 0bb048ff31fa5cf28ca3610ba820311f3d47afef49a544896dac891b1ac48fcc37ba19b3ed6a802c66b145bdd59e03d731a8fc1584f107ee30bc8646479e6f36
7
- data.tar.gz: 01c5e7136e4bf206e2b49e2c91b612e9232f5404319cc77f3cbf4106f4f9fd1562eb5cb08c46c687286a568293fffbff79fa74275ca1adde8aaab57b27c7b986
6
+ metadata.gz: 96921ccbf5acd6d24bd1da3a8ec70769fe58e0b6aaec58d202977c06c5b0ae18e461ba4a69b6a3b79c6da0bf6825c46e78e202ad3d0cb708fca05ab6580b5224
7
+ data.tar.gz: b23e6af896848aee4e7ed10ebf3fd5e85da4a37443bd0e16d93fde9d2e272f4afac2a3f6cfc7b9422c2f6f20f963f70e5cf6be04c5bf91589d9f342443bd35fe
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ Upgrade to [cel 0.16.1](https://crates.io/crates/cel/0.16.1) from crates.io.
6
+
7
+ ### Fixed
8
+
9
+ - Operator chains now count toward the parser's default recursion limit of 96,
10
+ even when the expression looks flat. Expressions over the limit raise
11
+ `CEL::ParseError` at compile time. If you generate expressions, check that
12
+ they stay within this limit. The Ruby API is unchanged.
13
+ - The parser now cleans up long chains and abandoned parses without recursively
14
+ freeing the parse tree, preventing stack overflows during cleanup.
15
+
3
16
  ## 0.4.0
4
17
 
5
18
  Upgrade to the published [cel 0.16.0](https://crates.io/crates/cel/0.16.0)
data/Cargo.lock CHANGED
@@ -147,7 +147,7 @@ dependencies = [
147
147
  name = "cel"
148
148
  version = "0.1.0"
149
149
  dependencies = [
150
- "cel 0.16.0",
150
+ "cel 0.16.1",
151
151
  "chrono",
152
152
  "magnus",
153
153
  "rb-sys",
@@ -155,9 +155,9 @@ dependencies = [
155
155
 
156
156
  [[package]]
157
157
  name = "cel"
158
- version = "0.16.0"
158
+ version = "0.16.1"
159
159
  source = "registry+https://github.com/rust-lang/crates.io-index"
160
- checksum = "058e87eba1938be49be5785de8d2eff3004a70f8e8f9158b52b1177c93d6c869"
160
+ checksum = "0d7008e7aec1c7ea461e0c670b9d2aaf8fc8049ab10de26647a2065c7c9c5446"
161
161
  dependencies = [
162
162
  "antlr4rust",
163
163
  "base64",
data/README.md CHANGED
@@ -94,6 +94,14 @@ or add functions to explicitly empty contexts. Ruby callbacks that conflict
94
94
  with enabled extension functions raise `CEL::ExecutionError` during execution,
95
95
  just like conflicts with standard CEL builtins.
96
96
 
97
+ ### Parser recursion limit
98
+
99
+ The parser limits nesting to 96 levels. Operator chains count toward the limit
100
+ even without parentheses. This includes arithmetic chains, field access,
101
+ method calls, and indexing. Expressions that exceed the limit raise
102
+ `CEL::ParseError` during compilation. The Ruby API does not expose a setting
103
+ for this limit.
104
+
97
105
  ### Evaluation limits and cancellation
98
106
 
99
107
  Set a comprehension-iteration budget when compiling, and a timeout in seconds
data/ext/cel/Cargo.toml CHANGED
@@ -10,5 +10,5 @@ crate-type = ["cdylib"]
10
10
  [dependencies]
11
11
  magnus = { version = "0.8.2", features = ["chrono", "rb-sys"] }
12
12
  rb-sys = { version = "0.9.128", features = ["stable-api-compiled-fallback"] }
13
- cel = { version = "0.16.0", features = ["chrono", "regex", "json"] }
13
+ cel = { version = "0.16.1", features = ["chrono", "regex", "json"] }
14
14
  chrono = "0.4.45"
data/lib/cel/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CEL
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
data/spec/cel_spec.rb CHANGED
@@ -16,6 +16,12 @@ RSpec.describe CEL do
16
16
  expect { CEL.compile("1 +") }.to raise_error(CEL::ParseError)
17
17
  end
18
18
 
19
+ it "applies the parser recursion limit to flat arithmetic chains" do
20
+ expect(CEL.compile("1" + " + 1" * 96).execute).to eq(97)
21
+ expect { CEL.compile("1" + " + 1" * 97) }
22
+ .to raise_error(CEL::ParseError, /recursion limit of 96 exceeded/i)
23
+ end
24
+
19
25
  it "enables each upstream extension for compilation and execution" do
20
26
  tests = {
21
27
  strings: ["'TacoCat'.lowerAscii()", "tacocat"],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cel-rs-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CEL Ruby Contributors