spacewander commented on a change in pull request #4493:
URL: https://github.com/apache/apisix/pull/4493#discussion_r660209499
##########
File path: apisix/plugins/ip-restriction.lua
##########
@@ -27,40 +27,29 @@ local lrucache = core.lrucache.new({
local schema = {
type = "object",
- oneOf = {
- {
- title = "whitelist",
- properties = {
- whitelist = {
- type = "array",
- items = {anyOf = core.schema.ip_def},
- minItems = 1
- },
- message = {
- type = "string",
- default = "Your IP address is not allowed"
- },
- },
- required = {"whitelist"},
- additionalProperties = false,
+ properties = {
+ message = {
+ type = "string",
+ minLength = 1,
+ maxLength = 64,
Review comment:
64 looks too short to me. What about 4096?
##########
File path: docs/en/latest/plugins/ip-restriction.md
##########
@@ -41,9 +41,10 @@ in CIDR notation like 10.10.10.0/24 can be used.
| --------- | ------------- | ----------- | ------- | ----- |
---------------------------------------- |
| whitelist | array[string] | optional | | | List of IPs or
CIDR ranges to whitelist. |
| blacklist | array[string] | optional | | | List of IPs or
CIDR ranges to blacklist. |
+| message | string | optional | Your IP address is not allowed. | [1, 64] |
Message returned in case IP access is not allowed. |
-One of `whitelist` or `blacklist` must be specified, and they can not work
-together.
+One of `whitelist` or `blacklist` must be specified, and they can not work
together.
+The message supports user-defined configuration.
Review comment:
The message can be user-defined.
--
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]