actions: Removes Rule parameter from runtime execute

Generals organization on the Action class
This commit is contained in:
Felipe Zimmerle
2020-05-18 21:33:03 -03:00
parent c7a78926ee
commit 2c20f365e8
188 changed files with 3096 additions and 2758 deletions

View File

@@ -13,34 +13,37 @@
*
*/
#include <string>
#include <memory>
#include "modsecurity/actions/action.h"
#include "modsecurity/rule_message.h"
#include "src/actions/action_type_rule_metadata.h"
#include "src/actions/action_allowed_in_sec_default_action.h"
#ifndef SRC_ACTIONS_DISRUPTIVE_BLOCK_H_
#define SRC_ACTIONS_DISRUPTIVE_BLOCK_H_
#ifdef __cplusplus
class Transaction;
#ifndef SRC_ACTIONS_BLOCK_H_
#define SRC_ACTIONS_BLOCK_H_
namespace modsecurity {
class Transaction;
namespace actions {
class Block : public Action {
class Block : public ActionTypeRuleMetaData,
public ActionAllowedAsSecDefaultAction {
public:
explicit Block(const std::string &action) : Action(action) { }
Block()
: Action("block")
{ }
bool execute(RuleWithActions *rule, Transaction *transaction) override;
void configure(RuleWithActions *rule) override {
rule->setHasBlockAction(true);
}
};
} // namespace actions
} // namespace modsecurity
#endif
#endif // SRC_ACTIONS_DISRUPTIVE_BLOCK_H_
#endif // SRC_ACTIONS_BLOCK_H_