Merge pull request #11096 from emqx/range_validator_max_clientid_len

fix: add range validation for max_clientid_len
This commit is contained in:
Xinyu Liu 2023-06-20 11:33:00 +08:00 committed by GitHub
commit 21797d841e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -276,6 +276,9 @@ end}.
{validator, "range:1-65535", "must be 1 to 65535",
fun(X) -> X >= 1 andalso X =< 65535 end}.
{validator, "range:23-65535", "must be 23 to 65535",
fun(X) -> X >= 23 andalso X =< 65535 end}.
{validator, "range:1-9", "must be 1 to 9",
fun(X) -> X >= 1 andalso X =< 9 end}.
@ -955,7 +958,8 @@ end}.
%% @doc Set the Max ClientId Length Allowed.
{mapping, "mqtt.max_clientid_len", "emqx.max_clientid_len", [
{default, 65535},
{datatype, integer}
{datatype, integer},
{validators, ["range:23-65535"]}
]}.
%% @doc Set the Maximum topic levels.