MXS 173 Deprecate DBFW rule limit_queries

Replaced by throttle filter
This commit is contained in:
Niclas Antti
2018-05-24 14:17:00 +03:00
parent 8145e1fd46
commit 55e1a39cc3
2 changed files with 18 additions and 3 deletions

View File

@ -261,6 +261,8 @@ rule examplerule match regex '.*select.*from.*accounts.*'
#### `limit_queries`
This rule has been DEPRECATED. Please use the Throttle Filter instead.
The limit_queries rule expects three parameters. The first parameter is the
number of allowed queries during the time period. The second is the time period
in seconds and the third is the amount of time in seconds for which the rule is

View File

@ -101,9 +101,18 @@ namespace
class DbfwThread
{
public:
int& rule_version(const Dbfw* d) { return m_instance_data[d].rule_version; }
RuleList& rules(const Dbfw* d) { return m_instance_data[d].rules; }
UserMap& users(const Dbfw* d) { return m_instance_data[d].users; }
int& rule_version(const Dbfw* d)
{
return m_instance_data[d].rule_version;
}
RuleList& rules(const Dbfw* d)
{
return m_instance_data[d].rules;
}
UserMap& users(const Dbfw* d)
{
return m_instance_data[d].users;
}
private:
class Data
@ -941,6 +950,10 @@ void define_where_clause_rule(void* scanner)
*/
void define_limit_queries_rule(void* scanner, int max, int timeperiod, int holdoff)
{
MXS_WARNING("The Database Firewall rule 'limit_queries' has been deprecated"
" and will be removed in a later version of MaxScale. "
"Please use the Throttle Filter instead");
struct parser_stack* rstack = (struct parser_stack*)dbfw_yyget_extra((yyscan_t) scanner);
ss_dassert(rstack);
rstack->add(new LimitQueriesRule(rstack->name, max, timeperiod, holdoff));