Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New experimental [DynamicRegex] badge #10985

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TrianguloY
Copy link

This pr will close #10925. For more details and pre-discussion about this new badge, check that issue.

Summary

This pr adds a new badge: Dynamic regex. This badge allows to extract data from any text file by using re2, a subset of regex that avoids the ReDoS vulnerability (Regex Denegation of Service).

Details

  • The re2 npm package was included on package.json (latest version: 1.21.4), and the package-lock was updated.

  • A new service (DynamicRegexService) have been implemented to provide the funcionality. A single file dynamic-regex.service.js was created, the service extends directly from BaseService.

  • A new collection of tests was added (dynamic-regex.tester.js) to check the funcionality of the new service.

Notes

  • I tried to create tests based on the existing ones from other dynamic badges, but I can add more if needed.
  • I tried to document the badge using short but detailed texts. But since this is somewhat subjective I'm open to a full rewrite of them.
  • I kept the branch history in case you need to check a previous regex implementation (with a vm implementation to avoid the ReDoS). But in general the global changes are short and enough, and there is no need to review individual commits.

If there is any other required change, no matter how small, just place an inline comment and I'll do my best to fix it; or edit the branch directly.

Thanks 🙂

image

Copy link
Contributor

github-actions bot commented Apr 1, 2025

Messages
📖 ✨ Thanks for your contribution to Shields, @TrianguloY!

Generated by 🚫 dangerJS against 73319f1

Copy link

socket-security bot commented Apr 1, 2025

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/escape-string-regexp@4.0.0, npm/eslint-config-prettier@10.1.1, npm/eslint@9.23.0

View full report↗︎

@TrianguloY TrianguloY changed the title New experimental [Dynamic] badge: Regex (re2) badge New experimental [DynamicRegex] badge Apr 1, 2025
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.

Dynamic Regex Badge
1 participant