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 +4 -4
- data/CHANGELOG.md +13 -0
- data/Cargo.lock +3 -3
- data/README.md +8 -0
- data/ext/cel/Cargo.toml +1 -1
- data/lib/cel/version.rb +1 -1
- data/spec/cel_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13a612624d0d6c97974c52a683251f5166c26f2d327580a28e6a86a93b1a204e
|
|
4
|
+
data.tar.gz: 28241f0702e1a80b38fa0d9b87e633b0b3ea7ab43951d8e22960c1e698cb6905
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
158
|
+
version = "0.16.1"
|
|
159
159
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
160
|
-
checksum = "
|
|
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.
|
|
13
|
+
cel = { version = "0.16.1", features = ["chrono", "regex", "json"] }
|
|
14
14
|
chrono = "0.4.45"
|
data/lib/cel/version.rb
CHANGED
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"],
|