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

feat: add hexDecode transformation #1275

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

tty2
Copy link
Contributor

@tty2 tty2 commented Jan 6, 2025

This PR add a simple implementation of hexDecode function.
Changes are based on std lib.
Related to the issue #1253.

Json test cases were edited. At first glance it looks incorrect. This one. Look this comment.
If you have any doubts or can explain why this test case has this output, please reject the PR and let me know why this test case is valid.

@tty2 tty2 marked this pull request as ready for review January 7, 2025 08:57
@tty2 tty2 requested a review from a team as a code owner January 7, 2025 08:57
Copy link
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is taking a nice shape.

Can you extend the json test cases with negative tests?

internal/transformations/hex_decode.go Outdated Show resolved Hide resolved
@jcchavezs jcchavezs requested a review from M4tteoP January 7, 2025 14:24
@fzipi fzipi changed the title Hex decode feat: add hexDecode transformation Jan 9, 2025
@tty2 tty2 requested a review from fzipi January 9, 2025 15:39
@fzipi fzipi linked an issue Jan 9, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.77%. Comparing base (df87141) to head (774e8a7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1275      +/-   ##
==========================================
+ Coverage   81.76%   81.77%   +0.01%     
==========================================
  Files         169      170       +1     
  Lines        9770     9777       +7     
==========================================
+ Hits         7988     7995       +7     
  Misses       1533     1533              
  Partials      249      249              
Flag Coverage Δ
coraza.rule.case_sensitive_args_keys 81.73% <100.00%> (+0.01%) ⬆️
coraza.rule.multiphase_valuation 81.77% <100.00%> (+0.01%) ⬆️
coraza.rule.no_regex_multiline 81.71% <100.00%> (+0.01%) ⬆️
default 81.77% <100.00%> (+0.01%) ⬆️
examples+ 16.54% <14.28%> (-0.01%) ⬇️
examples+coraza.rule.case_sensitive_args_keys 81.73% <100.00%> (+0.01%) ⬆️
examples+coraza.rule.multiphase_valuation 81.60% <100.00%> (+0.01%) ⬆️
examples+coraza.rule.no_regex_multiline 81.63% <100.00%> (+0.01%) ⬆️
examples+memoize_builders 81.73% <100.00%> (+0.01%) ⬆️
examples+no_fs_access 81.05% <100.00%> (+0.01%) ⬆️
ftw 81.77% <100.00%> (+0.01%) ⬆️
memoize_builders 81.86% <100.00%> (+0.01%) ⬆️
no_fs_access 81.22% <100.00%> (+0.01%) ⬆️
tinygo 81.74% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

[owasp-modsecurity compatibility] hexDecode method
3 participants