tokers commented on a change in pull request #5378:
URL: https://github.com/apache/apisix/pull/5378#discussion_r741567143
##########
File path: apisix/plugins/limit-count.lua
##########
@@ -36,11 +36,10 @@ local schema = {
properties = {
count = {type = "integer", exclusiveMinimum = 0},
time_window = {type = "integer", exclusiveMinimum = 0},
- key = {
- type = "string",
- enum = {"remote_addr", "server_addr", "http_x_real_ip",
- "http_x_forwarded_for", "consumer_name", "service_id"},
- default = "remote_addr",
+ key = {type = "string", default = "remote_addr"},
+ key_type = {type = "string",
+ enum = {"var", "var_combination"},
Review comment:
So it's my understanding that a potential problem will be introduced
here, users might configure a non-existent variable and the validation is OK,
but actually, the rate-limiting won't be the effect?
I think maybe some documents should be added so that at least we can give
some hints to users.
##########
File path: apisix/plugins/limit-count.lua
##########
@@ -36,11 +36,10 @@ local schema = {
properties = {
count = {type = "integer", exclusiveMinimum = 0},
time_window = {type = "integer", exclusiveMinimum = 0},
- key = {
- type = "string",
- enum = {"remote_addr", "server_addr", "http_x_real_ip",
- "http_x_forwarded_for", "consumer_name", "service_id"},
- default = "remote_addr",
+ key = {type = "string", default = "remote_addr"},
+ key_type = {type = "string",
+ enum = {"var", "var_combination"},
Review comment:
OK, I saw the changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]