-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Unless explicitly stated otherwise all files in this repository are | ||
// dual-licensed under the Apache-2.0 License or BSD-3-Clause License. | ||
// | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2021 Datadog, Inc. | ||
|
||
#include "builder/waf_builder.hpp" | ||
#include "configuration/manager.hpp" | ||
#include "parameter.hpp" | ||
#include "ruleset_info.hpp" | ||
#include "waf.hpp" | ||
#include <string> | ||
#include <utility> | ||
|
||
namespace ddwaf { | ||
|
||
bool waf_builder::add_or_update( | ||
const std::string &path, parameter::map &root, base_ruleset_info &info) | ||
{ | ||
return cfg_mgr_.add_or_update(path, root, info); | ||
} | ||
|
||
bool waf_builder::remove(const std::string &path) { return cfg_mgr_.remove(path); } | ||
|
||
ddwaf::waf waf_builder::build() | ||
{ | ||
auto config = cfg_mgr_.consolidate(); | ||
auto ruleset = rbuilder_.build(config); | ||
return waf{std::move(ruleset)}; | ||
} | ||
|
||
} // namespace ddwaf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters