diff --git a/CHANGELOG.md b/CHANGELOG.md index dd2cdc017..8ebd90903 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ # libddwaf release +### v1.2.0 (unstable) - 2022/03/16 +- Remove metrics collector. +- Add `total_runtime` to `ddwaf_result`. +- Fix issue when reporting timeouts. + ### v1.1.0 (unstable) - 2022/03/09 - Add `ddwaf_object` getters. - Provide ruleset parsing diagnostics on `ddwaf_init`. - Add support for metrics collection on `ddwaf_run`. +- Add `keys_only` transformer. - Improve support for older platforms. - Remove indirection and reduce string operations when processing flows. - Refactor input verification. diff --git a/src/PWRet.cpp b/src/PWRet.cpp index c6a23cf69..f9d1722c3 100644 --- a/src/PWRet.cpp +++ b/src/PWRet.cpp @@ -122,6 +122,7 @@ void PWRetManager::reportMatch(const std::string& id, DDWAF_RET_CODE PWRetManager::synthetize(ddwaf_result& output) const { output = { 0 }; + output.timeout = timeout; if (outputDocument.GetArray().Size() > 0) { diff --git a/src/PowerWAF.hpp b/src/PowerWAF.hpp index 9f3832280..ccfa2f543 100644 --- a/src/PowerWAF.hpp +++ b/src/PowerWAF.hpp @@ -27,7 +27,7 @@ struct PowerWAF static PowerWAF* fromConfig(const ddwaf_object rules, const ddwaf_config* config, ddwaf::ruleset_info& info); - static constexpr ddwaf_version waf_version { 1, 1, 0 }; + static constexpr ddwaf_version waf_version { 1, 2, 0 }; }; #endif /* pw_hpp */ diff --git a/tests/TestInterface.cpp b/tests/TestInterface.cpp index 108b39c1e..3d97bda2e 100644 --- a/tests/TestInterface.cpp +++ b/tests/TestInterface.cpp @@ -264,8 +264,8 @@ TEST(FunctionalTests, Budget) ddwaf_object_array_add(¶m_val, ddwaf_object_string(&tmp, "rule2")); - ddwaf_object_map_add(¶meter, "value2", ¶m_key); ddwaf_object_map_add(¶meter, "value1", ¶m_val); + ddwaf_object_map_add(¶meter, "value2", ¶m_key); ddwaf_result ret; EXPECT_EQ(ddwaf_run(context1, ¶meter, &ret, LONG_TIME), DDWAF_MONITOR); @@ -276,9 +276,7 @@ TEST(FunctionalTests, Budget) ddwaf_result_free(&ret); EXPECT_EQ(ddwaf_run(context1, ¶meter, &ret, SHORT_TIME), DDWAF_GOOD); - EXPECT_FALSE(ret.timeout); EXPECT_EQ(ddwaf_run(context2, ¶meter, &ret, SHORT_TIME), DDWAF_GOOD); - EXPECT_FALSE(ret.timeout); ddwaf_object_free(¶meter); @@ -295,7 +293,7 @@ TEST(FunctionalTests, ddwaf_get_version) ddwaf_get_version(&version); EXPECT_EQ(version.major, 1); - EXPECT_EQ(version.minor, 1); + EXPECT_EQ(version.minor, 2); EXPECT_EQ(version.patch, 0); } diff --git a/tests/TestProcessor.cpp b/tests/TestProcessor.cpp index ddc4ddef1..42ef548da 100644 --- a/tests/TestProcessor.cpp +++ b/tests/TestProcessor.cpp @@ -382,8 +382,8 @@ TEST(TestPWProcessor, TestBudgetRules) ddwaf_object param = DDWAF_OBJECT_MAP, tmp; ddwaf_object_map_add(¶m, "param", ddwaf_object_string(&tmp, "aaaabbbbbaaa")); - EXPECT_EQ(ddwaf_run(context, ¶m, &ret, 50), DDWAF_GOOD); - EXPECT_FALSE(ret.timeout); + EXPECT_EQ(ddwaf_run(context, ¶m, &ret, SHORT_TIME), DDWAF_GOOD); + EXPECT_TRUE(ret.timeout); ddwaf_result_free(&ret); ddwaf_context_destroy(context); diff --git a/version b/version index 1cc5f657e..867e52437 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.2.0 \ No newline at end of file