-
Notifications
You must be signed in to change notification settings - Fork 4
libddwaf update 1.24.1 #159
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
libddwaf update 1.24.1 #159
Conversation
12afcd8 to
64c099e
Compare
6a83170 to
007bd4d
Compare
6709b88 to
4279333
Compare
162b628 to
430f81c
Compare
815d2d6 to
fe106a4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #159 +/- ##
============================================
- Coverage 58.55% 55.96% -2.60%
- Complexity 134 167 +33
============================================
Files 34 34
Lines 3458 3479 +21
Branches 780 782 +2
============================================
- Hits 2025 1947 -78
- Misses 900 993 +93
- Partials 533 539 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f682a5e to
0599dce
Compare
a9fc49c to
d512f46
Compare
80f403e to
b2512f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates libddwaf to version 1.24.1 by introducing a new WafBuilder class for managing configuration, updating exception handling by replacing RuleSetInfo with WafDiagnostics, and removing the deprecated Waf.run method. It also updates various JNI bindings, logging, and benchmark usage to reflect these changes.
- Introduces WafBuilder with new native bindings and config update methods.
- Updates exception handling and configuration (regex visibility) while removing legacy classes.
- Adjusts JNI and benchmark usage and updates version numbers in build workflow.
Reviewed Changes
Copilot reviewed 35 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/datadog/ddwaf/exception/InvalidRuleSetException.java | Updated exception to use WafDiagnostics instead of RuleSetInfo. |
| src/main/java/com/datadog/ddwaf/WafMetrics.java | Changed constructor visibility from package-private to public. |
| src/main/java/com/datadog/ddwaf/WafHandle.java | Revised handle creation, native handle management, and closing logic. |
| src/main/java/com/datadog/ddwaf/WafConfig.java | Made DEFAULT_KEY_REGEX and DEFAULT_VALUE_REGEX public for external access. |
| src/main/java/com/datadog/ddwaf/WafBuilder.java | Introduced new builder to add/update configurations and build a new WafHandle. |
| src/main/java/com/datadog/ddwaf/Waf.java | Updated library version and removed deprecated methods. |
| Removed Files | Removed RuleSetInfo.java and NativeWafHandle.java as part of the update. |
| src/main/c/*.c & JNI headers | Updated native signatures and JNI bindings to match Java changes. |
| src/jmh/java/com/datadog/ddwaf/WafHandleRunRulesBenchmark.java | Updated benchmark to use the new WafContext run method. |
| .github/workflows/actions.yml | Updated build configuration with the new libddwafVersion. |
Files not reviewed (3)
- libddwaf: Language not supported
- src/test/groovy/com/datadog/ddwaf/BadRuleTests.groovy: Language not supported
- src/test/groovy/com/datadog/ddwaf/BasicTests.groovy: Language not supported
Comments suppressed due to low confidence (4)
src/main/java/com/datadog/ddwaf/exception/InvalidRuleSetException.java:16
- Ensure all callers of InvalidRuleSetException are updated to use the new WafDiagnostics-based constructors, and update the related documentation to explain the change in error reporting.
public InvalidRuleSetException(WafDiagnostics wafDiagnostics, String message) {
src/main/java/com/datadog/ddwaf/WafMetrics.java:21
- The constructor visibility has been changed to public; please confirm that this change exposes only intended behaviors and is adequately covered by tests.
public WafMetrics() {
src/main/java/com/datadog/ddwaf/WafConfig.java:12
- Changing the regex constants to public exposes internal patterns; please verify that this design decision aligns with the intended public API and that any security considerations are addressed.
public final static String DEFAULT_KEY_REGEX =
.github/workflows/actions.yml:14
- Ensure that the updated libddwafVersion in the build configuration is consistent with all other version settings across the project to avoid potential build discrepancies.
libddwafVersion: 1.24.1
1f7aa73 to
b265ea6
Compare
da7711f to
eca759b
Compare
Datadog Summary✅ Code Quality ✅ Code Security ✅ Dependencies Was this helpful? Give us feedback! |
This commit provides the new WafBuilder class for libddwaf configuration manipulations. This new class holds a pointer to the c object ddwaf_builder and the operations are handled in waf_jni.c via the new binding of NativeWafhandle (ddwaf_handle)
RuleSetInfo is also modified with the new field, error and updated to contain all possible fields
Waf.run is eliminated as it is deprecated for a while now