Skip to content

Conversation

@srini-abhiram
Copy link
Contributor

FIX #365

  • Make sure the code changes pass the pre-commit checks.

  • Sign-off your commit by using -s when doing git commit

  • Try to classify PRs for easy understanding of the type of changes, such as [Bugfix], [Feat], and [CI].

  • Core Provider Implementation: Added a RegexProvider struct and associated methods (NewRegexProvider, Scan) in candle-binding/regex_provider.go. This includes configurable pattern definitions, input length validation, and support for case-insensitive matching.

  • Robust Timeout Mechanism: The Scan method now incorporates a context-aware timeout to ensure regex operations do not exceed a predefined duration. A WithTestDelay functional option was introduced to enable reliable testing of this timeout behavior.

  • Comprehensive Testing: Unit tests in candle-binding/regex_provider_test.go validate configuration, matching logic, case-insensitivity, input limits, and the timeout mechanism. A dedicated ReDoSAttackVector test confirms the provider’s resilience against known ReDoS patterns.

  • Performance Benchmarks: A new benchmark file, candle-binding/regex_provider_bench_test.go, measures the Scan method’s performance across various scenarios (single/multi-pattern, large input).

- **Core Provider Implementation:** Added a `RegexProvider` struct and associated methods (`NewRegexProvider`, `Scan`) in `candle-binding/regex_provider.go`. This includes configurable pattern definitions, input length validation, and support for case-insensitive matching.
- **Robust Timeout Mechanism:** The `Scan` method now incorporates a context-aware timeout to ensure regex operations do not exceed a predefined duration. A `WithTestDelay` functional option was introduced to enable reliable testing of this timeout behavior.
- **Comprehensive Testing:** Unit tests in `candle-binding/regex_provider_test.go` validate configuration, matching logic, case-insensitivity, input limits, and the timeout mechanism. A dedicated `ReDoSAttackVector` test confirms the provider’s resilience against known ReDoS patterns.
- **Performance Benchmarks:** A new benchmark file, `candle-binding/regex_provider_bench_test.go`, measures the `Scan` method’s performance across various scenarios (single/multi-pattern, large input).

Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>
Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 1047a52
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/69142f4f0d752b0008dc2a6b
😎 Deploy Preview https://deploy-preview-644--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot deleted a comment Nov 15, 2025
@rootfs rootfs merged commit 81c1e5e into vllm-project:main Nov 17, 2025
15 of 16 checks passed
szedan-rh pushed a commit to szedan-rh/semantic-router that referenced this pull request Nov 19, 2025
* feat: Implement ReDoS-safe regex scanning provider

- **Core Provider Implementation:** Added a `RegexProvider` struct and associated methods (`NewRegexProvider`, `Scan`) in `candle-binding/regex_provider.go`. This includes configurable pattern definitions, input length validation, and support for case-insensitive matching.
- **Robust Timeout Mechanism:** The `Scan` method now incorporates a context-aware timeout to ensure regex operations do not exceed a predefined duration. A `WithTestDelay` functional option was introduced to enable reliable testing of this timeout behavior.
- **Comprehensive Testing:** Unit tests in `candle-binding/regex_provider_test.go` validate configuration, matching logic, case-insensitivity, input limits, and the timeout mechanism. A dedicated `ReDoSAttackVector` test confirms the provider’s resilience against known ReDoS patterns.
- **Performance Benchmarks:** A new benchmark file, `candle-binding/regex_provider_bench_test.go`, measures the `Scan` method’s performance across various scenarios (single/multi-pattern, large input).

Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>

* fix(lint): fix pre-commit

Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>

---------

Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Prompt Classification] Implement In-Tree Regex Scanning Provider

2 participants