chore: rm unused macro and func, fix unchanged product name

This commit is contained in:
JimMoen 2022-03-15 17:51:30 +08:00
parent 188d876b1c
commit 0ee3e49db7
3 changed files with 2 additions and 28 deletions

View File

@ -39,8 +39,6 @@
-export([acl_conf_file/0]). -export([acl_conf_file/0]).
-export([ph_to_re/1]).
-type(source() :: map()). -type(source() :: map()).
-type(match_result() :: {matched, allow} | {matched, deny} | nomatch). -type(match_result() :: {matched, allow} | {matched, deny} | nomatch).
@ -371,6 +369,3 @@ type(Unknown) -> error({unknown_authz_source_type, Unknown}).
%% @doc where the acl.conf file is stored. %% @doc where the acl.conf file is stored.
acl_conf_file() -> acl_conf_file() ->
filename:join([emqx:data_dir(), "authz", "acl.conf"]). filename:join([emqx:data_dir(), "authz", "acl.conf"]).
ph_to_re(VarPH) ->
re:replace(VarPH, "[\\$\\{\\}]", "\\\\&", [global, {return, list}]).

View File

@ -27,27 +27,6 @@
-define(BAD_REQUEST, 'BAD_REQUEST'). -define(BAD_REQUEST, 'BAD_REQUEST').
-define(NOT_FOUND, 'NOT_FOUND'). -define(NOT_FOUND, 'NOT_FOUND').
-define(EXAMPLE_REDIS,
#{type=> redis,
enable => true,
server => <<"127.0.0.1:3306">>,
redis_type => single,
pool_size => 1,
auto_reconnect => true,
cmd => <<"HGETALL mqtt_authz">>}).
-define(EXAMPLE_FILE,
#{type=> file,
enable => true,
rules => <<"{allow,{username,\"^dashboard?\"},subscribe,[\"$SYS/#\"]}.\n",
"{allow,{ipaddr,\"127.0.0.1\"},all,[\"$SYS/#\",\"#\"]}.">>
}).
-define(EXAMPLE_RETURNED,
#{sources => [ ?EXAMPLE_REDIS
, ?EXAMPLE_FILE
]
}).
-define(IS_TRUE(Val), ((Val =:= true) or (Val =:= <<"true">>))). -define(IS_TRUE(Val), ((Val =:= true) or (Val =:= <<"true">>))).
-define(API_SCHEMA_MODULE, emqx_authz_api_schema). -define(API_SCHEMA_MODULE, emqx_authz_api_schema).

View File

@ -147,7 +147,7 @@ fields(plugin) ->
required => true, required => true,
example => "emqx_plugin_template-5.0-rc.1"}) example => "emqx_plugin_template-5.0-rc.1"})
}, },
{author, hoconsc:mk(list(string()), #{example => [<<"EMQ X Team">>]})}, {author, hoconsc:mk(list(string()), #{example => [<<"EMQX Team">>]})},
{builder, hoconsc:ref(?MODULE, builder)}, {builder, hoconsc:ref(?MODULE, builder)},
{built_on_otp_release, hoconsc:mk(string(), #{example => "24"})}, {built_on_otp_release, hoconsc:mk(string(), #{example => "24"})},
{compatibility, hoconsc:mk(map(), #{example => #{<<"emqx">> => <<"~>5.0">>}})}, {compatibility, hoconsc:mk(map(), #{example => #{<<"emqx">> => <<"~>5.0">>}})},
@ -195,7 +195,7 @@ fields(name) ->
fields(builder) -> fields(builder) ->
[ [
{contact, hoconsc:mk(string(), #{example => "emqx-support@emqx.io"})}, {contact, hoconsc:mk(string(), #{example => "emqx-support@emqx.io"})},
{name, hoconsc:mk(string(), #{example => "EMQ X Team"})}, {name, hoconsc:mk(string(), #{example => "EMQX Team"})},
{website, hoconsc:mk(string(), #{example => "www.emqx.com"})} {website, hoconsc:mk(string(), #{example => "www.emqx.com"})}
]; ];
fields(position) -> fields(position) ->