Skip to content

Commit

Permalink
Basic cel::Expression & ::Predicate impl
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Snaps <[email protected]>
  • Loading branch information
alexsnaps committed Nov 26, 2024
1 parent d17acdb commit 839645f
Show file tree
Hide file tree
Showing 4 changed files with 348 additions and 0 deletions.
178 changes: 178 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions limitador/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ tonic = { version = "0.12.3", optional = true }
tonic-reflection = { version = "0.12.3", optional = true }
prost = { version = "0.13.3", optional = true }
prost-types = { version = "0.13.3", optional = true }
cel-parser = "0.8.0"
cel-interpreter = { version = "0.9.0", features = ["chrono", "regex"] }

[dev-dependencies]
serial_test = "3.0"
Expand Down
6 changes: 6 additions & 0 deletions limitador/src/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,12 @@ mod conditions {
}
}

pub use cel::Expression as CelExpression;
pub use cel::ParseError;
pub use cel::Predicate as CelPredicate;

pub(super) mod cel;

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading

0 comments on commit 839645f

Please sign in to comment.