chore: fix duplicated variable name
This commit is contained in:
parent
e5a673376f
commit
68dd29420d
|
|
@ -56,14 +56,14 @@ description() -> "ACL with HTTP API".
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
check_acl_request(Params =
|
check_acl_request(ACLParams =
|
||||||
#{pool_name := PoolName,
|
#{pool_name := PoolName,
|
||||||
path := Path,
|
path := Path,
|
||||||
method := Method,
|
method := Method,
|
||||||
headers := Headers,
|
headers := Headers,
|
||||||
params := Params,
|
params := Params,
|
||||||
timeout := Timeout}, ClientInfo) ->
|
timeout := Timeout}, ClientInfo) ->
|
||||||
Retry = maps:get(retry_times, Params, ?DEFAULT_RETRY_TIMES),
|
Retry = maps:get(retry_times, ACLParams, ?DEFAULT_RETRY_TIMES),
|
||||||
request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry).
|
request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry).
|
||||||
|
|
||||||
access(subscribe) -> 1;
|
access(subscribe) -> 1;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_auth_http,
|
{application, emqx_auth_http,
|
||||||
[{description, "EMQ X Authentication/ACL with HTTP API"},
|
[{description, "EMQ X Authentication/ACL with HTTP API"},
|
||||||
{vsn, "4.3.7"}, % strict semver, bump manually!
|
{vsn, "4.3.8"}, % strict semver, bump manually!
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_auth_http_sup]},
|
{registered, [emqx_auth_http_sup]},
|
||||||
{applications, [kernel,stdlib,ehttpc]},
|
{applications, [kernel,stdlib,ehttpc]},
|
||||||
|
|
|
||||||
|
|
@ -63,27 +63,27 @@ description() -> "Authentication by HTTP API".
|
||||||
%% Requests
|
%% Requests
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
authenticate(Params =
|
authenticate(AuthParams =
|
||||||
#{pool_name := PoolName,
|
#{pool_name := PoolName,
|
||||||
path := Path,
|
path := Path,
|
||||||
method := Method,
|
method := Method,
|
||||||
headers := Headers,
|
headers := Headers,
|
||||||
params := Params,
|
params := Params,
|
||||||
timeout := Timeout}, ClientInfo) ->
|
timeout := Timeout}, ClientInfo) ->
|
||||||
Retry = maps:get(retry_times, Params, ?DEFAULT_RETRY_TIMES),
|
Retry = maps:get(retry_times, AuthParams, ?DEFAULT_RETRY_TIMES),
|
||||||
request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry).
|
request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry).
|
||||||
|
|
||||||
-spec(is_superuser(maybe(map()), emqx_types:client()) -> boolean()).
|
-spec(is_superuser(maybe(map()), emqx_types:client()) -> boolean()).
|
||||||
is_superuser(undefined, _ClientInfo) ->
|
is_superuser(undefined, _ClientInfo) ->
|
||||||
false;
|
false;
|
||||||
is_superuser(Params =
|
is_superuser(SuperParams =
|
||||||
#{pool_name := PoolName,
|
#{pool_name := PoolName,
|
||||||
path := Path,
|
path := Path,
|
||||||
method := Method,
|
method := Method,
|
||||||
headers := Headers,
|
headers := Headers,
|
||||||
params := Params,
|
params := Params,
|
||||||
timeout := Timeout}, ClientInfo) ->
|
timeout := Timeout}, ClientInfo) ->
|
||||||
Retry = maps:get(retry_times, Params, ?DEFAULT_RETRY_TIMES),
|
Retry = maps:get(retry_times, SuperParams, ?DEFAULT_RETRY_TIMES),
|
||||||
case request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry) of
|
case request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry) of
|
||||||
{ok, 200, _Body} -> true;
|
{ok, 200, _Body} -> true;
|
||||||
{ok, _Code, _Body} -> false;
|
{ok, _Code, _Body} -> false;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
request(PoolName, Method, Path, Headers, Params, Timeout) ->
|
request(PoolName, Method, Path, Headers, Params, Timeout) ->
|
||||||
request(PoolName, Method, Path, Headers, Params, ?DEFAULT_RETRY_TIMES).
|
request(PoolName, Method, Path, Headers, Params, Timeout, ?DEFAULT_RETRY_TIMES).
|
||||||
|
|
||||||
request(PoolName, get, Path, Headers, Params, Timeout, Retry) ->
|
request(PoolName, get, Path, Headers, Params, Timeout, Retry) ->
|
||||||
NewPath = Path ++ "?" ++ binary_to_list(cow_qs:qs(bin_kw(Params))),
|
NewPath = Path ++ "?" ++ binary_to_list(cow_qs:qs(bin_kw(Params))),
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ t_password_hash(_) ->
|
||||||
ok = application:start(emqx_auth_mnesia).
|
ok = application:start(emqx_auth_mnesia).
|
||||||
|
|
||||||
t_will_message_connection_denied(Config) when is_list(Config) ->
|
t_will_message_connection_denied(Config) when is_list(Config) ->
|
||||||
ClientId = Username = <<"subscriber">>,
|
ClientId = <<"subscriber">>,
|
||||||
Password = <<"p">>,
|
Password = <<"p">>,
|
||||||
application:stop(emqx_auth_mnesia),
|
application:stop(emqx_auth_mnesia),
|
||||||
ok = emqx_ct_helpers:start_apps([emqx_auth_mnesia]),
|
ok = emqx_ct_helpers:start_apps([emqx_auth_mnesia]),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue