MXS 173 Deprecate DBFW rule limit_queries
Replaced by throttle filter
This commit is contained in:
@ -261,6 +261,8 @@ rule examplerule match regex '.*select.*from.*accounts.*'
|
|||||||
|
|
||||||
#### `limit_queries`
|
#### `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
|
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
|
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
|
in seconds and the third is the amount of time in seconds for which the rule is
|
||||||
|
|||||||
@ -101,9 +101,18 @@ namespace
|
|||||||
class DbfwThread
|
class DbfwThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int& rule_version(const Dbfw* d) { return m_instance_data[d].rule_version; }
|
int& rule_version(const Dbfw* d)
|
||||||
RuleList& rules(const Dbfw* d) { return m_instance_data[d].rules; }
|
{
|
||||||
UserMap& users(const Dbfw* d) { return m_instance_data[d].users; }
|
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:
|
private:
|
||||||
class Data
|
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)
|
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);
|
struct parser_stack* rstack = (struct parser_stack*)dbfw_yyget_extra((yyscan_t) scanner);
|
||||||
ss_dassert(rstack);
|
ss_dassert(rstack);
|
||||||
rstack->add(new LimitQueriesRule(rstack->name, max, timeperiod, holdoff));
|
rstack->add(new LimitQueriesRule(rstack->name, max, timeperiod, holdoff));
|
||||||
|
|||||||
Reference in New Issue
Block a user