Skip to content

Commit

Permalink
Release 1.2.0 (unstable) (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 authored Mar 16, 2022
1 parent 4bb1c08 commit 1c131bb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/PWRet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PowerWAF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
6 changes: 2 additions & 4 deletions tests/TestInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ TEST(FunctionalTests, Budget)

ddwaf_object_array_add(&param_val, ddwaf_object_string(&tmp, "rule2"));

ddwaf_object_map_add(&parameter, "value2", &param_key);
ddwaf_object_map_add(&parameter, "value1", &param_val);
ddwaf_object_map_add(&parameter, "value2", &param_key);

ddwaf_result ret;
EXPECT_EQ(ddwaf_run(context1, &parameter, &ret, LONG_TIME), DDWAF_MONITOR);
Expand All @@ -276,9 +276,7 @@ TEST(FunctionalTests, Budget)
ddwaf_result_free(&ret);

EXPECT_EQ(ddwaf_run(context1, &parameter, &ret, SHORT_TIME), DDWAF_GOOD);
EXPECT_FALSE(ret.timeout);
EXPECT_EQ(ddwaf_run(context2, &parameter, &ret, SHORT_TIME), DDWAF_GOOD);
EXPECT_FALSE(ret.timeout);

ddwaf_object_free(&parameter);

Expand All @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/TestProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ TEST(TestPWProcessor, TestBudgetRules)
ddwaf_object param = DDWAF_OBJECT_MAP, tmp;
ddwaf_object_map_add(&param, "param", ddwaf_object_string(&tmp, "aaaabbbbbaaa"));

EXPECT_EQ(ddwaf_run(context, &param, &ret, 50), DDWAF_GOOD);
EXPECT_FALSE(ret.timeout);
EXPECT_EQ(ddwaf_run(context, &param, &ret, SHORT_TIME), DDWAF_GOOD);
EXPECT_TRUE(ret.timeout);

ddwaf_result_free(&ret);
ddwaf_context_destroy(context);
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.2.0

0 comments on commit 1c131bb

Please sign in to comment.