Skip to content

Add runtime regex check configuration#12

Open
xiaoshuai7038 wants to merge 1 commit into
codingo:mainfrom
xiaoshuai7038:fix/runtime-regex-checks
Open

Add runtime regex check configuration#12
xiaoshuai7038 wants to merge 1 commit into
codingo:mainfrom
xiaoshuai7038:fix/runtime-regex-checks

Conversation

@xiaoshuai7038
Copy link
Copy Markdown

@xiaoshuai7038 xiaoshuai7038 commented May 15, 2026

Implements runtime regex alerts loaded from a JSON config file via --checks / --check-config.

Summary:

  • Supports config as either a JSON array or an object with a checks array.
  • Validates required field, regex, and alert values, unsupported fields, invalid regexes, and bad case-sensitivity flags.
  • Supports domain, DNS record, HTTP status/content-length/code-string, and response body fields.
  • Keeps response bodies only in memory for matching, capped at 64 KiB, and does not write bodies to result JSON.
  • Adds README docs, an example config, and a lightweight parser test target behind DOOKED_BUILD_TESTS.

Validation:

  • git diff --check
  • python3 -m json.tool dooked/examples/regex-checks.json >/dev/null
  • clang++ -std=c++17 -Idooked/include -Idooked/json/include -Idooked/spdlog/include dooked/test/regex_checks_test.cpp dooked/source/checks/regex_checks.cpp dooked/source/utils/constants.cpp dooked/source/utils/string_utils.cpp -o /tmp/dooked_regex_checks_test && /tmp/dooked_regex_checks_test

Full CMake validation was not possible in this environment because cmake is unavailable. Dependency submodules were initialized for the standalone parser test.

Fixes #2

If this is selected for the listed bounty, my PayPal link is: https://paypal.me/xiaoshuai12138

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.

Regular Expression Checks

1 participant